sublime-treesitter / TreeSitter

Sublime Text Tree-sitter configuration and abstraction layer
MIT License
19 stars 1 forks source link

Do load inherited language queries resilient #6

Closed kaste closed 7 months ago

kaste commented 7 months ago

The inherits pragma should not be handled strict.

The rather comprehensive queries library from nvim-treesitter doesn't use the pragma strict and wouldn't load if we don't follow their interpretation.

kaste commented 7 months ago

I think we should expose a function that loads all queries for a language given a queries_path. If you look at nvim-treesitter they split their queries in multiple files per lang but load/concat all of them. (See: https://github.com/nvim-treesitter/nvim-treesitter#adding-queries "All queries found in the runtime directories will be combined.")

kylebebak commented 7 months ago

The inherits pragma should not be handled strict.

I agree with this. I just implemented what you suggested in this commit

I think we should expose a function that loads all queries for a language given a queries_path

@kaste Regarding this, I'm not sure I understand. queries_path is "Path to queries files for all languages". What would be the use of combining query files for different languages?

Do you want to open a separate issue to discuss it? I'm going to close this PR as done