Skip to content

Fix java double quote surrounding pair scope type when cursor is after final quote #329

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

Closed
pokey opened this issue Nov 23, 2021 · 1 comment
Labels
bug Something isn't working lang-java

Comments

@pokey
Copy link
Member

pokey commented Nov 23, 2021

Unlike most other languages in tree-sitter, java doesn't actually have any tokens for quotation marks. We're mostly able to work around this fact using some hacks, but the following case was a challeng to implement, so we're punting for now:

spokenForm: take outside
languageId: java
command:
  actionName: setSelection
  partialTargets:
    - type: primitive
      modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: includeDelimiters}
  extraArgs: []
initialState:
  documentContents: "\"hello\""
  selections:
    - anchor: {line: 0, character: 7}
      active: {line: 0, character: 7}
  marks: {}
finalState:
  documentContents: "\"hello\""
  selections:
    - anchor: {line: 0, character: 0}
      active: {line: 0, character: 7}
  thatMark:
    - anchor: {line: 0, character: 0}
      active: {line: 0, character: 7}
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: surroundingPair, delimiter: any, delimiterInclusion: includeDelimiters}}]

We should probably look for all descendants of type string and then yield their first and last characters as quotes.

@pokey pokey added the bug Something isn't working label Nov 23, 2021
@pokey pokey mentioned this issue Nov 23, 2021
30 tasks
@AndreasArvidsson AndreasArvidsson assigned pokey and unassigned pokey Jul 2, 2023
@AndreasArvidsson
Copy link
Member

Now supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang-java
Projects
None yet
Development

No branches or pull requests

2 participants