spellsitter.nvim icon indicating copy to clipboard operation
spellsitter.nvim copied to clipboard

How to enable support for spell checking inside a heredoc string

Open thornomad opened this issue 2 years ago • 3 comments

Hello and thank you for this plugin! Finally have spelling up and running in all its glory with treesitter enabled. Appreciate it.

I noticed that misspelled words inside of a heredoc block are not being picked up.

image

I'm not sure if this would be a feature of spellsitter.nvim or meant to be implemented/enabled somewhere else but I thought I would start here. If I need to be pointed elsewhere any help is appreciated! Thanks.

thornomad avatar Jun 07 '22 14:06 thornomad

It'll just be a case of improving the current queries in https://github.com/lewis6991/spellsitter.nvim/blob/master/queries/rst/spell.scm.

That file basically just says exactly where to apply spell checking.

lewis6991 avatar Jun 07 '22 15:06 lewis6991

Thanks for the quick reply. I had a look at: https://github.com/lewis6991/spellsitter.nvim/blob/master/queries/ruby/spell.scm

(comment) @spell
(string_content) @spell

I am not sure where comment and string_content are sourced from ... I'm going to have to look into how all this works and figure out if maybe there is a way to identify a heredoc_string or something. All of this is new to me.

Thanks for the pointer.

thornomad avatar Jun 09 '22 12:06 thornomad

You can use https://github.com/nvim-treesitter/playground to see what the parsed AST is for a file. That will show you comment and string_content.

The guide on treesitter queries is also useful: https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries

lewis6991 avatar Jun 09 '22 22:06 lewis6991