Pre-compilation pass to capture alternate definitions #51
Labels
component: Server.LSP
Issue involves the LSP server process
skill:antlr
Issue that involve Antlr grammar and/or parse trees
Milestone
Rubberduck needs a way to access the "dead code" tokens from the pre-compilation parse pass.
That way we could access the different possible declarations of a given definition (RD got 'em backwards I think), and thus support the LSP "definition" (or "declaration"?) requests.
Rubberduck 2.x assumed to be working with compilable code at all times, and would bail otherwise.
Rubberduck 3.0 reports syntax errors instead, so we get to analyze error nodes and still work out the identifier names here:
There might be a way to recover these nodes as some
ConditionalCompilationDeadCodeContext
, or to otherwise have a way to suppress the conditional compilation related "syntax errors" - so they don't consistently appear with red squiggles in the Rubberduck Editor. The error handler already filters some specific syntax errors to issue specific error messages, it's wouldn't be impossible to achieve the desired result via syntax errors.Having this information also allows the LSP server to mark that code as "unreachable" for formatting purposes, so the editor can (should) render it dimmed/fainted. It also gives us multiple navigable definitions for that
DoSomething
procedure andValue
parameter`. Only one of these definitions is ever "live", so identifier resolution and the semantic layer wouldn't necessarily need major tweaks to support this, I think.The text was updated successfully, but these errors were encountered: