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

Playground: Rename query to highlighting #1305

Closed
razzeee opened this issue Jul 29, 2021 · 8 comments · Fixed by #1495
Closed

Playground: Rename query to highlighting #1305

razzeee opened this issue Jul 29, 2021 · 8 comments · Fixed by #1495
Labels

Comments

@razzeee
Copy link
Contributor

razzeee commented Jul 29, 2021

I think query is too confusing, just had to check the code to find out what it does. I think something like highlighting might be a bit better.

Is that something, that would be accepted?

@stsewd
Copy link
Contributor

stsewd commented Jul 30, 2021

Do you mean this part of the playground?

Screenshot 2021-07-29 at 20-41-26 Tree-sitter|Playground

@razzeee
Copy link
Contributor Author

razzeee commented Jul 30, 2021

Correct.

@ahlinc
Copy link
Contributor

ahlinc commented Jul 30, 2021

May be it would be better to add some text explaining what to expect from correct provided queries than rename it to the highlighting. An observable highlighting, as I understand, is just a good demonstration of correct queries applied to some text but it's not equal in behavior to the tree-sitter highlight command.

@razzeee
Copy link
Contributor Author

razzeee commented Jul 30, 2021

I think it is? It needs the @name.of.highlight thingy in the query to even work.

Another improvement would be, to set an example highlight query on load.

@ahelwer
Copy link
Contributor

ahelwer commented Jul 30, 2021

Query makes sense to me. The @name.of.highlight (captures) are just a way of graphically showing what your queries pick up.

@stsewd
Copy link
Contributor

stsewd commented Jul 30, 2021

same, I think query makes sense, and we should add more information on usage instead of renaming it. For nvim-treesitter we added this help text

https://github.com/nvim-treesitter/playground/blob/deb887b3f49d66654d9faa9778e8949fe0d80bc3/lua/nvim-treesitter-playground/internal.lua#L289-L292

@calicoday
Copy link

A button or link so you can call up small recorded examples in 2 or 3 langs would be a help. Can't remember now if the playground first comes up with an example but if so, it was lost as soon as I tried my own. One should be exactly the example in the query section of the docs, so it's clear it's THAT 'query', and one that isn't, to show query expressions are specific to each lang grammar.

@maxbrunsfeld
Copy link
Contributor

I'm definitely open to adding some more explanatory text to the playground. I do think that we should keep using the term "query", because that's the name of this feature of Tree-sitter. Highlighting is related, but it's not the only use for queries.

nickolay added a commit to nickolay/tree-sitter that referenced this issue Nov 21, 2021
dundargoc pushed a commit that referenced this issue Feb 15, 2024
The minimal UI of the Playground could benefit from some documentation to make it easier for the newer users to understand what's going on. Also added a link to the new documentation from the local playground.

Closes #1305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants