Skip to content

Conversation

@x4132
Copy link
Contributor

@x4132 x4132 commented Oct 23, 2025

Previously whenever a condition such as < was typed the corresponding closing bracket would also be autocompleted, this is extremely annoying and unhelpful for users. This disables autoclose. For class instantiation autocomplete already autocloses the closing bracket.

@cla-bot cla-bot bot added the cla-signed label Oct 23, 2025
@tartarughina
Copy link
Collaborator

I think that providing an option for not_in is a better approach.
Are we able though to understand from tree-sitter when auto closing should or shouldn't be enabled?

Auto closing of angled brackets, even if limited, is a nice feature to have. But if inequalities cannot be isolated then let's consider the other instances where < is going to be used before committing the change.

@x4132
Copy link
Contributor Author

x4132 commented Oct 23, 2025

I think that providing an option for not_in is a better approach. Are we able though to understand from tree-sitter when auto closing should or shouldn't be enabled?

I don't think angle bracket pairs are used for anything except generics in Java, while individual angle brackets are obviously used for comparisons. I would agree that adding not_in rules would be better, but there are a lot more edge cases to think about first.

For example, differentiating between the following two lines:

ArrayList<Integer> foo = new ArrayList<>(); boolean bar = 1 < 2;

It's definitely possible but will take a lot more effort, definitely easier ones such as if statements or strings can be added but having rules for the other ones might be more difficult. Is there the opposite (an in rule) instead?

Copy link
Collaborator

@playdohface playdohface left a comment

Choose a reason for hiding this comment

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

We can add autoclosing generics-brackets, but for the time being I think this makes sense

@playdohface playdohface merged commit 8744489 into zed-extensions:main Oct 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants