SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Using standalone code completion for my custom application

Last post 08-28-2013 11:26 PM by Davi. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 08-28-2013 11:26 PM

    • Davi
    • Not Ranked
    • Joined on 08-28-2013
    • Posts 1

    Using standalone code completion for my custom application

    Hello!

    As described in this post, I'm trying to use some functionalities for my custom application.

    Here are some fragments of code that I have written in order to show completion list:

    • Initialization:

               var core = new CoreStartup("MyApp");
               core.ConfigureExternalAddIns(@"C:\Program Files (x86)\SharpDevelop\4.2\AddIns\ICSharpCode.SharpDevelop.addin"); // default IDE addins
               core.StartCoreServices();

     

    •  TextEditor creation:

     

    var service = new AvalonEditorControlService();

               object control = null;
               service.CreateEditor(out control);
               textEditor = (SharpDevelopTextEditor)control;
               textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(".cs");
               CodeCompletionEditorAdapter completionAdapter = new MyCustomCodeCompletionEditorAdapter(textEditor); // just overrides FileName returning "temp.cs"
               textEditor.TextArea.TextView.Services.AddService(typeof(ITextEditor), completionAdapter);

    • Completion Trigger (in some button or anything else) 

     

                ITextEditor editor = (ITextEditor)textEditor.TextArea.GetService(typeof(ITextEditor));
                new DotCodeCompletionItemProvider().ShowCompletion(editor);

     

    • I have also modified this method to public and called it on the initialization
      public static void InitializeParserService

     

    When I debug ParserService.cs(line 212 - "foreach (ParserDescriptor descriptor in parserDescriptors) {", parserDescriptors is empty, and it causes "CodeCompletionItemProvider.GetExpressionFromOffset" to return ExpressionResult.Empty, empty intellisense items and no intellisense =/

    In my project there is no concept of project or solutions, but I do have my imported dlls and scoped variables.

    Are there any guidelines that would help me in this task?

    Thanks for the help and for the great work on this library! 

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.