Closed szczys closed 12 months ago
Tree-sitter grammars don't typically include info for integrating themselves into other tools. That would be the responsibility of the tool itself.
Looking at this, I think nvim-treesitter already has this repo integrated: https://github.com/nvim-treesitter/nvim-treesitter/blob/c0da2013d1cef768c00f3f0b7f365fe19a10bca3/lua/nvim-treesitter/parsers.lua#L358
If nvim just doesn't recognize .overlay as a belonging to the dts filetype, then that sounds like something that needs to be fixed in nvim.
Okay, thanks! I'll take a look and see if I can make a PR for this in nvim.
Thank you for this grammar for highlighting Devicetree file! It makes my Zephyr dev experience much better.
After installing, highlighting works for .dts files. But my nvim doesn't recognize .overlay files as belonging to devicetree. I looked through the code here, but I don't see a place where file extensions are referenced so maybe that's not possible from the grammar itself?
My solution was to add the filetype when my treesitter.lua file is run during initialization:
The non-automatic way is to use
:set filetype=devicetree
when you have your .overlay file open.Is there a way to apply this automatically at the grammar level? If not, I'd be happy to open a PR that details this approach in the README file. Thanks!