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 java #2674

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add item scope to java #2674

wants to merge 3 commits into from

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 9, 2024

int[] values = {1, 2, 3};

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 values = {1, 2, 3}. I don't think this can be solved until we have a better oneOf implementation of collection item.
Same problem with JS #2675

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 10:53
@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 Added item scope to java Add item scope to java Nov 9, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 18, 2024
```js
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

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
cursorless-bot pushed a commit to hands-free-vim/cursorless.nvim that referenced this pull request Nov 18, 2024
```js
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
cursorless-dev/cursorless#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

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
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