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

[Question] How to ignore a specific parser? #69

Closed
alexmozaidze opened this issue Dec 22, 2023 · 1 comment
Closed

[Question] How to ignore a specific parser? #69

alexmozaidze opened this issue Dec 22, 2023 · 1 comment

Comments

@alexmozaidze
Copy link

Question

How do I specify to ultimate-autopair which parsers it should ignore?

I want to make ultimate-autopair ignore tree-sitter-comment since it's an "embedded parser" of some sort, which messes with my custom queries when making tree-sitter-comment work in HTML. (See tree-sitter/tree-sitter-html #73)

Problem

If in HTML I do the following (where | is the cursor):

<!--|

It works as expected:

<!--|-->

But pressing <space> doesn't work as expected, since it's now inside the comment parser:

<!-- |-->

This is an issue to be fixed in the HTML parser, but it would be nice to have a temporary solution to ignore the comment parser, avoiding the problem entirely.

@altermo
Copy link
Owner

altermo commented Dec 22, 2023

Currently not possible, as the way the current implementation works is by using get_node, and there are no easy ways to make get_node ignore some injected parser.
In the next release, I plan to change it so that instead of using get_node, it will use treesitter-queries to get nodes and injected-langs, which will make this feature possible.

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

No branches or pull requests

2 participants