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

Ignore symbols from code.

Open thetic opened this issue 3 years ago • 3 comments

Given

// misspelledd
void misspelledd();

Current behavior

"misspelledd" is flagged as spelling error.

Desired behavior

"misspelledd" is not flagged because it is a symbol in the code.

thetic avatar Oct 03 '21 18:10 thetic

This might be tricky, since you need to index all the symbols in regions which aren't spell checked on every buffer update, which will probably be costly. We can still explore the idea though.

lewis6991 avatar Oct 12 '21 13:10 lewis6991

Forgive my ignorance, but isn't treesitter doing that already?

thetic avatar Oct 12 '21 17:10 thetic

It has the symbols but there is no API that returns true if a string is a defined symbol. Therefore we would need to implement that by indexing all the symbols treesitter has parsed. If we don't index then we'd need to loop through all the symbols until we get a match for every word we want to spell check.

lewis6991 avatar Oct 12 '21 17:10 lewis6991