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

README : be more explicit about <KIND> and add small example #21

Open
sucrecacao opened this issue Apr 22, 2020 · 3 comments
Open

README : be more explicit about <KIND> and add small example #21

sucrecacao opened this issue Apr 22, 2020 · 3 comments

Comments

@sucrecacao
Copy link

Hi,
I have been advised to use kak-tree for a plugin I'm working on. But I have trouble getting started with it.
What are the value I can use in the variable ?
Could it be possible to have a tiny example of a basic workflow ? For example how to use kak-tree in a plugin script ?

@sucrecacao sucrecacao changed the title README : be more explicit about <KIND> and at small example README : be more explicit about <KIND> and add small example Apr 22, 2020
@ul
Copy link
Owner

ul commented Apr 22, 2020

KIND is a placeholder for a node kind. Unfortunately, each parser defines its own set of kinds (that's why I added support for groups into kak-tree so users can unify those kinds).

Imagine your plugin wants to select up to a function scope and you know that parser for this language defines corresponding node kind as fn or you know that user has a group fn defined in their config which abstracts parsers' kinds. Then your plugin script can evaluate command tree-select-parent-node fn to select such scope.

@sucrecacao
Copy link
Author

Where can one find the list of all the KIND ?

@ul
Copy link
Owner

ul commented Apr 28, 2020

Each parser provides their own. For example, C parser has those: https://github.com/tree-sitter/tree-sitter-c/blob/master/src/node-types.json

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