Skip to content

Repack seems to only works on valid delimiters? #1751

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
Kn0rk opened this issue Aug 8, 2023 · 4 comments
Closed

Repack seems to only works on valid delimiters? #1751

Kn0rk opened this issue Aug 8, 2023 · 4 comments

Comments

@Kn0rk
Copy link

Kn0rk commented Aug 8, 2023

image

quad repack [W]hiskey

Will replace the curly brackets around the function rather than the single quotes around the (fake) string. In Java single quotes are only used for characters and double quotes are used for strings. As such defining a string with single quotes is incorrect. I am assuming that the delimiter search is based on the parser which does not recognize the single quotes as delimiters.

To reproduce:

Create a java file in the vscode and paste:

public class TestSingleQuoteDelimiter {
    
    public static void main(String[] args) {
        String notAString = 'this will not work';
    }
  
}

The result after the command is:

public class TestSingleQuoteDelimiter {
    
    public static void main(String[] args) "
        String notAString = 'this will not work';
    "
    
}

@pokey
Copy link
Member

pokey commented Aug 8, 2023

@AndreasArvidsson would #1600 help here?

@Kn0rk
Copy link
Author

Kn0rk commented Aug 8, 2023

Yes, I think that should fix it. Since tree sitter would not know what to do with the single quotes they should remain as valid delimiters.

Srry I didn’t find that issue when i was searching for similar issues.

@AndreasArvidsson
Copy link
Member

I think so

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants