@cspell/cspell-types 10.3.0 → 10.3.1-alpha.1

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.
@@ -1377,6 +1377,18 @@
1377
1377
  "markdownDescription": "Defines a list of patterns that can be used with the {@link ignoreRegExpList } and\n {@link includeRegExpList } options.\n\nFor example:\n\n```javascript\n\"ignoreRegExpList\": [\"comments\"],\n\"patterns\": [\n {\n \"name\": \"comment-single-line\",\n \"pattern\": \"/#.*/g\"\n },\n {\n \"name\": \"comment-multi-line\",\n \"pattern\": \"/(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)/g\"\n },\n // You can also combine multiple named patterns into one single named pattern\n {\n \"name\": \"comments\",\n \"pattern\": [\"comment-single-line\", \"comment-multi-line\"]\n }\n]\n```",
1378
1378
  "type": "array"
1379
1379
  },
1380
+ "softWordBreakDefinitions": {
1381
+ "$ref": "#/definitions/SoftWordBreakDefinitions",
1382
+ "description": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code` `error|code`, the following words would be checked against the dictionaries: `errorcode`, `error`, and `code`.",
1383
+ "markdownDescription": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`\n`error|code`, the following words would be checked against\nthe dictionaries: `errorcode`, `error`, and `code`.",
1384
+ "since": "10.3.1"
1385
+ },
1386
+ "softWordBreaks": {
1387
+ "$ref": "#/definitions/SoftWordBreaks",
1388
+ "description": "Allows enabling or disabling soft word break rules by name.",
1389
+ "markdownDescription": "Allows enabling or disabling soft word break rules by name.",
1390
+ "since": "10.3.1"
1391
+ },
1380
1392
  "substitutionDefinitions": {
1381
1393
  "$ref": "#/definitions/SubstitutionDefinitions",
1382
1394
  "description": "The set of available substitutions. This is a collection of substitution definitions that can be applied to a document before spell checking.",
@@ -1663,6 +1675,18 @@
1663
1675
  "markdownDescription": "The PnP files to search for. Note: `.mjs` files are not currently supported.",
1664
1676
  "type": "array"
1665
1677
  },
1678
+ "softWordBreakDefinitions": {
1679
+ "$ref": "#/definitions/SoftWordBreakDefinitions",
1680
+ "description": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code` `error|code`, the following words would be checked against the dictionaries: `errorcode`, `error`, and `code`.",
1681
+ "markdownDescription": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`\n`error|code`, the following words would be checked against\nthe dictionaries: `errorcode`, `error`, and `code`.",
1682
+ "since": "10.3.1"
1683
+ },
1684
+ "softWordBreaks": {
1685
+ "$ref": "#/definitions/SoftWordBreaks",
1686
+ "description": "Allows enabling or disabling soft word break rules by name.",
1687
+ "markdownDescription": "Allows enabling or disabling soft word break rules by name.",
1688
+ "since": "10.3.1"
1689
+ },
1666
1690
  "substitutionDefinitions": {
1667
1691
  "$ref": "#/definitions/SubstitutionDefinitions",
1668
1692
  "description": "The set of available substitutions. This is a collection of substitution definitions that can be applied to a document before spell checking.",
@@ -1939,6 +1963,60 @@
1939
1963
  "markdownDescription": "Simple Glob string, the root will be globRoot.",
1940
1964
  "type": "string"
1941
1965
  },
1966
+ "SoftWordBreak": {
1967
+ "anyOf": [
1968
+ {
1969
+ "$ref": "#/definitions/SoftWordBreakRegExpString"
1970
+ },
1971
+ {
1972
+ "$ref": "#/definitions/SoftWordBreakPattern"
1973
+ }
1974
+ ]
1975
+ },
1976
+ "SoftWordBreakDefinitions": {
1977
+ "additionalProperties": {
1978
+ "$ref": "#/definitions/SoftWordBreakRule",
1979
+ "description": "A named set of soft word break rules.",
1980
+ "markdownDescription": "A named set of soft word break rules."
1981
+ },
1982
+ "description": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code` `error|code`, the following words would be checked against the dictionaries: `errorcode`, `error`, and `code`.",
1983
+ "markdownDescription": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`\n`error|code`, the following words would be checked against\nthe dictionaries: `errorcode`, `error`, and `code`.",
1984
+ "since": "10.3.1",
1985
+ "type": "object"
1986
+ },
1987
+ "SoftWordBreakPattern": {
1988
+ "description": "Defines a word break rule based on a string.\n\nFormat:\n- `\"before|after\"` -- Matches a word break between `before` and `after`\n- `\"before|after$\"` -- Matches a word break between `before` and `after` at the end of a word\n- `\"^before|after\"` -- Matches a word break between `before` at the start of a word and `after`\n- `\"^before|after$\"` -- Matches a word break between `before` at the start of a word and `after` at the end of a word\n- `\"before|\"` -- Matches a word break after `before`\n- `\"^before|\"` -- Matches a word break after `before` at the start of a word\n- `\"|after\"` -- Matches a word break before `after`\n- `\"|after$\"` -- Matches a word break before `after` at the end of a word\n\n\nWhere `before` is the text before the word break and `after` is the text after the word break.\n\nSpecial characters like `|`, `^`, and `$` have specific meanings.\n- `|` -- Represents the position of the word break\n- `^` -- Indicates the start of a word\n- `$` -- Indicates the end of a word\n\nFor more complicated word break rules, consider using regular expressions with the {@link SoftWordBreakRegExp } type.\n\nExamples:\n- `\"^ptr|\"` -- Would help with pointer definitions starting with `ptr`, such as `ptrvalue`.\n- `\"^I|\"` -- Would help with interface definitions starting with `I`, such as `IERROR`.",
1989
+ "markdownDescription": "Defines a word break rule based on a string.\n\nFormat:\n- `\"before|after\"` -- Matches a word break between `before` and `after`\n- `\"before|after$\"` -- Matches a word break between `before` and `after` at the end of a word\n- `\"^before|after\"` -- Matches a word break between `before` at the start of a word and `after`\n- `\"^before|after$\"` -- Matches a word break between `before` at the start of a word and `after` at the end of a word\n- `\"before|\"` -- Matches a word break after `before`\n- `\"^before|\"` -- Matches a word break after `before` at the start of a word\n- `\"|after\"` -- Matches a word break before `after`\n- `\"|after$\"` -- Matches a word break before `after` at the end of a word\n\n\nWhere `before` is the text before the word break and `after` is the text after the word break.\n\nSpecial characters like `|`, `^`, and `$` have specific meanings.\n- `|` -- Represents the position of the word break\n- `^` -- Indicates the start of a word\n- `$` -- Indicates the end of a word\n\nFor more complicated word break rules, consider using regular expressions with the {@link SoftWordBreakRegExp } type.\n\nExamples:\n- `\"^ptr|\"` -- Would help with pointer definitions starting with `ptr`, such as `ptrvalue`.\n- `\"^I|\"` -- Would help with interface definitions starting with `I`, such as `IERROR`.",
1990
+ "since": "10.3.1",
1991
+ "type": "string"
1992
+ },
1993
+ "SoftWordBreakRegExpString": {
1994
+ "description": "Represents a regular expression used for word break rules.\n\nThe matching string will be prefixed and suffixed with a soft-hyphen. If the matching string is zero length, only a single soft-hyphen will be inserted. It is best to use lookahead and lookbehind assertions to ensure correct word break positions.\n\nExamples:\n- `\"/(?<=\\\\bptr)/\"` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.\n- `\"/(?<=\\\\bI)(?=[A-Z])/\"` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.",
1995
+ "markdownDescription": "Represents a regular expression used for word break rules.\n\nThe matching string will be prefixed and suffixed with a soft-hyphen.\nIf the matching string is zero length, only a single soft-hyphen will be inserted.\nIt is best to use lookahead and lookbehind assertions to ensure correct word break positions.\n\nExamples:\n- `\"/(?<=\\\\bptr)/\"` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.\n- `\"/(?<=\\\\bI)(?=[A-Z])/\"` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.",
1996
+ "since": "10.3.1",
1997
+ "type": "string"
1998
+ },
1999
+ "SoftWordBreakRule": {
2000
+ "anyOf": [
2001
+ {
2002
+ "$ref": "#/definitions/SoftWordBreak"
2003
+ },
2004
+ {
2005
+ "items": {
2006
+ "$ref": "#/definitions/SoftWordBreak"
2007
+ },
2008
+ "type": "array"
2009
+ }
2010
+ ]
2011
+ },
2012
+ "SoftWordBreaks": {
2013
+ "additionalProperties": {
2014
+ "type": "boolean"
2015
+ },
2016
+ "description": "Allows enabling or disabling soft word break rules by name.",
2017
+ "markdownDescription": "Allows enabling or disabling soft word break rules by name.",
2018
+ "type": "object"
2019
+ },
1942
2020
  "SubstitutionDefinition": {
1943
2021
  "additionalProperties": false,
1944
2022
  "description": "Allows for the definition of a substitution set. A substitution set is a collection of substitution entries that can be applied to a document before spell checking. This is useful for converting html entities, url encodings, or other transformations that may be necessary to get the correct text for spell checking.\n\nSubstitutions are applied based upon the longest matching find string. If there are multiple matches of the same `find`, the last one in the list is used. This allows for the overriding of substitutions. For example, if you have a substitution for `&` to `and`, and then a substitution for `&amp;` to `&`, the `&amp;` substitution will be used for the string `&amp;`, and the `&` substitution will be used for the string `&`.",
@@ -2402,6 +2480,18 @@
2402
2480
  "markdownDescription": "Show status.",
2403
2481
  "type": "boolean"
2404
2482
  },
2483
+ "softWordBreakDefinitions": {
2484
+ "$ref": "#/definitions/SoftWordBreakDefinitions",
2485
+ "description": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code` `error|code`, the following words would be checked against the dictionaries: `errorcode`, `error`, and `code`.",
2486
+ "markdownDescription": "Defines a set of word break rules that can be used for text segmentation.\n\nSoft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.\n\nThis allows for word breaks that might not be captured by the camel case detection.\n\nNote: soft-hyphens are removed before checking the word against the dictionaries.\n\nFor example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`\n`error|code`, the following words would be checked against\nthe dictionaries: `errorcode`, `error`, and `code`.",
2487
+ "since": "10.3.1"
2488
+ },
2489
+ "softWordBreaks": {
2490
+ "$ref": "#/definitions/SoftWordBreaks",
2491
+ "description": "Allows enabling or disabling soft word break rules by name.",
2492
+ "markdownDescription": "Allows enabling or disabling soft word break rules by name.",
2493
+ "since": "10.3.1"
2494
+ },
2405
2495
  "spellCheckDelayMs": {
2406
2496
  "deprecated": true,
2407
2497
  "description": "Delay in ms after a document has changed before checking it for spelling errors.",
package/dist/index.d.mts CHANGED
@@ -1226,6 +1226,128 @@ type Substitutions = (SubstitutionEntry | SubstitutionID)[];
1226
1226
  //#region src/types.d.ts
1227
1227
  type Serializable = number | string | boolean | null | object;
1228
1228
  //#endregion
1229
+ //#region src/WordSegmentation.d.ts
1230
+ interface WordSegmentationSettings {
1231
+ /**
1232
+ * Enables enables locale-sensitive text segmentation to support languages like Japanese, Chinese, Thai, Lao, Khmer, Myanmar, etc.
1233
+ * The locale used for the segmentation is based on the {@link language} setting.
1234
+ *
1235
+ * @since 10.2.0
1236
+ */
1237
+ useIntlWordSegmentation?: boolean;
1238
+ /**
1239
+ * Defines a set of word break rules that can be used for text segmentation.
1240
+ *
1241
+ * Soft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.
1242
+ *
1243
+ * This allows for word breaks that might not be captured by the camel case detection.
1244
+ *
1245
+ * Note: soft-hyphens are removed before checking the word against the dictionaries.
1246
+ *
1247
+ * For example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`
1248
+ * `error|code`, the following words would be checked against
1249
+ * the dictionaries: `errorcode`, `error`, and `code`.
1250
+ *
1251
+ * @since 10.3.1
1252
+ */
1253
+ softWordBreakDefinitions?: SoftWordBreakDefinitions;
1254
+ /**
1255
+ * Allows enabling or disabling soft word break rules by name.
1256
+ *
1257
+ * @since 10.3.1
1258
+ */
1259
+ softWordBreaks?: SoftWordBreaks;
1260
+ }
1261
+ /**
1262
+ * Represents a regular expression used for word break rules.
1263
+ *
1264
+ * The matching string will be prefixed and suffixed with a soft-hyphen.
1265
+ * If the matching string is zero length, only a single soft-hyphen will be inserted.
1266
+ * It is best to use lookahead and lookbehind assertions to ensure correct word break positions.
1267
+ *
1268
+ * Examples:
1269
+ * - `/(?<=\bptr)/` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.
1270
+ * - `/(?<=\bI)(?=[A-Z])/` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.
1271
+ *
1272
+ * @since 10.3.1
1273
+ * @note Hidden to prevent it from being exposed in the json-schema.
1274
+ * @hidden
1275
+ */
1276
+ type SoftWordBreakRegExp = RegExp;
1277
+ /**
1278
+ * Represents a regular expression used for word break rules.
1279
+ *
1280
+ * The matching string will be prefixed and suffixed with a soft-hyphen.
1281
+ * If the matching string is zero length, only a single soft-hyphen will be inserted.
1282
+ * It is best to use lookahead and lookbehind assertions to ensure correct word break positions.
1283
+ *
1284
+ * Examples:
1285
+ * - `"/(?<=\\bptr)/"` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.
1286
+ * - `"/(?<=\\bI)(?=[A-Z])/"` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.
1287
+ *
1288
+ * @since 10.3.1
1289
+ */
1290
+ type SoftWordBreakRegExpString = string;
1291
+ /**
1292
+ * Defines a word break rule based on a string.
1293
+ *
1294
+ * Format:
1295
+ * - `"before|after"` -- Matches a word break between `before` and `after`
1296
+ * - `"before|after$"` -- Matches a word break between `before` and `after` at the end of a word
1297
+ * - `"^before|after"` -- Matches a word break between `before` at the start of a word and `after`
1298
+ * - `"^before|after$"` -- Matches a word break between `before` at the start of a word and `after` at the end of a word
1299
+ * - `"before|"` -- Matches a word break after `before`
1300
+ * - `"^before|"` -- Matches a word break after `before` at the start of a word
1301
+ * - `"|after"` -- Matches a word break before `after`
1302
+ * - `"|after$"` -- Matches a word break before `after` at the end of a word
1303
+ *
1304
+ *
1305
+ * Where `before` is the text before the word break and `after` is the text after the word break.
1306
+ *
1307
+ * Special characters like `|`, `^`, and `$` have specific meanings.
1308
+ * - `|` -- Represents the position of the word break
1309
+ * - `^` -- Indicates the start of a word
1310
+ * - `$` -- Indicates the end of a word
1311
+ *
1312
+ * For more complicated word break rules, consider using regular expressions with the {@link SoftWordBreakRegExp} type.
1313
+ *
1314
+ * Examples:
1315
+ * - `"^ptr|"` -- Would help with pointer definitions starting with `ptr`, such as `ptrvalue`.
1316
+ * - `"^I|"` -- Would help with interface definitions starting with `I`, such as `IERROR`.
1317
+ *
1318
+ * @since 10.3.1
1319
+ */
1320
+ type SoftWordBreakPattern = string;
1321
+ type SoftWordBreakRule = SoftWordBreak | SoftWordBreak[];
1322
+ type SoftWordBreak = SoftWordBreakRegExpString | SoftWordBreakPattern | SoftWordBreakRegExp;
1323
+ /**
1324
+ * Defines a set of word break rules that can be used for text segmentation.
1325
+ *
1326
+ * Soft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.
1327
+ *
1328
+ * This allows for word breaks that might not be captured by the camel case detection.
1329
+ *
1330
+ * Note: soft-hyphens are removed before checking the word against the dictionaries.
1331
+ *
1332
+ * For example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`
1333
+ * `error|code`, the following words would be checked against
1334
+ * the dictionaries: `errorcode`, `error`, and `code`.
1335
+ *
1336
+ * @since 10.3.1
1337
+ */
1338
+ interface SoftWordBreakDefinitions {
1339
+ /**
1340
+ * A named set of soft word break rules.
1341
+ */
1342
+ [name: string]: SoftWordBreakRule;
1343
+ }
1344
+ /**
1345
+ * Allows enabling or disabling soft word break rules by name.
1346
+ */
1347
+ interface SoftWordBreaks {
1348
+ [name: string]: boolean;
1349
+ }
1350
+ //#endregion
1229
1351
  //#region src/CSpellSettingsDef.d.ts
1230
1352
  /**
1231
1353
  * These settings come from user and workspace settings.
@@ -1637,7 +1759,7 @@ interface OverrideFilterFields {
1637
1759
  /** Glob pattern or patterns to match against. */
1638
1760
  filename: Glob | Glob[];
1639
1761
  }
