Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

How to enable support for spell checking inside a heredoc string #71

Open
thornomad opened this issue Jun 7, 2022 · 3 comments
Open

Comments

@thornomad
Copy link

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.

@lewis6991
Copy link
Owner

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.

@thornomad
Copy link
Author

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.

@lewis6991
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants