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

Don't check spelling in user settings file

Open Bullfrog1234 opened this issue 1 year ago • 5 comments

cSpell is checking the user settings.json file located in the AppData folder of my windows computer. This is filled with spelling errors in names of parameters and extension names that are not real words.

This file in my opinion should be out of scope for a spell checker and opt-in via dedicated property if you really want to spell check it.

I have tried to get it to ignore the complete path to the settings file and ignore just the file name. Both did nothing.

Bullfrog1234 avatar Aug 18 '24 06:08 Bullfrog1234

There are two options:

  1. Use the setting to check only workspace file: image
  2. Upgrade to the preview 4.x version.

The spell checker checks open documents. In the past, this has never been a problem. VSCode changed its behavior a few months ago. They started using the document loading system to read configuration files. So every time VS Code loads a file in the background, it notifies the spell checker.

Jason3S avatar Aug 18 '24 08:08 Jason3S

@Jason3S I enabled "Spell Check Only Workspace Files" and I still get spelling errors in the settings file, FYI.

nidrissi avatar Aug 28 '24 14:08 nidrissi

@nidrissi,

Thank you. I need a bit more information.

  • What version of the extension are you using? v3.x? or v4.x? If v3, please try the v4 preview.
  • Which settings file are you referring to? .vscode/settings.json or global settings?
  • Did you open the settings? Or did the error appear without the file being opened.

Jason3S avatar Aug 28 '24 18:08 Jason3S

@Jason3S I'm using v3, global settings, the file isn't opened. I was mainly commenting to let other people who find this issue know that the first workaround may not necessarily work 🙂. Thanks.

nidrissi avatar Aug 30 '24 13:08 nidrissi

@Jason3S I'm using v3, global settings, the file isn't opened. I was mainly commenting to let other people who find this issue know that the first workaround may not necessarily work 🙂. Thanks.

VS Code changed it behavior a few months back. It now silently opens the settings files in a hidden state in the background. This causes v3 to report on any issues found in the settings file. If this annoys you, please add **/settings.json to cSepll.ignorePaths. See https://github.com/streetsidesoftware/vscode-spell-checker/issues/3581#issuecomment-2322829714 .

Jason3S avatar Aug 31 '24 08:08 Jason3S

@Jason3S I am using v4.0.21 of the Code Spell Checker extension, and I am still experiencing issues with the settings.json file being checked outside of the workspace.

Here is my current configuration:

"cSpell.spellCheckOnlyWorkspaceFiles": true,
"cSpell.files": ["/**"],
"cSpell.ignorePaths": [
  "vscode-extension",
  ".vscode",
  "**/settings.json"
],

I am using a profile in VS Code, which means my settings.json file is located under the path: ~/.config/Code/User/profiles/{profile-id}/settings.json.

Despite this setup, the extension still spell-checks the settings.json file in this profile directory, as shown in the attached screenshot.

Could you please clarify if additional steps are needed to prevent this, or if this is a regression? Thank you for your help!

image

miguelsmuller avatar Dec 02 '24 15:12 miguelsmuller

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 Jan 02 '25 05:01 github-actions[bot]