1640
- interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration {
1762
+ interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration, WordSegmentationSettings {
1641
1763
  /** Optional identifier. */
1642
1764
  id?: string;
1643
1765
  /** Optional name of configuration. */
@@ -1774,13 +1896,6 @@ interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, Unknow
1774
1896
  * @since 9.7.0
1775
1897
  */
1776
1898
  substitutions?: Substitutions;
1777
- /**
1778
- * Enables enables locale-sensitive text segmentation to support languages like Japanese, Chinese, Thai, Lao, Khmer, Myanmar, etc.
1779
- * The locale used for the segmentation is based on the {@link language} setting.
1780
- *
1781
- * @since 10.2.0
1782
- */
1783
- useIntlWordSegmentation?: boolean;
1784
1899
  }
1785
1900
  interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
1786
1901
  interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {}
package/dist/index.d.ts CHANGED
@@ -1226,6 +1226,128 @@ type Substitutions = (SubstitutionEntry | SubstitutionID)[];
1226
1226
  //#region src/types.d.ts
1227
1227
  type Serializable = number | string | boolean | null | object;
1228
1228
  //#endregion
1229
+ //#region src/WordSegmentation.d.ts
1230
+ interface WordSegmentationSettings {
1231
+ /**
1232
+ * Enables enables locale-sensitive text segmentation to support languages like Japanese, Chinese, Thai, Lao, Khmer, Myanmar, etc.
1233
+ * The locale used for the segmentation is based on the {@link language} setting.
1234
+ *
1235
+ * @since 10.2.0
1236
+ */
1237
+ useIntlWordSegmentation?: boolean;
1238
+ /**
1239
+ * Defines a set of word break rules that can be used for text segmentation.
1240
+ *
1241
+ * Soft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.
1242
+ *
1243
+ * This allows for word breaks that might not be captured by the camel case detection.
1244
+ *
1245
+ * Note: soft-hyphens are removed before checking the word against the dictionaries.
1246
+ *
1247
+ * For example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`
1248
+ * `error|code`, the following words would be checked against
1249
+ * the dictionaries: `errorcode`, `error`, and `code`.
1250
+ *
1251
+ * @since 10.3.1
1252
+ */
1253
+ softWordBreakDefinitions?: SoftWordBreakDefinitions;
1254
+ /**
1255
+ * Allows enabling or disabling soft word break rules by name.
1256
+ *
1257
+ * @since 10.3.1
1258
+ */
1259
+ softWordBreaks?: SoftWordBreaks;
1260
+ }
1261
+ /**
1262
+ * Represents a regular expression used for word break rules.
1263
+ *
1264
+ * The matching string will be prefixed and suffixed with a soft-hyphen.
1265
+ * If the matching string is zero length, only a single soft-hyphen will be inserted.
1266
+ * It is best to use lookahead and lookbehind assertions to ensure correct word break positions.
1267
+ *
1268
+ * Examples:
1269
+ * - `/(?<=\bptr)/` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.
1270
+ * - `/(?<=\bI)(?=[A-Z])/` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.
1271
+ *
1272
+ * @since 10.3.1
1273
+ * @note Hidden to prevent it from being exposed in the json-schema.
1274
+ * @hidden
1275
+ */
1276
+ type SoftWordBreakRegExp = RegExp;
1277
+ /**
1278
+ * Represents a regular expression used for word break rules.
1279
+ *
1280
+ * The matching string will be prefixed and suffixed with a soft-hyphen.
1281
+ * If the matching string is zero length, only a single soft-hyphen will be inserted.
1282
+ * It is best to use lookahead and lookbehind assertions to ensure correct word break positions.
1283
+ *
1284
+ * Examples:
1285
+ * - `"/(?<=\\bptr)/"` -- The break would occur after the `ptr`, helping with pointer definitions starting with `ptr`, such as `ptrvalue`.
1286
+ * - `"/(?<=\\bI)(?=[A-Z])/"` -- The break would occur before an uppercase letter following an `I` at a word boundary, helping with interface definitions like `IError`.
1287
+ *
1288
+ * @since 10.3.1
1289
+ */
1290
+ type SoftWordBreakRegExpString = string;
1291
+ /**
1292
+ * Defines a word break rule based on a string.
1293
+ *
1294
+ * Format:
1295
+ * - `"before|after"` -- Matches a word break between `before` and `after`
1296
+ * - `"before|after$"` -- Matches a word break between `before` and `after` at the end of a word
1297
+ * - `"^before|after"` -- Matches a word break between `before` at the start of a word and `after`
1298
+ * - `"^before|after$"` -- Matches a word break between `before` at the start of a word and `after` at the end of a word
1299
+ * - `"before|"` -- Matches a word break after `before`
1300
+ * - `"^before|"` -- Matches a word break after `before` at the start of a word
1301
+ * - `"|after"` -- Matches a word break before `after`
1302
+ * - `"|after$"` -- Matches a word break before `after` at the end of a word
1303
+ *
1304
+ *
1305
+ * Where `before` is the text before the word break and `after` is the text after the word break.
1306
+ *
1307
+ * Special characters like `|`, `^`, and `$` have specific meanings.
1308
+ * - `|` -- Represents the position of the word break
1309
+ * - `^` -- Indicates the start of a word
1310
+ * - `$` -- Indicates the end of a word
1311
+ *
1312
+ * For more complicated word break rules, consider using regular expressions with the {@link SoftWordBreakRegExp} type.
1313
+ *
1314
+ * Examples:
1315
+ * - `"^ptr|"` -- Would help with pointer definitions starting with `ptr`, such as `ptrvalue`.
1316
+ * - `"^I|"` -- Would help with interface definitions starting with `I`, such as `IERROR`.
1317
+ *
1318
+ * @since 10.3.1
1319
+ */
1320
+ type SoftWordBreakPattern = string;
1321
+ type SoftWordBreakRule = SoftWordBreak | SoftWordBreak[];
1322
+ type SoftWordBreak = SoftWordBreakRegExpString | SoftWordBreakPattern | SoftWordBreakRegExp;
1323
+ /**
1324
+ * Defines a set of word break rules that can be used for text segmentation.
1325
+ *
1326
+ * Soft word breaks are done through injecting soft-hyphens at the appropriate positions in the text before spell checking.
1327
+ *
1328
+ * This allows for word breaks that might not be captured by the camel case detection.
1329
+ *
1330
+ * Note: soft-hyphens are removed before checking the word against the dictionaries.
1331
+ *
1332
+ * For example, if there is a soft-hyphen (represented by a `|`) injected between `error` and `code`
1333
+ * `error|code`, the following words would be checked against
1334
+ * the dictionaries: `errorcode`, `error`, and `code`.
1335
+ *
1336
+ * @since 10.3.1
1337
+ */
1338
+ interface SoftWordBreakDefinitions {
1339
+ /**
1340
+ * A named set of soft word break rules.
1341
+ */
1342
+ [name: string]: SoftWordBreakRule;
1343
+ }
1344
+ /**
1345
+ * Allows enabling or disabling soft word break rules by name.
1346
+ */
1347
+ interface SoftWordBreaks {
1348
+ [name: string]: boolean;
1349
+ }
1350
+ //#endregion
1229
1351
  //#region src/CSpellSettingsDef.d.ts
1230
1352
  /**
1231
1353
  * These settings come from user and workspace settings.
@@ -1637,7 +1759,7 @@ interface OverrideFilterFields {
1637
1759
  /** Glob pattern or patterns to match against. */
1638
1760
  filename: Glob | Glob[];
1639
1761
  }
