Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: false positive with package.json #2864

Closed
Zamiell opened this issue Oct 12, 2023 · 9 comments
Closed

[Bug]: false positive with package.json #2864

Zamiell opened this issue Oct 12, 2023 · 9 comments

Comments

@Zamiell
Copy link

Zamiell commented Oct 12, 2023

Description

The CSpell VSCode extension shows a blue squiggly line under the word "heroicons" inside of a "package.json" file.

However, when running CSpell from command line, no errors are triggered.

This is a bug because I expect the output of the VSCode extension to exactly match that of the command line tool.

Steps to Reproduce

git clone [email protected]:Zamiell/isaac-streaking.git
cd isaac-streaking
git checkout caf2be00ec8da6f211f746ed65be26cd0d476184
yarn install
npx cspell package.json # Notice that there are no errors.
code .

Then, open "package.json" in VSCode and observe that there is a blue squiggly underline.

@Jason3S
Copy link
Collaborator

Jason3S commented Oct 15, 2023

@Zamiell,

I was not able to reproduce this.

But, it might be related to #2666. I hope #2868 will help with this sort of issue.

@Zamiell
Copy link
Author

Zamiell commented Oct 19, 2023

Here's another reproduction:

git clone [email protected]:Zamiell/isaac-among-us.git
cd isaac-among-us
yarn install
npx cspell --no-progress . # Notice that there are no errors.
code .

Then, do Ctrl + P, open "SabotageType.ts" in VSCode and observe that there is a blue squiggly underline.

@Jason3S
Copy link
Collaborator

Jason3S commented Oct 19, 2023

@Zamiell,

Do you mean comms?

image

That is because comms was recently added to the dictionary and the extension has not yet been updated.

@Zamiell
Copy link
Author

Zamiell commented Oct 19, 2023

Ah. Shouldn't the two be updated at the same time to prevent unfixable errors like this?

@Zamiell
Copy link
Author

Zamiell commented Nov 6, 2023

@Jason3S Can you respond to my previous comment?

Additionally, I found the same bug yet again with a trivial reproduction that does not involve cloning any existing repositories:

mkdir foo
cd foo
npm init --yes
npm install --save cspell clsx
npx cspell package.json # Notice that there are 0 errors.
code . # Notice that if you open "package.json", there is a blue squiggly line in VSCode.

Please let me know if this reproduction works for you.

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 6, 2023

@Zamiell,

I try to keep the code extension up to date with the cspell releases, but it is going though a major update at the moment, hence a delayed release.

Given that, if cspell is installed in the repository, the extension should pick up the latest dictionaries. Then the results would match as long as no new dictionaries were added.

[edit]
The latest dictionaries will be loaded only if they are explicitly imported. See below:

cspell.config.yaml

import:
  - "@cspell/cspell-bundled-dicts"

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 6, 2023

Additionally, I found the same bug yet again with a trivial reproduction that does not involve cloning any existing repositories:

mkdir foo
cd foo
npm init --yes
npm install --save cspell clsx
npx cspell package.json # Notice that there are 0 errors.
code . # Notice that if you open "package.json", there is a blue squiggly line in VSCode.

Please let me know if this reproduction works for you.

It doesn't pick up the latest dictionaries from node_modules. This is by design, it searches for the dictionary from the place it was imported. Since the extension imported it from the extension directory, it has the old copy.

This is a workaround:

cspell.config.yaml

import:
  - "@cspell/cspell-bundled-dicts"

@Zamiell
Copy link
Author

Zamiell commented Nov 6, 2023

Awesome, thanks Jason. Thank you for your work on CSpell; I eagerly await version 4.0!

@Zamiell Zamiell closed this as completed Nov 6, 2023
Copy link
Contributor

github-actions bot commented Dec 7, 2023

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 github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2023
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