Closed msftrncs closed 3 years ago
I've tested and it works fine. Although it works very slow. Anyway, could you please resubmit this PR against develop branch? I use Git Flow, so master is the latest release.
It might be slower for sure, but on my system with most the files I have used it with, including the test.st
file, it populates the outline nearly instantly. The regex's are fairly complicated, and have to consume large amounts of the document carefully in order to insure they only find valid closing keywords/punctuation. As a reference, the VS Code TextMate grammar.ts
file takes about 3 seconds to provide symbols for a 1500 line file. The test.st
file loads symbols so fast it appears instantly for me, at 1000 lines. My machine is a 8th gen Core i7.
Perfect! I'll make another review and release new version today.
I'm (was) going to force one more commit, cleaned some unneeded sections from regex to not skip over quoted strings where an identifier is expected.
I'll commit it up to the same branch. You can take a look at it at your leisure, as its really minor.
Overhaul of SymbolProvider.ts to more thoroughly process well known POU symbols excluding symbol discovery in comments or quoted text, and with recovery of parsing on syntax errors where ever possible.
INTERFACE
,METHOD
,ACTION
keywords.VAR_GLOBAL
and others.VAR
's even when not nested in appropriate POU's.RETAIN
,CONSTANT
,PERSISTENT
,PUBLIC
,PRIVATE
, etc...VAR
keyword, often utilizing different attributes.CONSTANT
symbols.STRUCT
based types (simple types).UNION
structures.vscode.SymbolKind
selections for some symbols.POINTER TO ARRAY[x..y] OF FB_ProcessSomething
.References issue #25.