1640
- interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration {
1762
+ interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration, WordSegmentationSettings {
1641
1763
  /** Optional identifier. */
1642
1764
  id?: string;
1643
1765
  /** Optional name of configuration. */
@@ -1774,13 +1896,6 @@ interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, Unknow
1774
1896
  * @since 9.7.0
1775
1897
  */
1776
1898
  substitutions?: Substitutions;
1777
- /**
1778
- * Enables enables locale-sensitive text segmentation to support languages like Japanese, Chinese, Thai, Lao, Khmer, Myanmar, etc.
1779
- * The locale used for the segmentation is based on the {@link language} setting.
1780
- *
1781
- * @since 10.2.0
1782
- */
1783
- useIntlWordSegmentation?: boolean;
1784
1899
  }
1785
1900
  interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
1786
1901
  interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {}
package/dist/index.js CHANGED
@@ -44,6 +44,8 @@ const ConfigFields = {
44
44
  readonly: "readonly",
45
45
  reporters: "reporters",
46
46
  showStatus: "showStatus",
47
+ softWordBreaks: "softWordBreaks",
48
+ softWordBreakDefinitions: "softWordBreakDefinitions",
47
49
  spellCheckDelayMs: "spellCheckDelayMs",
48
50
  substitutionDefinitions: "substitutionDefinitions",
49
51
  substitutions: "substitutions",
@@ -91,8 +93,11 @@ function defineConfig(config) {
91
93
  }
92
94
  //#endregion
93
95
  //#region src/merge.ts
96
+ /** Merge Append Arrays */
94
97
  const mArr = mergeAppendArrays;
98
+ /** Merge Records */
95
99
  const mRec = mergeRecords;
100
+ /** Extract Key Values */
96
101
  const exKV = extractKeyValues;
97
102
  const mergeDefinitionFunctions = {
98
103
  $schema: (key) => recKV(key, void 0),
@@ -142,6 +147,8 @@ const mergeDefinitionFunctions = {
142
147
  reporters: (key, settings) => recKV(key, mArr(exKV(key, settings))),
143
148
  showStatus: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
144
149
  spellCheckDelayMs: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
150
+ softWordBreaks: (key, settings) => recKV(key, mRec(exKV(key, settings))),
151
+ softWordBreakDefinitions: (key, settings) => recKV(key, mRec(exKV(key, settings))),
145
152
  substitutionDefinitions: (key, settings) => recKV(key, mArr(exKV(key, settings))),
146
153
  substitutions: (key, settings) => recKV(key, mArr(exKV(key, settings))),
147
154
  suggestionNumChanges: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
package/dist/index.mjs CHANGED
@@ -43,6 +43,8 @@ const ConfigFields = {
43
43
  readonly: "readonly",
44
44
  reporters: "reporters",
45
45
  showStatus: "showStatus",
46
+ softWordBreaks: "softWordBreaks",
47
+ softWordBreakDefinitions: "softWordBreakDefinitions",
46
48
  spellCheckDelayMs: "spellCheckDelayMs",
47
49
  substitutionDefinitions: "substitutionDefinitions",
48
50
  substitutions: "substitutions",
@@ -90,8 +92,11 @@ function defineConfig(config) {
90
92
  }
91
93
  //#endregion
92
94
  //#region src/merge.ts
95
+ /** Merge Append Arrays */
93
96
  const mArr = mergeAppendArrays;
97
+ /** Merge Records */
94
98
  const mRec = mergeRecords;
99
+ /** Extract Key Values */
95
100
  const exKV = extractKeyValues;
96
101
  const mergeDefinitionFunctions = {
97
102
  $schema: (key) => recKV(key, void 0),
@@ -141,6 +146,8 @@ const mergeDefinitionFunctions = {
141
146
  reporters: (key, settings) => recKV(key, mArr(exKV(key, settings))),
142
147
  showStatus: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
143
148
  spellCheckDelayMs: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
149
+ softWordBreaks: (key, settings) => recKV(key, mRec(exKV(key, settings))),
150
+ softWordBreakDefinitions: (key, settings) => recKV(key, mRec(exKV(key, settings))),
144
151
  substitutionDefinitions: (key, settings) => recKV(key, mArr(exKV(key, settings))),
145
152
  substitutions: (key, settings) => recKV(key, mArr(exKV(key, settings))),
146
153
  suggestionNumChanges: (key, settings) => recKV(key, lastValue(exKV(key, settings))),
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "10.3.0",
7
+ "version": "10.3.1-alpha.1",
8
8
  "description": "Types for cspell and cspell-lib",
9
9
  "type": "commonjs",
10
10
  "sideEffects": false,
@@ -85,5 +85,5 @@
85
85
  "node": ">=22.18.0"
86
86
  },
87
87
  "homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-types#readme",
88
- "gitHead": "d8abd59fa15da6da47955eb6fcca180e8b5cbdbf"
88
+ "gitHead": "aa0576e5b7e666a7e8645939871bcfe4fa2a7eb5"
89
89
  }