Hi, I am new to SyntaxEditor. I just make the lexical parser from dynamic language XML definition and syntax coloring work well. I still studying to make semantic parser to work.
I want to create a simple cut down C# IDE that is actually in a method body scope, no OOP, no inteliprompt member list and at last it will inserted into hard coded predefined class to be built into a dll file.
Now I try to show inteliPrompt list immediately after a first letter is pressed, so I can show any of data types, user defined variables and predefined methods. I found this thread http://www.actiprosoftware.com/support/forums/viewforumtopic.aspx?ForumTopicID=5872 shows an example to trigger it from SyntaxEditor.KeyTyped event:Now when I press "s" (for string) it will show the inteliPrompt well with "bool" and "string" in the list. However it seems the first "s" is forgotten:
[Modified at 08/01/2011 11:14 PM]
I want to create a simple cut down C# IDE that is actually in a method body scope, no OOP, no inteliprompt member list and at last it will inserted into hard coded predefined class to be built into a dll file.
Now I try to show inteliPrompt list immediately after a first letter is pressed, so I can show any of data types, user defined variables and predefined methods. I found this thread http://www.actiprosoftware.com/support/forums/viewforumtopic.aspx?ForumTopicID=5872 shows an example to trigger it from SyntaxEditor.KeyTyped event:
// If the typed character was a letter...
if (Char.IsLetter(e.KeyChar)) {
// See if a new token starts after the character that was typed
var stream = editor.Document.GetTextStream(editor.Caret.Offset);
if (stream.IsAtTokenStart) {
// See if the character that was typed started a new token
stream.ReadCharacterReverse();
if (stream.IsAtTokenStart) {
// Show member list here
// I add "bool" and "string" to test.
}
}
}
- If I focus to "string" and press enter it will become "sstring" in the editor
- If I press the second "s" to make it become "ss" then inteliPrompt will just focus on the "string" (seems that is my first typed "s")
- When the first letter typed, how to make the inteliPrompt immediately popup and it will focus on the related member by taking the first latter into account, in this case "string"?
- TextStream from Document.GetTextStream() is disposible, can I immediately dispose it or did the instance is reuseable inside Document?
- Did the inteliPrompt can automatically search for a keyword and minimize the list or I need to Clear() and polulate the MemberList again each time key pressed? e.g: when I type "day" it will show only "IsWeekDay" and "GetPublicHolidays", when I add "s" it will only has "GetPublicHolidays".
- Which one is the best time to populate the intelliPrompt, based on SyntaxEditor.KeyTyped event or after I implement semantic parsing and I have many AST nodes, how? I need to show MemberList differently whether it is in document line start, in method parameter, in if condition or anything else that is need to look around the TextStream in SyntaxEditor.KeyTyped and mixed with DynamicOutliningSyntaxLanguage.OnSyntaxEditorTriggerActivated event. Seems like I just mess around only for showing inteliprompt in different conditions.
[Modified at 08/01/2011 11:14 PM]