PerformSemanticParse(... request.Filename)?

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Hugh Pritchett
Version: 4.0.0245
In the following code snippet:

        void ISemanticParserServiceProcessor.Process(SemanticParserServiceRequest request)
            request.SemanticParseData = MergableLexicalParserManager.PerformSemanticParse(this, request.TextBufferReader, request.Filename) as ISemanticParseData;
What exactly is request.Filename? What filename does this correspond to? It's a required parameter and there are no overloads for PerformSemanticParse. The help file I have doesn't document it well since it looks like this parameter has been recently added. It doesn't correspond to the filename of the source code that is being parsed is it? In my case, I am not loading the source from a file.

Any detailed information on this parameter and how it is used would be greatly appreciated.

Thanks in advance!

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Yes the filename comes from your original parse request, which generally gets placed there via the Document.Filename property. The filename can really be anything but it must uniquely identify the code that is being parsed. In our C#/VB add-on we use the filename to differentiate between various source files that are loaded for reflection.

So really you can use it to identify the semantic parse data that is created. ICompilationUnit.SourceKey is where that gets stored. Then once you have updated data, if you are keeping a cache of data you would know which existing semantic parse data to replace in your cache based on the SourceKey name.

Actipro Software Support

Posted 14 years ago by Hugh Pritchett
Thank you.
The latest build of this product (v2020.1 build 0403) 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.