Skip to content

Commit

Permalink
feat: Upgrade to CSpell 8 (#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Nov 9, 2023
1 parent d555f71 commit f984dde
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 218 deletions.
361 changes: 167 additions & 194 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -3351,10 +3351,10 @@
"vitest": "^0.34.6"
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^7.3.8",
"@cspell/cspell-types": "^7.3.8",
"@cspell/cspell-bundled-dicts": "^8.0.0",
"@cspell/cspell-types": "^8.0.0",
"@types/react": "^17.0.69",
"cspell": "^7.3.8",
"cspell": "^8.0.0",
"regexp-worker": "^2.0.2"
},
"comment-resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions packages/__cspell-helper/package.json
Expand Up @@ -22,8 +22,8 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@cspell/cspell-types": "^7.3.8",
"cspell-lib": "^7.3.8"
"@cspell/cspell-types": "^8.0.0",
"cspell-lib": "^8.0.0"
},
"engines": {
"node": ">18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/_integrationTests/package.json
Expand Up @@ -23,7 +23,7 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@cspell/cspell-types": "^7.3.8",
"@cspell/cspell-types": "^8.0.0",
"@types/chai": "^4.3.9",
"@types/decompress": "^4.2.6",
"@types/glob": "^8.1.0",
Expand Down
11 changes: 6 additions & 5 deletions packages/_server/package.json
Expand Up @@ -35,12 +35,13 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^7.3.8",
"@cspell/cspell-types": "^7.3.8",
"@cspell/cspell-bundled-dicts": "^8.0.0",
"@cspell/cspell-pipe": "^8.0.0",
"@cspell/cspell-types": "^8.0.0",
"@internal/common-utils": "file:../__utils",
"cspell-gitignore": "^7.3.8",
"cspell-glob": "^7.3.8",
"cspell-lib": "^7.3.8",
"cspell-gitignore": "^8.0.0",
"cspell-glob": "^8.0.0",
"cspell-lib": "^8.0.0",
"gensequence": "^6.0.0",
"json-rpc-api": "file:../json-rpc-api",
"node-watch": "^0.7.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/_server/src/config/configTargetsHelper.mts
@@ -1,7 +1,6 @@
import type { DictionaryDefinitionCustom } from '@cspell/cspell-types';
import { toUri } from '@internal/common-utils/uriHelper';
import { capitalize } from '@internal/common-utils/util';
import { genSequence } from 'gensequence';
import * as Path from 'path';

import type { WorkspaceConfigForDocument } from '../api.js';
Expand Down Expand Up @@ -90,7 +89,7 @@ function dictionariesToTargets(dicts: DictionaryDefinitionCustom[]): ConfigTarge
if (scopeMask & scopeMaskMap.unknown) yield { ...base, scope: ConfigScopes.Unknown };
}

return genSequence(dicts).concatMap(dictToT).toArray();
return dicts.map(dictToT).flatMap((x) => [...x]);
}

type DictScopeMapKnown = {
Expand Down
15 changes: 8 additions & 7 deletions packages/_server/src/config/documentSettings.mts
@@ -1,3 +1,4 @@
import { opConcatMap, opFilter, pipe } from '@cspell/cspell-pipe/sync';
import type {
CSpellSettingsWithSourceTrace,
DictionaryDefinition,
Expand Down Expand Up @@ -28,8 +29,6 @@ import {
searchForConfig,
} from 'cspell-lib';
import * as fs from 'fs';
import type { Sequence } from 'gensequence';
import { genSequence } from 'gensequence';
import * as os from 'os';
import * as path from 'path';
import type { Connection, WorkspaceFolder } from 'vscode-languageserver/node.js';
Expand Down Expand Up @@ -598,13 +597,15 @@ function calcExcludedBy(uri: string, extSettings: ExtSettings): ExcludedByMatch[
return !cfg.source?.sources?.length;
}

const ex: Sequence<ExcludedByMatch> = genSequence(getSources(extSettings.settings))
const ex: Iterable<ExcludedByMatch> = pipe(
getSources(extSettings.settings),
// keep only leaf sources
.filter(keep)
.filter(uniqueFilter())
.concatMap((settings) => settings.ignorePaths?.map((glob) => ({ glob, settings })) || []);
opFilter(keep),
opFilter(uniqueFilter()),
opConcatMap((settings) => settings.ignorePaths?.map((glob) => ({ glob, settings })) || []),
);

const matches: ExcludedByMatch[] = ex.filter(isExcluded).toArray();
const matches: ExcludedByMatch[] = [...pipe(ex, opFilter(isExcluded))];
return matches;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/_serverPatternMatcher/package.json
Expand Up @@ -47,9 +47,9 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@cspell/cspell-types": "^7.3.8",
"@cspell/cspell-types": "^8.0.0",
"@internal/common-utils": "file:../__utils",
"cspell-lib": "^7.3.8",
"cspell-lib": "^8.0.0",
"regexp-worker": "^2.0.2",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-languageserver": "^9.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Expand Up @@ -46,7 +46,7 @@
"@types/kefir": "^3.8.9",
"@types/source-map-support": "^0.5.9",
"cross-env": "^7.0.3",
"cspell-lib": "^7.3.8",
"cspell-lib": "^8.0.0",
"jest": "^29.7.0",
"jest-when": "^3.6.0",
"lorem-ipsum": "^2.0.8",
Expand All @@ -58,7 +58,7 @@
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@cspell/cspell-types": "^7.3.8",
"@cspell/cspell-types": "^8.0.0",
"@internal/common-utils": "file:../__utils",
"@internal/settings-webview": "file:../_settingsViewer",
"code-spell-checker-server": "file:../_server",
Expand Down

0 comments on commit f984dde

Please sign in to comment.