Posted 11 years ago by eric
Version: 4.0.0274
Avatar
Hi all,

I added a simple SyntaxEditor to a form. In the form_load i added the following code :

DotNetProjectResolver resolver = new DotNetProjectResolver();
resolver.CachePath = myCachpath ;
syntaxEditor1.Document.Language = new CSharpSyntaxLanguage();
syntaxEditor1.Dock = DockStyle.Fill;
syntaxEditor1.LineNumberMarginVisible = true;
syntaxEditor1.BracketHighlightingVisible = true;
syntaxEditor1.Document.Outlining.Mode = OutliningMode.Automatic;
and i added the following events to the editor

void syntaxEditor1_KeyTyping(object sender, KeyTypingEventArgs e)
        {
            if (e.KeyChar == '.')
            {
                if (syntaxEditor1.SelectedView.GetCurrentLanguageForContext().IntelliPromptMemberListSupported)
                    syntaxEditor1.SelectedView.GetCurrentLanguageForContext().ShowIntelliPromptMemberList(((SyntaxEditor)sender));
               
            }
        }

     
        private void syntaxEditor1_DocumentSyntaxLanguageLoaded(object sender, SyntaxLanguageEventArgs e)
        {
            syntaxEditor1.Document.LanguageData = resolver;
            resolver.AddExternalReferenceForMSCorLib();
            resolver.AddExternalReferenceForSystemAssembly("System");
            resolver.AddExternalReferenceForSystemAssembly("System.Data");
            resolver.AddExternalReferenceForSystemAssembly("System.Drawing");
            resolver.AddAllAssembliesInAppDomainAsExternalReferences();
        }
On runtime, when i write the following code

using System;                            
using System.Collections.Generic;

class Test
{
    public static void Main(string[] args)
    {
        Test t = new
    }
}
the intelliprompt is displayed but the item "Test" is not displayed, did i forget do add something?

Thanks for your help

Comments (5)

Posted 11 years ago by eric
Avatar
Please is there any idea? I can't what's missing .

[Modified at 06/20/2008 09:10 AM]
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eric,

Please make sure you read all the "Key steps for getting started" items in the .NET add-on's main documentation page.

It looks like you are missing several of those key steps, namely the starting of the semantic parser service and setting Document.Filename (this would cause your issue).


Actipro Software Support

Posted 11 years ago by eric
Avatar
Thanks, it works !

I added :

syntaxEditor1.Document.Filename = "myFileName";
(SemanticParserService.Start() already exist but i didn't write it :$).


Why is the FileName is important in displaying the right intelliprompt?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The reflection information is stored in a cache and is indexed by a string key. That filename is used for indexing source code that doesn't come from an assembly.


Actipro Software Support

Posted 11 years ago by eric
Avatar
Thanks for the answer and for the information.

when i create the editor i set the filename as an empty string, and when the user save it, i change in runtime.

Thanks again.
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.