vscode-spell-checker icon indicating copy to clipboard operation
vscode-spell-checker copied to clipboard

Feat: Only check spelling at declaration

Open jd-carroll opened this issue 7 years ago • 6 comments

This is a nice service, but the problem I have is that it is too aggressive with the spell checking... Not everything on the page needs to be spell checked.

Specifically, the spell checker should only check variable names where they are declared and not every location where the variable is referenced. Variable references should only be governed by syntax errors (whether or not the variable exists).

Here is an example: spell-example

In this example, Injectable isn't being declared here so it shouldn't be listed as a spelling mistake (since I have no control over that in this file).

jd-carroll avatar Apr 19 '17 13:04 jd-carroll

I hear you. You do not have control over the external module or how its exports are spelled.

This is a challenge. Since the spell checker is not grammar aware, it is difficult to auto exclude imports. In general, I have just been adding imports to the project dictionary.

Jason3S avatar Apr 19 '17 18:04 Jason3S

@Jason3S What do you mean by 'In general, I have just been adding imports to the project dictionary.'

I like this plugin, but it does cause a lot of noise around import

zdrummond avatar Nov 20 '17 00:11 zdrummond

I am working on a way to do this.

Jason3S avatar Feb 22 '18 21:02 Jason3S

This is the number one issue with the extension for me. If resolved, I suspect it would also fix #116 and #150, as people could explicitly ignore spelling issues in their declarations and wouldn't be flooded with warnings about library symbols. JetBrains IDEs check spelling in this syntax-aware way.

Haskell is full of references to definitions like fmap, succ, mempty or snoc. As a result, almost all typos reported by the extension are false positives. The ones reported for locally defined identifiers are redundant, as it suffices to report the typo once at the declaration site.

viluon avatar Jul 27 '21 10:07 viluon

Is there any chance it will be implemented in foreseeable future?

Or maybe some blockers/ideas/additional thoughts on this?

It's unclear whether PR is awaited or would be welcomed and how big of a challenge it would be to implement it.

Can this extension make use of textmate or semantic tokens? If yes, how easy it would be considering current architecture?

Bobronium avatar May 23 '22 20:05 Bobronium

@Bobronium,

There are two different things in this request:

  1. Limiting the number of times an issue is displayed. This is already possible with the setting: cSpell Max Duplicate Problems: image

  2. The second issue, has to do with parsing files to add context for spell checking: RFC Parsing files before spell checking.

    There is a significant amount of work still to be done, but once it is in place, it should improve the over all spell checker experience.

In the meantime, there is a ESLint plugin that might help: @cspell/eslint-plugin - npm.

Jason3S avatar May 24 '22 08:05 Jason3S

Cannot believe any part of this issue is still valid...

jd-carroll avatar Oct 07 '22 01:10 jd-carroll

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 06 '22 05:11 github-actions[bot]