fixes signature help resolution for callexpressions#707
fixes signature help resolution for callexpressions#707TwitchBronBron merged 13 commits intomasterfrom
Conversation
|
Added @triwav because I know he worked on some of this before :) |
|
note - 2 tests are failing due to sourcemap errors. reached out to @TwitchBronBron about that. |
…ty/brighterscript into goto-definition/improvements
triwav
left a comment
There was a problem hiding this comment.
Only gave it a quick review but looks good from what I could see. Thanks @georgejecook
TwitchBronBron
left a comment
There was a problem hiding this comment.
Overall, this looks pretty good! I went ahead and refactored the unit tests to use proper indentation and eliminate the beforeEach usage in favor of dedicated code block for each test.
Just one primary thing to address and one question and then I think this should be good to go.
…ty/brighterscript into goto-definition/improvements
That was jolly decent of you - I really appreciate your help there. T h a n k s |
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6) - 2022-11-08 - double `super` call transpile in subclasses ([#740](rokucommunity/brighterscript#740)) - issues with Roku doc scraper and adds missing components ([#736](rokucommunity/brighterscript#736)) [0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5) - 2022-11-03 - Refactor SymbolTable and AST parent logic so that SymbolTables get their parent symbol table from its own (AstNode) ([#732](rokucommunity/brighterscript#732)) - Significant performance boost in `validate()` by caching `getCallableByName` ([#739](rokucommunity/brighterscript#739)) - Add diagnostic when using namespaces as variables ([#738](rokucommunity/brighterscript#738)) - Fix crash in `getDefinition` ([#734](rokucommunity/brighterscript#734)) [0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4) - 2022-10-28 - Add `name` to symbol table ([#728](rokucommunity/brighterscript#728)) - Allow `continue` as local var ([#730](rokucommunity/brighterscript#730)) - language server semanticToken request now waits until validate finishes ([#727](rokucommunity/brighterscript#727)) [0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3) - 2022-10-20 - better parse recovery for unknown function parameter types ([#722](rokucommunity/brighterscript#722)) [0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2) - 2022-10-18 - if statement block var bug ([#698](rokucommunity/brighterscript#698)) [0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1) - 2022-10-18 - Beter location for bs1042 ([#719](rokucommunity/brighterscript#719)) [0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0) - 2022-10-10 - goto definition for enum statements and enum members ([#715](rokucommunity/brighterscript#715)) - nested namespace support ([#708](rokucommunity/brighterscript#708)) - upgrade to [[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03). Notable changes since 3.9.1: - Replace minimatch with picomatch ([roku-deploy#101](rokucommunity/roku-deploy#101)) - fixes signature help resolution for callexpressions ([#707](rokucommunity/brighterscript#707)) - Fix transpilation of simple else block with leading comment ([#712](rokucommunity/brighterscript#712))
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6) - 2022-11-08 - double `super` call transpile in subclasses ([#740](rokucommunity/brighterscript#740)) - issues with Roku doc scraper and adds missing components ([#736](rokucommunity/brighterscript#736)) [0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5) - 2022-11-03 - Refactor SymbolTable and AST parent logic so that SymbolTables get their parent symbol table from its own (AstNode) ([#732](rokucommunity/brighterscript#732)) - Significant performance boost in `validate()` by caching `getCallableByName` ([#739](rokucommunity/brighterscript#739)) - Add diagnostic when using namespaces as variables ([#738](rokucommunity/brighterscript#738)) - Fix crash in `getDefinition` ([#734](rokucommunity/brighterscript#734)) [0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4) - 2022-10-28 - Add `name` to symbol table ([#728](rokucommunity/brighterscript#728)) - Allow `continue` as local var ([#730](rokucommunity/brighterscript#730)) - language server semanticToken request now waits until validate finishes ([#727](rokucommunity/brighterscript#727)) [0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3) - 2022-10-20 - better parse recovery for unknown function parameter types ([#722](rokucommunity/brighterscript#722)) [0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2) - 2022-10-18 - if statement block var bug ([#698](rokucommunity/brighterscript#698)) [0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1) - 2022-10-18 - Beter location for bs1042 ([#719](rokucommunity/brighterscript#719)) [0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0) - 2022-10-10 - goto definition for enum statements and enum members ([#715](rokucommunity/brighterscript#715)) - nested namespace support ([#708](rokucommunity/brighterscript#708)) - upgrade to [[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03). Notable changes since 3.9.1: - Replace minimatch with picomatch ([roku-deploy#101](rokucommunity/roku-deploy#101)) - fixes signature help resolution for callexpressions ([#707](rokucommunity/brighterscript#707)) - Fix transpilation of simple else block with leading comment ([#712](rokucommunity/brighterscript#712))
[0.60.6](rokucommunity/brighterscript@v0.60.5...0.60.6) - 2022-11-08 - double `super` call transpile in subclasses ([#740](rokucommunity/brighterscript#740)) - issues with Roku doc scraper and adds missing components ([#736](rokucommunity/brighterscript#736)) [0.60.5](rokucommunity/brighterscript@v0.60.4...0.60.5) - 2022-11-03 - Refactor SymbolTable and AST parent logic so that SymbolTables get their parent symbol table from its own (AstNode) ([#732](rokucommunity/brighterscript#732)) - Significant performance boost in `validate()` by caching `getCallableByName` ([#739](rokucommunity/brighterscript#739)) - Add diagnostic when using namespaces as variables ([#738](rokucommunity/brighterscript#738)) - Fix crash in `getDefinition` ([#734](rokucommunity/brighterscript#734)) [0.60.4](rokucommunity/brighterscript@v0.60.3...0.60.4) - 2022-10-28 - Add `name` to symbol table ([#728](rokucommunity/brighterscript#728)) - Allow `continue` as local var ([#730](rokucommunity/brighterscript#730)) - language server semanticToken request now waits until validate finishes ([#727](rokucommunity/brighterscript#727)) [0.60.3](rokucommunity/brighterscript@v0.60.2...0.60.3) - 2022-10-20 - better parse recovery for unknown function parameter types ([#722](rokucommunity/brighterscript#722)) [0.60.2](rokucommunity/brighterscript@v0.60.1...0.60.2) - 2022-10-18 - if statement block var bug ([#698](rokucommunity/brighterscript#698)) [0.60.1](rokucommunity/brighterscript@v0.60.0...0.60.1) - 2022-10-18 - Beter location for bs1042 ([#719](rokucommunity/brighterscript#719)) [0.60.0](rokucommunity/brighterscript@v0.59.0...0.60.0) - 2022-10-10 - goto definition for enum statements and enum members ([#715](rokucommunity/brighterscript#715)) - nested namespace support ([#708](rokucommunity/brighterscript#708)) - upgrade to [[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#392---2022-10-03). Notable changes since 3.9.1: - Replace minimatch with picomatch ([roku-deploy#101](rokucommunity/roku-deploy#101)) - fixes signature help resolution for callexpressions ([#707](rokucommunity/brighterscript#707)) - Fix transpilation of simple else block with leading comment ([#712](rokucommunity/brighterscript#712))
This pr addresses the following issues:
This implementation uses the new AST searchign, and parent offerings; plus some of the work done to imrpove AST fail-over when a parsing failure occurs (e.g. for presently-edited-lines, which may have invalid parenthesis/bracket pairing).
I took the approach of consolidating code that was in Program and in BrsFile, into SignatureHlepInfo, which is conceptually part of the bscPlugin.
I also added the CallExpressionInfo class, to allow us to process and store info about a call expressions' state and type, which is useful for signature resolution, and, in my next few contributions, improvements to completions, and go to definition, too.
Testing is exhaustive, having covered the types:
However, due to having written this on program originally, then extracting to the utility classes, the tests are more integration tests in their nature.
I have also shared video of how the feature works in the IDE, which clearly demonstrates the great improvements herein.