spellsitter.nvim
spellsitter.nvim copied to clipboard
Ignore symbols from code.
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.
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.
Forgive my ignorance, but isn't treesitter doing that already?
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.