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

refactor(treesitter): rename query previewer to query editor #25161

Merged
merged 3 commits into from Sep 15, 2023

Conversation

MariaSolOs
Copy link
Member

As agreed in #24703 (comment).

@github-actions github-actions bot added treesitter refactor changes that are not features or bugfixes labels Sep 14, 2023
@clason
Copy link
Member

clason commented Sep 14, 2023

Maybe add a note to the doc string about the current limitations (only a "scratch query" for now)?

@clason
Copy link
Member

clason commented Sep 15, 2023

Also, I just noticed a limitation of the current query editor: it does not play nicely with injected languages -- for example, you cannot test markdown_inline queries on a Markdown buffer.

Is it possible to add an optional argument to override the language for which the query editor is opened?

@MariaSolOs
Copy link
Member Author

@clason as of today the query editor will use the parser from the filetype of the “base buffer” (the one from where the inspector was opened if the editor was toggled, or the source buffer if just using the :EditQuery command). We can configure the command to accept a filetype argument though, but that would be a different PR ;)

@clason
Copy link
Member

clason commented Sep 15, 2023

We can configure the command to accept a filetype argument though,

I'd say just specify the parser; no need for filetype lookups. And no need to add that to the command; an advanced feature like that is fine to reserve for the Lua function.

but that would be a different PR ;)

Sure :)

Copy link
Member

@justinmk justinmk left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this!

@justinmk justinmk merged commit 28233bc into neovim:master Sep 15, 2023
13 of 14 checks passed
@MariaSolOs MariaSolOs deleted the edit-query branch September 15, 2023 17:04
dundargoc pushed a commit to dundargoc/neovim that referenced this pull request Sep 27, 2023
"Edit" more closely describes the generic application than "Preview", though
the buffer contents don't (yet) map to an actual file on disk.

neovim#24703 (comment)
@kaddkaka kaddkaka mentioned this pull request Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor changes that are not features or bugfixes treesitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants