Skip to content

Commit

Permalink
feat: support custom decorators (#2887)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Oct 21, 2023
1 parent 6f8a721 commit d179d2e
Show file tree
Hide file tree
Showing 15 changed files with 478 additions and 70 deletions.
174 changes: 149 additions & 25 deletions docs/_includes/generated-docs/configuration.md
Expand Up @@ -8,6 +8,7 @@
- [Files, Folders, and Workspaces](#files-folders-and-workspaces)
- [Performance](#performance)
- [CSpell](#cspell)
- [Appearance](#appearance)
- [Advanced](#advanced)
- [Experimental](#experimental)
- [Legacy](#legacy)
Expand Down Expand Up @@ -350,7 +351,6 @@ Default
| Setting | Scope | Description |
| ------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------------------- |
| [`cSpell.autoFormatConfigFile`](#cspellautoformatconfigfile) | window | Auto Format Configuration File |
| [`cSpell.diagnosticLevel`](#cspelldiagnosticlevel) | resource | Set Diagnostic Reporting Level |
| [`cSpell.hideAddToDictionaryCodeActions`](#cspellhideaddtodictionarycodeactions) | resource | Hide the options to add words to dictionaries or settings. |
| [`cSpell.maxDuplicateProblems`](#cspellmaxduplicateproblems) | resource | The maximum number of times the same word can be flagged as an error in a file. |
| [`cSpell.maxNumberOfProblems`](#cspellmaxnumberofproblems) | resource | Controls the maximum number of spelling errors per document. |
Expand Down Expand Up @@ -388,30 +388,6 @@ Default

---

### `cSpell.diagnosticLevel`

Name
: `cSpell.diagnosticLevel` -- Set Diagnostic Reporting Level

Type
: ( `"Error"` \| `"Warning"` \| `"Information"` \| `"Hint"` )

| `Error` | Report Spelling Issues as Errors |
| `Warning` | Report Spelling Issues as Warnings |
| `Information` | Report Spelling Issues as Information |
| `Hint` | Report Spelling Issues as Hints, will not show up in Problems |

Scope
: resource

Description
: Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.

Default
: _`"Information"`_

---

### `cSpell.hideAddToDictionaryCodeActions`

Name
Expand Down Expand Up @@ -1308,6 +1284,154 @@ Default

---

# Appearance

| Setting | Scope | Description |
| -------------------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------- |
| [`cSpell.decorateIssues`](#cspelldecorateissues) | application | Draw custom decorations on Spelling Issues when the `#cSpell.diagnosticLevel#` is `Hint`. |
| [`cSpell.diagnosticLevel`](#cspelldiagnosticlevel) | resource | Set Diagnostic Reporting Level |
| [`cSpell.diagnosticLevelFlaggedWords`](#cspelldiagnosticlevelflaggedwords) | resource | Set Diagnostic Reporting Level for Flagged Words |
| [`cSpell.overviewRulerColor`](#cspelloverviewrulercolor) | application | The CSS color used to show issues in the ruler. |
| [`cSpell.textDecoration`](#cspelltextdecoration) | application | The CSS Style used to decorate spelling issues when `#cSpell.diagnosticLevel#` is `Hint`. |

## Definitions

### `cSpell.decorateIssues`

Name
: `cSpell.decorateIssues`

Type
: boolean

Scope
: application

Description
: Draw custom decorations on Spelling Issues when the `#cSpell.diagnosticLevel#` is `Hint`.

Default
: _`false`_

Version
: 4.0.0

---

### `cSpell.diagnosticLevel`

Name
: `cSpell.diagnosticLevel` -- Set Diagnostic Reporting Level

Type
: ( `"Error"` \| `"Warning"` \| `"Information"` \| `"Hint"` )

| `Error` | Report Spelling Issues as Errors |
| `Warning` | Report Spelling Issues as Warnings |
| `Information` | Report Spelling Issues as Information |
| `Hint` | Report Spelling Issues as Hints, will not show up in Problems |

Scope
: resource

Description
: Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.

Default
: _`"Information"`_

---

### `cSpell.diagnosticLevelFlaggedWords`

Name
: `cSpell.diagnosticLevelFlaggedWords` -- Set Diagnostic Reporting Level for Flagged Words

Type
: ( `"Error"` \| `"Warning"` \| `"Information"` \| `"Hint"` )

| `Error` | Report Spelling Issues as Errors |
| `Warning` | Report Spelling Issues as Warnings |
| `Information` | Report Spelling Issues as Information |
| `Hint` | Report Spelling Issues as Hints, will not show up in Problems |

Scope
: resource

Description
: Flagged word issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.
By default, flagged words will use the same diagnostic level as general issues. Use this setting to customize them.

Default
: _- none -_

Version
: 4.0.0

---

### `cSpell.overviewRulerColor`

Name
: `cSpell.overviewRulerColor`

Type
: string

Scope
: application

Description
: The CSS color used to show issues in the ruler.

- Supports named colors: [CSS Colors](https://www.w3schools.com/cssref/css_colors.php)
- Hex colors
- Use `` (empty string) to disable.

Examples:
- `green`
- `DarkYellow`
- `#ffff0080` - semi-transparent yellow.

Default
: _`"#00800080"`_

Version
: 4.0.0

---

### `cSpell.textDecoration`

Name
: `cSpell.textDecoration`

Type
: string

Scope
: application

Description
: The CSS Style used to decorate spelling issues when `#cSpell.diagnosticLevel#` is `Hint`.

See: [text-decoration - CSS: Cascading Style Sheets, MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)

- Use `` (empty string) to disable text decoration.

Examples:
- `blue`
- `yellow`
- `underline wavy #ffff0080 1.5px` - Wavy underline with 1.5px line width in semi-transparent yellow.

Default
: _`"underline wavy #00800080"`_

Version
: 4.0.0

---

# Advanced

| Setting | Scope | Description |
Expand Down
4 changes: 4 additions & 0 deletions fixtures/workspaces/jupyter/.vscode/settings.json
@@ -0,0 +1,4 @@
{
"cSpell.diagnosticLevel": "Hint",
"cSpell.diagnosticLevelFlaggedWords": "Information"
}
11 changes: 11 additions & 0 deletions fixtures/workspaces/jupyter/cspell.json
@@ -0,0 +1,11 @@
{
"flagWords": ["forbidd->forbid"],
"ignorePaths": [
"package-lock.json",
"node_modules",
"vscode-extension",
".git/objects",
".vscode",
".vscode-insiders"
]
}
2 changes: 2 additions & 0 deletions fixtures/workspaces/jupyter/getting-started/README.md
Expand Up @@ -5,3 +5,5 @@ Thesse are wordz to livve by.
Whaat do youu thinkk?

How about trying it agaain?

forbidd
8 changes: 6 additions & 2 deletions fixtures/workspaces/jupyter/getting-started/sample.ipynb
Expand Up @@ -27,7 +27,11 @@
"\n",
"Below is some code.\n",
"\n",
"Let's have a spelling errror."
"Let's have a spelling errror.\n",
"\n",
"annnother error.\n",
"\n",
"1 12 123 1234 12345"
]
},
{
Expand Down Expand Up @@ -58,7 +62,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-1300.0.29.30)]"
"version": "3.11.2"
},
"orig_nbformat": 4
},
Expand Down
12 changes: 12 additions & 0 deletions fixtures/workspaces/jupyter/hello.py
@@ -0,0 +1,12 @@
# Primt Hello, world!

print('Hello, world!')

# More commentss the Uuse.

# With

# Some errrors and on some lines.
# We have lines without errors.
# It is important for checking the minimap.
# But it is not obvious what should happen.
86 changes: 67 additions & 19 deletions package.json
Expand Up @@ -1959,6 +1959,73 @@
"title": "Languages and Dictionaries",
"type": "object"
},
{
"additionalProperties": false,
"order": 6,
"properties": {
"cSpell.decorateIssues": {
"default": false,
"markdownDescription": "Draw custom decorations on Spelling Issues when the `#cSpell.diagnosticLevel#` is `Hint`.",
"scope": "application",
"type": "boolean",
"version": "4.0.0"
},
"cSpell.diagnosticLevel": {
"default": "Information",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"enumDescriptions": [
"Report Spelling Issues as Errors",
"Report Spelling Issues as Warnings",
"Report Spelling Issues as Information",
"Report Spelling Issues as Hints, will not show up in Problems"
],
"markdownDescription": "Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.",
"scope": "resource",
"title": "Set Diagnostic Reporting Level",
"type": "string"
},
"cSpell.diagnosticLevelFlaggedWords": {
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"enumDescriptions": [
"Report Spelling Issues as Errors",
"Report Spelling Issues as Warnings",
"Report Spelling Issues as Information",
"Report Spelling Issues as Hints, will not show up in Problems"
],
"markdownDescription": "Flagged word issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.\nBy default, flagged words will use the same diagnostic level as general issues. Use this setting to customize them.",
"scope": "resource",
"title": "Set Diagnostic Reporting Level for Flagged Words",
"type": "string",
"version": "4.0.0"
},
"cSpell.overviewRulerColor": {
"default": "#00800080",
"markdownDescription": "The CSS color used to show issues in the ruler.\n\n- Supports named colors: [CSS Colors](https://www.w3schools.com/cssref/css_colors.php)\n- Hex colors\n- Use `` (empty string) to disable.\n\nExamples:\n- `green`\n- `DarkYellow`\n- `#ffff0080` - semi-transparent yellow.",
"scope": "application",
"type": "string",
"version": "4.0.0"
},
"cSpell.textDecoration": {
"default": "underline wavy #00800080",
"markdownDescription": "The CSS Style used to decorate spelling issues when `#cSpell.diagnosticLevel#` is `Hint`.\n\nSee: [text-decoration - CSS: Cascading Style Sheets, MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)\n\n- Use `` (empty string) to disable text decoration.\n\nExamples:\n- `blue`\n- `yellow`\n- `underline wavy #ffff0080 1.5px` - Wavy underline with 1.5px line width in semi-transparent yellow.",
"scope": "application",
"type": "string",
"version": "4.0.0"
}
},
"title": "Appearance",
"type": "object"
},
{
"additionalProperties": false,
"order": 20,
Expand Down Expand Up @@ -2531,25 +2598,6 @@
"title": "Auto Format Configuration File",
"type": "boolean"
},
"cSpell.diagnosticLevel": {
"default": "Information",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"enumDescriptions": [
"Report Spelling Issues as Errors",
"Report Spelling Issues as Warnings",
"Report Spelling Issues as Information",
"Report Spelling Issues as Hints, will not show up in Problems"
],
"markdownDescription": "Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.",
"scope": "resource",
"title": "Set Diagnostic Reporting Level",
"type": "string"
},
"cSpell.hideAddToDictionaryCodeActions": {
"default": false,
"markdownDescription": "Hide the options to add words to dictionaries or settings.",
Expand Down

0 comments on commit d179d2e

Please sign in to comment.