Completion List for variable in Syntax Editor

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 4 years ago by Scott Jeslis
Version: 18.1.0674
Avatar

In the SDI Editor sample I can run it, paste the following code in it and enter "eventName." to get completion list for .NET C# string methods.

    public class TestProcessor : IProcessor
    {
        public CICHelper Helper { get; set; }

        public void Initialize(string eventName, string eventValue, string stepName, string applicationName, string projectName, string projectDir)
        {
            
        }
	}

I've done all the setup the sample does in my code but I can't get this to show up in my editor.

I also search the Samples solution and nowhere does the SDI Editor catch a "." being entered.

Any suggestions where to look?

I handle the change event like this:

		private void Editor_OnDocumentTextChanged(object sender, EditorSnapshotChangedEventArgs e)
		{
			if (e.TextChange.Source == editor.ActiveView)
			{
				if (e.IsTypedWordStart)
				{
					// If no completion session is currently open, show a completion list
					if (!editor.IntelliPrompt.Sessions.Contains(IntelliPromptSessionTypes.Completion))
					{
						// Open the completion list session here
						EditorCommands.RequestIntelliPromptCompletionSession.Action.Execute(editor.ActiveView);
					}
				}
				else
				{
					// The e.TypedText is not null only when a Typing change occurs with a single operation that inserts text,
					//   so we can check that to display the completion list when "<" is typed
					switch (e.TypedText)
					{
						case ".":
						{
							// A dot was typed so open the completion list session here
							// If no completion session is currently open, show a completion list
							if (!editor.IntelliPrompt.Sessions.Contains(IntelliPromptSessionTypes.Completion))
							{
								// Open the completion list session here
								EditorCommands.RequestIntelliPromptCompletionSession.Action.Execute(editor.ActiveView);
							}
							break;
						}
					}
				}
			}
		}

The IsTypedWordStart section works and I do hit breakpoints in switch statement for "."

Comments (1)

Answer - Posted 4 years ago by Scott Jeslis
Avatar

Never mind. Got it to work. I think an exception on loading my custom assembly was getting in the way :-(

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.