Hi,
I've created a custom language for Syntax Editor but I face a small problem after providing manually the Keyword list. Whenever I type a keyword text is replaced to the correct keyword. So for example we have a keyword "Using" but if I type in the Editor text "using" it gets replaced after losing focus or hitting enter even this is inside of string.
Our compiler code is case sensitive and it is OK from this point. However we did not covered this text as part of text and this should not change any text inside of text string with quotations.
I see here two options:
Keyword added to the grammar by this code:
var grammar = PlainTextLanguage.Instance.Grammar.Clone(); new MyLanguageSyntax().SyntaxElements.Cast().ToList().ForEach(element => { grammar.LexerStates.DefaultLexerState.Symbols.Insert(0, element.Keyword, element.Keyword, TerminalSymbolComparison.LiteralIgnoreCase).LanguageElement = LanguageElement.ContextSensitiveKeyword; }); return new CustomLanguage(grammar);
How can I turn this auto correct feature for SyntaxEditor?
Or how to add the string handling? An example of code with 1st occurrence is OK but second one should be untouched:
Using XName(Application.Interfaces.ITest, Application.TestImplementation) function Target(xName value) < <A "Text using value"> <A value.Property> >
Hello Tomas,
Thank you for contacting Infragistics!
To achieve the behavior you want you are going to have to modify your regex. You are going to have to make it more specific/constricting.