-
Notifications
You must be signed in to change notification settings - Fork 41
Implement support for bracket syntax, fixes #70 #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for bracket syntax, fixes #70 #92
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.