Turn off parsing for specific files

SyntaxEditor for WPF Forum

Posted 1 year ago by horato
Version: 18.1.0671
Avatar

Hello,

I have syntax editor with .net addon and CSharpParser. There is asynchronous call that retrieves collection of source codes which are then added to IProjectAssembly by calling _projectAssembly.SourceFiles.QueueCode() method. These source codes are only good for intellisense and do not change.

It seems to me that the parse is divided into 2 stages. First is some kind of "quick parse" that generates intellisense entries and then there is second parse which analyzes the source codes for errors. The issue I am facing here is that this second parse takes over a minute to complete and consumes large amount of CPU. I also use roslyn diagnostics so the second parse seems redundant to me. Is it possible to completely disable syntax parse and only generate intellisense entries? Is there any way I can use roslyn to generate intellisense entries?

 

Thank you

Comments (5)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

There is actually only one parse routine (no separate quick parse).  That parse routine examines the document's tokens and builds up an AST, while also recovering from and reporting syntax errors along the way.  The resulting parse data contains both the AST and syntax errors.

QueueCode() executes the parse routine described above.  The resulting parse data is then examined and merged into the IntelliPrompt cache for the project assembly.

While we support Roslyn for assembly (.dll) IntelliPrompt, we don't support it for source code IntelliPrompt.

Parsing shouldn't take a minute to complete for a single file though unless it's enormous.  Are you saying it's taking a minute for many files or for a single file?  How big is the file?


Actipro Software Support

Posted 1 year ago by horato
Avatar

Actually it took over a minute for all of the files to get parsed, not only one. There is around 3000 entries, most of them are single class with a bunch of usings and 2 methods tops. Also, we generate these supporting source codes without their bodies, just an exception there, so they are small.

I've switched back to original implementation without permanent roslyn workspace as it seemed to have no effect on the diagnostic speed. The parse speed of the whole thing now dropped to around 20s. QueueCode on all of the files takes roughly 800ms.

Can you think of anything that could be done here?

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Do these generated files ever change?  If you could just dump all of them into a single C# document and have it parse that one document instead of parsing 3000 different documents, I would think that might go faster since there's less overhead involved.  I'm curious what the speed increase would be in that case.


Actipro Software Support

Posted 1 year ago by horato
Avatar

The only way they could change is by generating them again.

I've string.join'ed the files into one large string and the parse took (according to visual studio debugger) 17 seconds.

[Modified 1 year ago]

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Could you ZIP up the single file and send that to our support address in a renamed .zip extension?  Please reference this thread in your email and we can take a look to see if we have any suggestions.  Thanks!


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.