2

I've integrated ICSharpCode.TextEditor into VB.NET and it run smoothly without error. But, I cannot find in properties window the property to enable or select the syntax highlighting features as well as intellisense. I don't have any experience with ICSTE, so please help me. Thanks you.

ByulTaeng
  • 1,269
  • 1
  • 21
  • 40

2 Answers2

2

Here is code from my project

//Initialize HM
HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(AppDomain.CurrentDomain.BaseDirectory));

//Setup current Highlighter

IHighlightingStrategy highlighter = HighlightingManager.Manager.FindHighlighter("SQL");
txtQuery.Document.HighlightingStrategy = highlighter;

Ensure that file SQL.xshd exists in AppDomain.CurrentDomain.BaseDirectory

As for entellisense you should implement it mostly yourself using this code

private void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char ch)
        {

            try
            {
                codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
                    this,
                    codeEditorControl,
                    "<code>",
                    completionDataProvider,
                    ch);
                if (codeCompletionWindow != null)
                {
                    codeCompletionWindow.Closed += delegate
                                                    {
                                                        _blockKeys = false;
                                                    };

                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Sergey Mirvoda
  • 3,209
  • 2
  • 26
  • 30
0

See this project on github : ICSharpCode.TextEditorEx and nuget : ICSharpCode.TextEditorEx

This version exposes a property SyntaxHighlighting which you can use on designer mode to set the syntax highlighting.

Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121