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

Auto pair angle brackets #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

An-dz
Copy link

@An-dz An-dz commented Aug 8, 2020

This change adds auto-pairing of angle brackets < like it already does with double quotes, parenthesis and square & curly brackets.

The key difference is that it only automatically adds the closing bracket > if you press the opening bracket where it precedes a letter or number. So pressing < after Box will autocomplete to Box<>, but pressing < after a space won't. This way you won't have the closing bracket when trying to write if x < 2.

All other rules of auto-pairing work the same.

I think this is a nice feature when writing generics, traits and pretty much all the stuff we need to put traits or types without messing with the "less than" or "left shift" operands.

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.

1 participant