nvim-treesitter / nvim-treesitter

Nvim Treesitter configurations and abstraction layer
Apache License 2.0
10.47k stars 879 forks source link

indentation in a multi language doc #6136

Open colin-ryan-airm opened 7 months ago

colin-ryan-airm commented 7 months ago

Hello,

I'm writing GraphQL queries within a string inside a JS/TS file. I can get highlighting to work with an injection query but indentation is acting like a string instead of GraphQL. Is there anything else I need to do to support indentation for for multi language docs?

Thanks!

lucario387 commented 7 months ago

Is there graphql indent queries

colin-ryan-airm commented 6 months ago

@lucario387 The legend in CheckHealth suggest that the graphql package installed has indent support. I haven't done anything custom with it.

lucario387 commented 6 months ago

Found it

https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/ecma/indents.scm#L72

Template_string is always ignored, so I suspect that's why

colin-ryan-airm commented 6 months ago

@lucario387 Thanks. SO if I copy this into a indents.scm file and modify it I can fix it you think?

lucario387 commented 6 months ago

I believe so.