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

Glob Support for URLs #5833

Open
1 of 3 tasks
Jason3S opened this issue Jun 30, 2024 · 0 comments
Open
1 of 3 tasks

Glob Support for URLs #5833

Jason3S opened this issue Jun 30, 2024 · 0 comments

Comments

@Jason3S
Copy link
Collaborator

Jason3S commented Jun 30, 2024

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 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.

Originally posted by @Jason3S in #5824 (comment)

Tasks

  • cspell-gitignore - replace find-up with version from cspell-io.
  • cspell-gitignore - Add support for URLs, drop the assumption that everything is a file.
  • Refactor cspell-lib - Remove duplicate find up code and use cspell-io.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant