variables declaration in the HeaderText

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 17 years ago by ori
Version: 4.0.0257
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hello,

I tried to set a variable declaration inside the header text, but the variable was not shown in the intelli-prompt. Example:

editor.Document.HeaderText = "namespace MyNamespace { class MyClass { void myMethod() { int i;";
editor.Document.FooterText = "}}}";
The variable 'i' is not shown in the intelli-prompt.

Thanks.

Comments (5)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
For some reason the i declaration wasn't being detected if there wasn't a whitespace or line feed character after it in the header text. If you add a line feed to the end of the header text it will work.


Actipro Software Support

Posted 17 years ago by ori
Avatar
will it be fixed?
Posted 17 years ago by ori
Avatar
I checked and found out that if the header text contains an inner class declaration - it is not found in the intelli-prompt
Posted 17 years ago by ori
Avatar
OK, I set the editor's filename and now the inner class in the header text is seen in the intelli-prompt (like it says in the help)
Should I put real filename in a temp dir? I don't get the filename issue...

Thanks,
Ori
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes, it is fixed for the next maintenance release.

Each compilation unit requires a unique "source key" that it uses to store its code in the project resolver. If you have a new document open, it needs a way to identify the classes in that document. You do this by setting the filename, which in turn is used as the key for the hashtables in the project resolver. Even if you just set it to a string GUID, that is fine. Then when semantic parse updates occur, the project resolver takes out any types defined in that source key and replace them with new types with the same source key.

To sum up, just specify some unique string to the filename since that is used as the key when storing compilation unit data for your source code in the document.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.