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

impl auto pairs config #1418

Closed
wants to merge 2 commits into from

Conversation

dead10ck
Copy link
Member

@dead10ck dead10ck commented Jan 2, 2022

This is a draft implementation of configuration for which pairs of tokens get auto completed. It is intended to address #1347 and at least put into place the machinery for #992.

In order to help with this, the logic for when not to auto complete has been generalized to compute an arbitrary predicate for any given pairing. This gets rid of necessarily hard coding which tokens should allow a pairing, although it
still keeps this behavior as a default. The intention is to allow future flexibility with controlling the conditions for when any particular pairing should or should not happen, e.g. only if immediately following a word character, not when inside a certain tree-sitter node, etc. This will help with cases like avoiding pairing ' in Rust's lifetime
annotations, and allowing pairing <> after type names, but not in a "less than" expression.

I am opening a draft first to see if you agree with the general approach here before moving on to docs, and perhaps some of the aforementioned pairing conditions.

Implements configuration for which pairs of tokens get auto completed.

In order to help with this, the logic for when *not* to auto complete has been
generalized to compute an arbitrary predicate for any given pairing. This gets
rid of necessarily hard coding which tokens should allow a pairing, although it
still keeps this behavior as a default. The intention is to allow future
flexibility with controlling unwanted pairings, e.g. Rust's lifetime
annotations, and/or when inside a certain tree-sitter node.
@dead10ck
Copy link
Member Author

dead10ck commented Feb 7, 2022

Superseded by #1624. The predicates have been taken out.

@dead10ck dead10ck closed this Feb 7, 2022
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