Skip to content

Surrounding pairs v2 #825

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
3 tasks
pokey opened this issue Jul 4, 2022 · 2 comments
Closed
3 tasks

Surrounding pairs v2 #825

pokey opened this issue Jul 4, 2022 · 2 comments
Labels
code quality Improvements to code quality enhancement New feature or request

Comments

@pokey
Copy link
Member

pokey commented Jul 4, 2022

Once we have #484, we can greatly simplify our surrounding pairs code. In the process, we'd like to do the following:

  • Only deal with expanding from a single position, so we can remove the backwards pass to extend past selection start
  • Refactor text-based item scope stage to leverage surrounding pairs code. We can probably use a greatly simplified version of the algorithm suggested in Support generic comma-separated lists #357, because that one tries to handle ranges, not just positions
  • Support "every" for surrounding pairs
@pokey pokey added enhancement New feature or request code quality Improvements to code quality labels Jul 4, 2022
@AndreasArvidsson
Copy link
Member

I had an idea for an alternative implementation of surrounding pairs
We start off with a pure text based implementation that finds all the delimiters. We then use Tree sitter to disqualify or quantify the delimiters. For example tree sitter could determine that an angle bracket is actually a less than operator, that the parenthesis is inside a string or a comment. As well as quantifying if a quote is the opening or closing of a string.

@pokey
Copy link
Member Author

pokey commented Jul 7, 2023

This issue is kind of pointless in my opinion. We'll have to do all this stuff as part of #1061 and #1059

@pokey pokey closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvements to code quality enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants