Skip to content
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

Add item scope to JS #2675

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Add item scope to JS #2675

merged 3 commits into from
Nov 18, 2024

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 9, 2024

const value = [1, 2];

This example is problematic. Currently we test the language specific implementation before the text based one. This means that if your cursor is inside the curly brackets item is value = [1, 2]. I don't think this can be solved until we have a better oneOf implementation of collection item.
Same problem with Java #2674

To fix that above I made a change so that the text based item can be used even if there is a syntax tree one available if it's smaller. This needs to merge before the java pr.

Checklist

  • I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner November 9, 2024 11:07
@AndreasArvidsson AndreasArvidsson mentioned this pull request Nov 9, 2024
1 task
@AndreasArvidsson AndreasArvidsson marked this pull request as draft November 9, 2024 11:19
@AndreasArvidsson AndreasArvidsson changed the title Add js item scope Add item scope to JS Nov 9, 2024
@AndreasArvidsson AndreasArvidsson marked this pull request as ready for review November 9, 2024 12:49
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good for now. I wonder if we have other examples we can use to test this?

@AndreasArvidsson
Copy link
Member Author

Seems good for now. I wonder if we have other examples we can use to test this?

Good question. Got anything in mind?

@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Nov 18, 2024
Merged via the queue into main with commit 8cf3464 Nov 18, 2024
15 checks passed
@AndreasArvidsson AndreasArvidsson deleted the jsItem branch November 18, 2024 07:49
@pokey
Copy link
Member

pokey commented Nov 18, 2024

No, I couldn't come up with anything 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants