-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix Go select indenting #5713
Fix Go select indenting #5713
Conversation
Hmm I think this is still incorrect: we do want to indent the select {
case c <- x:
x, y = y, x+y
case <-quit:
fmt.Println("quit")
return
} \cc @Triton171 what would the correct indentation class be here? |
The problem in #5610 is caused by the
|
@Triton171 This solves the issue using the concept you mentioned. However, this also incorrectly indents |
You have an error in your queries (which is also why the pipeline is failing):
Just add the |
I tried this solution, and ran into the same errors as with the previous one. I'm not sure what you're really suggesting here. |
My mistake, I didn't know that tree-sitter requires captures to occur in the query before they are used in a predicate (so contrary to what is suggested in the documentation, the position of predicates inside a pattern actually does matter). Moving the predicate to the end fixes the error. The following
The The only issue I noticed is that after having writing |
That solution works perfectly on my end. No errors, and the subtree looks correct to me. |
Resolves #5610
Select statements previously were incorrectly indented.
Before this PR:
https://asciinema.org/a/VnOgUThOMTeK3gP2nRr5YQmTt
After this PR:
https://asciinema.org/a/pPAl4ghHjTp6TCiIy4yLIeyUf