Old variables still exist in code completion suggestions

SyntaxEditor for WPF Forum

Posted 8 years ago by Frederik St-Onge
Version: 16.1.0633
Avatar

In my application, i am using a global project assembly and language. I create a new editordocument and set its language to my global language.

 

It looks like that :

 

var document = new EditorDocument();

document.Language = syntaxLanguage;

document.SetHeaderAndFooterText(header, footer);

this.Document = document;

 

Document is then bound to my view.

 

The issue is, whenever i delete a variable, it's still appear in the code completion.

Is there a way to refresh the code completion? Or a way to remove the document from the project assembly?

 

Thank you for your help :)

Comments (5)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frederik,

When you mean you are deleting a variable, do you mean from editing the document text in the SyntaxEditor or by updating the header/footer text?


Actipro Software Support

Posted 8 years ago by Frederik St-Onge
Avatar

It seems to be happening with the variable placed in my header/footer only. Should I unset my header/footer when done with the control? It seems like the document still exists somewhere and i can still see all variables because my header was in the same namespace.

[Modified 8 years ago]

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frederik,

Any time you call SetHeaderAndFooterText, the document should be firing off a text change and thus triggering a reparse, which will in turn end up updating the data used for IntelliPrompt.  Did you follow all the steps in the C# Language documentation Getting Started topic like setting a FileName on the document?  If you don't set a FileName, some things might get registered using the document's Unique ID instead.

If you still can't figure it out, please make a new simple sample project that shows the issue and email that to our support address.  In your email, please reference this thread and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 8 years ago by Frederik St-Onge
Avatar

The thing is that we do not need the document in the future. Best case scenario would be to remove that file from the language's IProjectAssembly. I could use SetHeaderAndFooterText(string.Empty, string.Empty), but the way i see this, it wouldn't be a good practice.

I believe setting the fileName wouldn't fix my issue, because we do not have a consistant id for all context we are using the syntaxeditor.

Any idea what would be the easiest way to unregister that file from the IProjectAssembly to remove it from the data used in IntelliPrompt?

 

Thank you! :)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

I believe if you set the document's Language bacl to something else, it will detach from the C# language and remove any entries it had there.  Note you can't set the Language to null but you can set it back to SyntaxLanguage.PlainText.


Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.