views:

781

answers:

2

Hi,

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.

+1  A: 

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
A: 

Sample code (C#) for enabling syntax highlight, and techics, avoiding using external files is described in this post

Basically you need to call method SetHighlighting("Mode"), where Mode is name of your syntax schema

Ernest