Skip to content

Commit

Permalink
Fix: Support Yarn 2 (#921)
Browse files Browse the repository at this point in the history
* dev: Update Docs
* dev: Work with URIs whenever possible.
* dev: Upgrade to cspell 5.6
  • Loading branch information
Jason3S authored Jun 6, 2021
1 parent e0a7573 commit 58ba900
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 223 deletions.
16 changes: 15 additions & 1 deletion design-docs/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ Issues should be tracked with the `v2` milestone.

### Modifying config files

- [ ] Make sure the `cspell.config.js` does not get modified by the extension when changing words or settings.
- [x] Make sure the `cspell.config.js` does not get modified by the extension when changing words or settings.
- [ ] Make sure the correct `cspell*.json` files are updated when writing settings.
- [ ] Support `package.json` as a target location for `cspell` settings.
- [ ] Support `yaml` config files.
- [ ] Support concept of readonly configuration files.
- [ ] Verify Yarn 2 support

### Non-File URIs

- [ ] Support `undefined` file schema.
- [ ] Support non-`file` schemas.

### Preferences

Expand Down Expand Up @@ -40,3 +46,11 @@ Issues should be tracked with the `v2` milestone.

- [ ] [Support virtual workspaces · Issue #846 · streetsidesoftware/vscode-spell-checker](https://github.com/streetsidesoftware/vscode-spell-checker/issues/846)
- [ ] [Support Workspace Trust · Issue #839 · streetsidesoftware/vscode-spell-checker](https://github.com/streetsidesoftware/vscode-spell-checker/issues/839)

Workspace Trust is going to require some modifications to `cspell` in order to prevent it from
loading any untrusted sources.

There is a two step plan:

1. Disable the extension in an untrusted environment.
2. Enable the extension and use `cspell` trust settings to prevent loading of untrusted `.js` files.
4 changes: 4 additions & 0 deletions fixtures/workspaces/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# For now, do not include any yarn workspace fixtures
# The issue is how to cleanly set them up because they might need to be nested
# to avoid conflics between Yarn 1 and Yarn 2.
/yarn*
3 changes: 2 additions & 1 deletion packages/client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { setEnableSpellChecking, sectionCSpell } from './settings';
performance.mark('import 2');
import * as settings from './settings';
performance.mark('import 3');
import { Utils as UriUtils } from 'vscode-uri';
performance.mark('import 4');
import { CSpellClient } from './client';
performance.mark('import 5');
Expand Down Expand Up @@ -206,7 +207,7 @@ export async function activate(context: ExtensionContext): Promise<ExtensionApi>

function detectPossibleCSpellConfigChange(files: ReadonlyArray<vscode.Uri>) {
for (const uri of files) {
if (settings.configFilesToWatch.has(path.basename(uri.fsPath))) {
if (settings.configFilesToWatch.has(UriUtils.basename(uri))) {
triggerGetSettings();
break;
}
Expand Down
Loading

0 comments on commit 58ba900

Please sign in to comment.