Open amaanq opened 1 year ago
Ah...this grammar has conditional compilation - I forgot :see_no_evil:
Though I can't reproduce it locally using the npm scripts
Yes, thanks for the effort though. Btw if you have any suggestion on how to do the conditional compilation better I'm all ears. But as it is tree-sitter doesn't seem to have good support for this.
Yes, thanks for the effort though. Btw if you have any suggestion on how to do the conditional compilation better I'm all ears. But as it is tree-sitter doesn't seem to have good support for this.
Your way is fine - though it is not the "prettiest", I wonder if we could add a features-flag to grammars like how Rust crates do it tree-sitter generate --features x
and it'll check if x exists in the package.json['tree-sitter'][lang_idx][features] array
FYI There's some discussion about this on multiple fronts like https://github.com/tree-sitter/tree-sitter-cpp/issues/40 and https://github.com/nvim-treesitter/nvim-treesitter/issues/3076 which came to similar results.
(Keeping this open since probably the conflicts should also be part of the conditonal compilation)