cspell-lib 5.12.4 → 5.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,12 +104,9 @@ function lineValidator(dict, options) {
104
104
  }
105
105
  const codeWordResults = Text.extractWordsFromCodeTextOffset(vr)
106
106
  .filter(filterAlreadyChecked)
107
- .filter(rememberFilter((wo) => wo.text.length >= minWordLength))
108
107
  .map((t) => ({ ...t, line: vr.line }))
109
- .map((wo) => {
110
- const vr = wo;
111
- return vr;
112
- })
108
+ .map(checkFlagWords)
109
+ .filter(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged))
113
110
  .map((wo) => (wo.isFlagged ? wo : checkWord(wo, hasWordOptions)))
114
111
  .filter(rememberFilter((wo) => wo.isFlagged || !wo.isFound))
115
112
  .filter(rememberFilter((wo) => !RxPat.regExRepeatedChar.test(wo.text))) // Filter out any repeated characters like xxxxxxxxxx
@@ -128,9 +125,9 @@ function lineValidator(dict, options) {
128
125
  function checkPossibleWords(possibleWord) {
129
126
  const mismatches = Text.extractWordsFromTextOffset(possibleWord)
130
127
  .filter(filterAlreadyChecked)
131
- .filter(rememberFilter((wo) => wo.text.length >= minWordLength))
132
128
  .map((wo) => ({ ...wo, line: lineSegment }))
133
129
  .map(checkFlagWords)
130
+ .filter(rememberFilter((wo) => wo.text.length >= minWordLength || !!wo.isFlagged))
134
131
  .concatMap(checkFullWord)
135
132
  .toArray();
136
133
  if (mismatches.length) {
package/dist/trace.d.ts CHANGED
@@ -16,6 +16,7 @@ export interface TraceOptions {
16
16
  languageId?: LanguageId | LanguageId[];
17
17
  locale?: LocaleId;
18
18
  ignoreCase?: boolean;
19
+ allowCompoundWords?: boolean;
19
20
  }
20
21
  export declare function traceWords(words: string[], settings: CSpellSettings, options: TraceOptions | undefined): Promise<TraceResult[]>;
21
22
  //# sourceMappingURL=trace.d.ts.map
package/dist/trace.js CHANGED
@@ -26,10 +26,13 @@ const LanguageSettings_1 = require("./Settings/LanguageSettings");
26
26
  const SpellingDictionary_1 = require("./SpellingDictionary");
27
27
  const util = __importStar(require("./util/util"));
28
28
  async function traceWords(words, settings, options) {
29
- const { languageId, locale: language, ignoreCase = true } = options || {};
29
+ const { languageId, locale: language, ignoreCase = true, allowCompoundWords } = options || {};
30
30
  async function finalize(config) {
31
31
  var _a;
32
- const withLocale = (0, Settings_1.mergeSettings)(config, { language });
32
+ const withLocale = (0, Settings_1.mergeSettings)(config, {
33
+ language,
34
+ allowCompoundWords: allowCompoundWords !== null && allowCompoundWords !== void 0 ? allowCompoundWords : config.allowCompoundWords,
35
+ });
33
36
  const withLanguageId = (0, LanguageSettings_1.calcSettingsForLanguageId)(withLocale, (_a = languageId !== null && languageId !== void 0 ? languageId : withLocale.languageId) !== null && _a !== void 0 ? _a : 'plaintext');
34
37
  const settings = (0, Settings_1.finalizeSettings)(withLanguageId);
35
38
  const dictionaries = (settings.dictionaries || [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell-lib",
3
- "version": "5.12.4",
3
+ "version": "5.12.5",
4
4
  "description": "A library of useful functions used across various cspell tools.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "homepage": "https://github.com/streetsidesoftware/cspell#readme",
49
49
  "dependencies": {
50
- "@cspell/cspell-bundled-dicts": "^5.12.4",
50
+ "@cspell/cspell-bundled-dicts": "^5.12.5",
51
51
  "@cspell/cspell-types": "^5.12.4",
52
52
  "clear-module": "^4.1.1",
53
53
  "comment-json": "^4.1.1",
@@ -55,7 +55,7 @@
55
55
  "cosmiconfig": "^7.0.1",
56
56
  "cspell-glob": "^5.12.4",
57
57
  "cspell-io": "^5.12.4",
58
- "cspell-trie-lib": "^5.12.4",
58
+ "cspell-trie-lib": "^5.12.5",
59
59
  "find-up": "^5.0.0",
60
60
  "fs-extra": "^10.0.0",
61
61
  "gensequence": "^3.1.1",
@@ -86,5 +86,5 @@
86
86
  "rimraf": "^3.0.2",
87
87
  "ts-jest": "^27.0.7"
88
88
  },
89
- "gitHead": "3e9973c39725f65141683b373ed839562f28bd94"
89
+ "gitHead": "84a21d1f7cbd17cc9633aafdff6dce19d6de35b5"
90
90
  }