You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be able to test globs against URLs as well as file paths.
Why
The spell checker extension in VS Code needs to support spell checking remote files. These come in the form like: vscode-vfs://github/un-ts/synckit/yarn.lock for editing a remote GitHub repository. It is necessary for ignorePaths to correctly match against the yarn.lock and indicate that it should not be spell checked. It is also necessary to use the VS Code File System to read/write to these file.
Problem
Most JavaScript libraries (like the popular find-up and globby packages) have a hard dependency upon NodeJS.fs to read/write files. Since, Dependency Injection is not yet very common, this has lead me to writing my own libraries.
Solution / Workaround
I ended up creating the following libraries:
cspell-io - to handle file IO with the intent to support a Browser version of CSpell. This library supports registering custom URL handlers.
cspell-glob - to have a consistent glob matching library that doesn't need a file system and tries to mimic .gitignore globs.
cspell-gitignore - a library to read .gitignore files and provide .gitignore like filtering. (There is a setting that prevents files from being spell checked if they are .gitignored.
The goal:
To be able to test globs against URLs as well as file paths.
Why
The spell checker extension in VS Code needs to support spell checking remote files. These come in the form like:
vscode-vfs://github/un-ts/synckit/yarn.lock
for editing a remote GitHub repository. It is necessary forignorePaths
to correctly match against theyarn.lock
and indicate that it should not be spell checked. It is also necessary to use the VS Code File System to read/write to these file.Problem
Most JavaScript libraries (like the popular find-up and globby packages) have a hard dependency upon NodeJS.fs to read/write files. Since, Dependency Injection is not yet very common, this has lead me to writing my own libraries.
Solution / Workaround
I ended up creating the following libraries:
cspell-io
- to handle file IO with the intent to support a Browser version of CSpell. This library supports registering custom URL handlers.cspell-glob
- to have a consistent glob matching library that doesn't need a file system and tries to mimic .gitignore globs.cspell-gitignore
- a library to read.gitignore
files and provide.gitignore
like filtering. (There is a setting that prevents files from being spell checked if they are.gitignore
d.Originally posted by @Jason3S in #5824 (comment)
Tasks
cspell-gitignore
- replace find-up with version fromcspell-io
.cspell-gitignore
- Add support for URLs, drop the assumption that everything is a file.cspell-lib
- Remove duplicate find up code and usecspell-io
.The text was updated successfully, but these errors were encountered: