kaby76 / AntlrVSIX

AntlrVSIX is a language server for use with Visual Studio 2019, Visual Studio Code, and Gnu Emacs to support Antlr, Bison, and W3C EBNF grammars. In addition to the IDE extensions provided here, a command-line tool is available to refactor grammars in order to make them cleaner, more readable, and more efficient.
https://marketplace.visualstudio.com/items?itemName=KenDomino.AntlrVSIX
MIT License
90 stars 13 forks source link

Trash "foldlit //lexerRuleSpec/TOKEN_REF" really slow for PlSqlParser/Lexer.g4 #100

Closed kaby76 closed 3 years ago

kaby76 commented 4 years ago

There are 2000+ lexer symbols for //lexerRuleSpec/TOKEN_REF. Looking over the code, it first verifies that each is a candidate s.t. the RHS is a string literal. This takes at least 15 minutes to perform (killed--did not wait).

kaby76 commented 4 years ago

In addition, the foldlit did nothing, and I know I see literals in the parser! The Foldlit rule appears to not deal with all occurrences of the string literal in all files. It only deals with the Imports relation, but it should go through all refs of this symbol, which could be in many files.

kaby76 commented 4 years ago

After fixing this, I noticed that parse that occurs during the enactedits is ripping slow. When I read in the files that were changed, it parses quickly.

kaby76 commented 4 years ago

Foldlit requires a LHS symbol, which means it needs to have the lexer.g4 on top of the stack. But, after the new code is created and changed, the stack contains the top of stack containing the parser--the lexer is gone, and there are two file entries on the stack for the parser.

kaby76 commented 3 years ago

At the moment, it takes 9 m for the foldlit operation.

kaby76 commented 3 years ago

Fixed in 8.2.