Implement support for bracket syntax, fixes #70#92
Implement support for bracket syntax, fixes #70#92clinyong merged 5 commits intoclinyong:masterfrom Eldemarkki:bugfix/70-bracket-syntax-cannot-jump
Conversation
|
@clinyong I have fixed the merge conflicts, would it be possible to get this PR reviewed? :) |
|
2023, sorry😂 I'll have a look, but needs some time. |
|
@Eldemarkki Does completion work well on your side? I cloned your branch and ran it locally. It doesn’t enter the
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for bracket syntax for jump-to-definition and autocomplete functionality, addressing issue #70.
- Added new tests to verify bracket syntax handling in jump-to-definition and autocomplete providers.
- Updated regex patterns and parsing logic in DefinitionProvider.ts and CompletionProvider.ts to handle bracket notation.
- Included style changes as enforced by editorconfig.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/suite/DefinitionProvider.test.ts | New tests for bracket syntax jump-to-definition |
| src/test/suite/CompletionProvider.test.ts | New tests for bracket syntax autocompletion |
| src/test/fixtures/sample.jsx | Fixture updates to support autocompletion with bracket notation |
| src/DefinitionProvider.ts | Enhanced parsing logic and regex to support bracket syntax |
| src/CompletionProvider.ts | Adjusted trigger logic and word extraction for bracket syntax |
|
@clinyong You had to press Ctrl+Space to "manually" open the completion list. But now I added |
|
LGTM~ Thanks for your contribution. |

Still missing support for combining optional chaining with bracket syntax, e.g.
styles?.["mainButton"]. I didn't implement it because I don't know how important it is (I don't need it), but I can try implementing it in this PR if you want :)Fixes #70
P.S. There were some style changes enforced by editorconfig, that's why there are so many unrelated changes.