Skip to content

Commit

Permalink
fix: Increase limits to help with #1256
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Sep 3, 2021
1 parent 257cb0e commit 5837b7a
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 26 deletions.
34 changes: 27 additions & 7 deletions docs/_includes/generated-docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| -------------------------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------- |
| [`cSpell.allowCompoundWords`](#cspellallowcompoundwords) | resource | Enable / Disable allowing word compounds. `true` means `arraylength` would be ok, `false` means… |
| [`cSpell.allowedSchemas`](#cspellallowedschemas) | window | Control which file schemas will be checked for spelling (VS Code must be restarted for this… |
| [`cSpell.blockCheckingWhenAverageChunkSiz…`](#cspellblockcheckingwhenaveragechunksizegreatherthan) | language-overridable | The maximum average chunk of text size. A chunk is the characters between absolute word breaks.… |
| [`cSpell.blockCheckingWhenAverageChunkSiz…`](#cspellblockcheckingwhenaveragechunksizegreatherthan) | language-overridable | The maximum average chunk of text size. |
| [`cSpell.blockCheckingWhenLineLengthGreat…`](#cspellblockcheckingwhenlinelengthgreaterthan) | language-overridable | The maximum line length |
| [`cSpell.blockCheckingWhenTextChunkSizeGr…`](#cspellblockcheckingwhentextchunksizegreaterthan) | language-overridable | The maximum size of text chunks |
| [`cSpell.caseSensitive`](#cspellcasesensitive) | resource | Words must match case rules. |
Expand Down Expand Up @@ -110,10 +110,18 @@ Scope
: language-overridable

Description
: The maximum average chunk of text size. A chunk is the characters between absolute word breaks. Absolute word breaks match: `/[\s,{}[\]]/`
: The maximum average chunk of text size.

A chunk is the characters between absolute word breaks.
Absolute word breaks match: `/[\s,{}[\]]/`

**Error Message:** _Average Word Size is Too High._

If you are seeing this message, it means that the file contains a very long lines
without many word breaks.

Default
: _`40`_
: _`80`_

---

Expand All @@ -129,10 +137,12 @@ Scope
: language-overridable

Description
: The maximum line length
: The maximum line length use to prevent spell checking generated files

**Error Message:** _Lines are too long._

Default
: _`1000`_
: _`10000`_

---

Expand All @@ -148,10 +158,20 @@ Scope
: language-overridable

Description
: The maximum size of text chunks
: The maximum size of text chunks looks for long strings of

It is used to prevent spell checking of generated files.

A chunk is the characters between absolute word breaks.
Absolute word breaks match: `/[\s,{}[\]]/`, i.e. spaces or braces.

**Error Message:** _Maximum Word Length is Too High._

If you are seeing this message, it means that the file contains a very long lines
without many word breaks.

Default
: _`200`_
: _`500`_

---

Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2309,22 +2309,25 @@
"scope": "resource"
},
"cSpell.blockCheckingWhenAverageChunkSizeGreatherThan": {
"default": 40,
"description": "The maximum average chunk of text size. A chunk is the characters between absolute word breaks. Absolute word breaks match: `/[\\s,{}[\\]]/`",
"default": 80,
"description": "The maximum average chunk of text size.",
"scope": "language-overridable",
"type": "number"
"type": "number",
"markdownDescription": "The maximum average chunk of text size.\n\nA chunk is the characters between absolute word breaks.\nAbsolute word breaks match: `/[\\s,{}[\\]]/`\n\n**Error Message:** _Average Word Size is Too High._\n\nIf you are seeing this message, it means that the file contains a very long lines\nwithout many word breaks."
},
"cSpell.blockCheckingWhenLineLengthGreaterThan": {
"default": 1000,
"default": 10000,
"description": "The maximum line length",
"scope": "language-overridable",
"type": "number"
"type": "number",
"markdownDescription": "The maximum line length use to prevent spell checking generated files\n\n**Error Message:** _Lines are too long._"
},
"cSpell.blockCheckingWhenTextChunkSizeGreaterThan": {
"default": 200,
"default": 500,
"description": "The maximum size of text chunks",
"scope": "language-overridable",
"type": "number"
"type": "number",
"markdownDescription": "The maximum size of text chunks looks for long strings of\n\nIt is used to prevent spell checking of generated files.\n\nA chunk is the characters between absolute word breaks.\nAbsolute word breaks match: `/[\\s,{}[\\]]/`, i.e. spaces or braces.\n\n**Error Message:** _Maximum Word Length is Too High._\n\nIf you are seeing this message, it means that the file contains a very long lines\nwithout many word breaks."
},
"cSpell.suggestionMenuType": {
"default": "quickPick",
Expand Down
11 changes: 7 additions & 4 deletions packages/_server/spell-checker-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@
"type": "array"
},
"blockCheckingWhenAverageChunkSizeGreatherThan": {
"default": 40,
"description": "The maximum average chunk of text size. A chunk is the characters between absolute word breaks. Absolute word breaks match: `/[\\s,{}[\\]]/`",
"default": 80,
"description": "The maximum average chunk of text size.",
"markdownDescription": "The maximum average chunk of text size.\n\nA chunk is the characters between absolute word breaks.\nAbsolute word breaks match: `/[\\s,{}[\\]]/`\n\n**Error Message:** _Average Word Size is Too High._\n\nIf you are seeing this message, it means that the file contains a very long lines\nwithout many word breaks.",
"scope": "language-overridable",
"type": "number"
},
"blockCheckingWhenLineLengthGreaterThan": {
"default": 1000,
"default": 10000,
"description": "The maximum line length",
"markdownDescription": "The maximum line length use to prevent spell checking generated files\n\n**Error Message:** _Lines are too long._",
"scope": "language-overridable",
"type": "number"
},
"blockCheckingWhenTextChunkSizeGreaterThan": {
"default": 200,
"default": 500,
"description": "The maximum size of text chunks",
"markdownDescription": "The maximum size of text chunks looks for long strings of\n\nIt is used to prevent spell checking of generated files.\n\nA chunk is the characters between absolute word breaks.\nAbsolute word breaks match: `/[\\s,{}[\\]]/`, i.e. spaces or braces.\n\n**Error Message:** _Maximum Word Length is Too High._\n\nIf you are seeing this message, it means that the file contains a very long lines\nwithout many word breaks.",
"scope": "language-overridable",
"type": "number"
},
Expand Down
33 changes: 30 additions & 3 deletions packages/_server/src/config/cspellConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,49 @@ type EnableFileTypeId = string;
interface SpellCheckerShouldCheckDocSettings {
/**
* The maximum line length
* @markdownDescription
* The maximum line length use to prevent spell checking generated files
*
* **Error Message:** _Lines are too long._
*
* @scope language-overridable
* @default 1000
* @default 10000
*/
blockCheckingWhenLineLengthGreaterThan?: number;
/**
* The maximum size of text chunks
* @markdownDescription
* The maximum size of text chunks looks for long strings of
*
* It is used to prevent spell checking of generated files.
*
* A chunk is the characters between absolute word breaks.
* Absolute word breaks match: `/[\s,{}[\]]/`, i.e. spaces or braces.
*
* **Error Message:** _Maximum Word Length is Too High._
*
* If you are seeing this message, it means that the file contains a very long lines
* without many word breaks.
*
* @scope language-overridable
* @default 200
* @default 500
*/
blockCheckingWhenTextChunkSizeGreaterThan?: number;
/**
* The maximum average chunk of text size.
* @markdownDescription
* The maximum average chunk of text size.
*
* A chunk is the characters between absolute word breaks.
* Absolute word breaks match: `/[\s,{}[\]]/`
*
* **Error Message:** _Average Word Size is Too High._
*
* If you are seeing this message, it means that the file contains a very long lines
* without many word breaks.
*
* @scope language-overridable
* @default 40
* @default 80
*/
blockCheckingWhenAverageChunkSizeGreatherThan?: number;
}
Expand Down
10 changes: 5 additions & 5 deletions packages/_server/src/utils/analysis.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { genSequence } from 'gensequence';

export const ReasonLineLength = 'Lines are too long.' as const;
export const ReasonAverageWordsSize = 'Average Word Size is Too High' as const;
export const ReasonMaxWordsSize = 'Maximum Word Length is Too High' as const;
export const ReasonAverageWordsSize = 'Average Word Size is Too High.' as const;
export const ReasonMaxWordsSize = 'Maximum Word Length is Too High.' as const;

type MinifiedReasons = typeof ReasonLineLength | typeof ReasonAverageWordsSize | typeof ReasonMaxWordsSize;

Expand All @@ -20,9 +20,9 @@ export interface IsTextLikelyMinifiedOptions {
}

export const defaultIsTextLikelyMinifiedOptions: IsTextLikelyMinifiedOptions = {
blockCheckingWhenLineLengthGreaterThan: 1000,
blockCheckingWhenTextChunkSizeGreaterThan: 200,
blockCheckingWhenAverageChunkSizeGreatherThan: 40,
blockCheckingWhenLineLengthGreaterThan: 10000,
blockCheckingWhenTextChunkSizeGreaterThan: 500,
blockCheckingWhenAverageChunkSizeGreatherThan: 80,
};

/**
Expand Down

0 comments on commit 5837b7a

Please sign in to comment.