We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Is it possible to do make intellisense in editcontrol really understand the language

let say i am making a c# text editor, i would like to provide this kind of intellisense

i am typing the following in editcontrol after the line
public class abcd
     public void MethodA() { }
     public void MethodB() { }

public class xyz
     public void MethodM() {
          abcd var1 = new abcd();
          var1. <----- after i type the dot, i want intellisense popup and show MethodA and MethodB for me to select. Is it possible

Another example i want to do is SQL
i have a table (named: tbl1) and it has 2 columns (colA, colB).

after i type this line
select * from tbl1 a

i go back to replace the * to field name
select a. from tbl1 a <--- after i type a., i want intellisense show colA and colB for me to select. Is it possible

1 Reply

KP Kanniyappan Panneer Selvam Syncfusion Team August 9, 2019 02:12 PM UTC

Hi Alex, 
Thanks for contacting syncfusion support. 
We have checked your query “Need Intellisense popup for C# and SQL text editor” at our end. We have configured the custom intellisense for properties and methods from the provided C# code. We have prepared the sample based on the provided information. You can follow the same procedure to SQL language also. Please find the code snippet, screenshot and sample for the same. 
Code Snippet: 
// Creates new file using C# language configuration. 
            // Creates format for methods coloring. 
            ISnippetFormat formatMethod = editControl1.Language.Add("Method", "Text"); 
            formatMethod.FontColor = Color.HotPink; 
            // Creates format for properties coloring. 
            ISnippetFormat formatProperty = editControl1.Language.Add("Property", "Text"); 
            formatProperty.FontColor = Color.Goldenrod; 
            // Disables ContextChoiceList dropping after dot in global context. 
            ConfigLexem lexemDot_ = GetConfigLexem((IConfigLexem)editControl1.Language, "."); 
            lexemDot_.DropContextChoiceList = false; 
            // Add configuration for "Property1" 
            ConfigLexem this_Property1 = GetConfigLexem((IConfigLexem)editControl1.Language, "var1"); 
            this_Property1.Type = FormatType.Custom; this_Property1.FormatName = "Property"; 
            this_Property1.IsComplex = true; 
            // Add configuration for "." after "Property1" 
            ConfigLexem propertyDot = GetConfigLexem((IConfigLexem)this_Property1, "."); 
            propertyDot.Type = FormatType.Operator; 
            propertyDot.DropContextChoiceList = true; 
            propertyDot.IsComplex = true; 
            propertyDot.Priority = 10; 
            // Add "Method1" configuration after "this.Property1." 
            ConfigLexem property_Method1 = GetConfigLexem((IConfigLexem)propertyDot, "MethodA"); 
            property_Method1.Type = FormatType.Custom; property_Method1.FormatName = "Method"; 
            property_Method1.IsComplex = true; 
            // Add "Method2" configuration after "this.Property1." 
            ConfigLexem property_Method2 = GetConfigLexem((IConfigLexem)propertyDot, "MethodB"); 
            property_Method2.Type = FormatType.Custom; property_Method2.FormatName = "Method"; 
            property_Method2.IsComplex = true; 
            m_MethodComments[this_Property1.ID] = "The only one propertyIt has multiline description"; 
            m_MethodComments[property_Method1.ID] = "Method 1"; 
            m_MethodComments[property_Method2.ID] = "Method 2"; 
Please try the above solution  and let us know if it is helpful. 
Kanniyappan P 

Live Chat Icon For mobile
Up arrow icon