Skip to content

Commit

Permalink
fix: Add link to suggestions (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Oct 22, 2023
1 parent d179d2e commit eff9c8c
Show file tree
Hide file tree
Showing 18 changed files with 321 additions and 248 deletions.
118 changes: 59 additions & 59 deletions docs/_includes/generated-docs/configuration.md
Expand Up @@ -351,6 +351,8 @@ Default
| Setting | Scope | Description |
| ------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------------------- |
| [`cSpell.autoFormatConfigFile`](#cspellautoformatconfigfile) | window | Auto Format Configuration File |
| [`cSpell.diagnosticLevel`](#cspelldiagnosticlevel) | resource | Set Diagnostic Reporting Level |
| [`cSpell.diagnosticLevelFlaggedWords`](#cspelldiagnosticlevelflaggedwords) | resource | Set Diagnostic Reporting Level for Flagged Words |
| [`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,6 +390,58 @@ 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.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.hideAddToDictionaryCodeActions`

Name
Expand Down Expand Up @@ -1286,13 +1340,11 @@ 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`. |
| Setting | Scope | Description |
| -------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------- |
| [`cSpell.decorateIssues`](#cspelldecorateissues) | application | Draw custom decorations on Spelling Issues when the `#cSpell.diagnosticLevel#` is `Hint`. |
| [`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

Expand All @@ -1318,58 +1370,6 @@ Version

---

### `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
Expand Down
5 changes: 4 additions & 1 deletion fixtures/workspaces/jupyter/cspell.json
@@ -1,5 +1,8 @@
{
"flagWords": ["forbidd->forbid"],
"flagWords": [
"forbidd->forbid"
],
"suggestWords": ["againn->again"],
"ignorePaths": [
"package-lock.json",
"node_modules",
Expand Down
9 changes: 2 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 39 additions & 40 deletions package.json
Expand Up @@ -1970,44 +1970,6 @@
"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.",
Expand Down Expand Up @@ -2598,6 +2560,44 @@
"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.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.hideAddToDictionaryCodeActions": {
"default": false,
"markdownDescription": "Hide the options to add words to dictionaries or settings.",
Expand Down Expand Up @@ -2744,7 +2744,7 @@
"preinstall": "npx only-allow npm"
},
"devDependencies": {
"@tsconfig/node16": "^16.1.1",
"@tsconfig/node18": "^18.2.2",
"@types/jest-when": "^3.5.3",
"@types/node": "^18.18.5",
"@types/vscode": "1.80.0",
Expand Down Expand Up @@ -2784,7 +2784,6 @@
"dependencies": {
"@cspell/cspell-bundled-dicts": "^7.3.8",
"@cspell/cspell-types": "^7.3.8",
"@tsconfig/node18": "^18.2.2",
"@types/react": "^17.0.68",
"cspell": "^7.3.8",
"regexp-worker": "^2.0.2"
Expand Down
60 changes: 30 additions & 30 deletions packages/_server/spell-checker-config.schema.json
Expand Up @@ -1628,36 +1628,6 @@
"type": "boolean",
"version": "4.0.0"
},
"cSpell.diagnosticLevel": {
"default": "Information",
"description": "Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.",
"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": {
"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.",
"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",
"description": "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.",
Expand Down Expand Up @@ -2251,6 +2221,36 @@
"title": "Auto Format Configuration File",
"type": "boolean"
},
"cSpell.diagnosticLevel": {
"default": "Information",
"description": "Issues found by the spell checker are marked with a Diagnostic Severity Level. This affects the color of the squiggle.",
"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": {
"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.",
"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.hideAddToDictionaryCodeActions": {
"default": false,
"description": "Hide the options to add words to dictionaries or settings.",
Expand Down
2 changes: 1 addition & 1 deletion packages/_server/src/api/api.ts
Expand Up @@ -31,7 +31,7 @@ export interface ServerRequestsAPI {
getConfigurationForDocument(req: GetConfigurationForDocumentRequest): GetConfigurationForDocumentResult;
isSpellCheckEnabled(req: TextDocumentInfo): IsSpellCheckEnabledResult;
splitTextIntoWords(req: string): SplitTextIntoWordsResult;
spellingSuggestions(req: TextDocumentInfo): SpellingSuggestionsResult;
spellingSuggestions(word: string, doc: TextDocumentInfo): SpellingSuggestionsResult;
}

/** Notifications that can be sent to the server */
Expand Down
5 changes: 4 additions & 1 deletion packages/_server/src/api/apiModels.ts
@@ -1,5 +1,6 @@
import type { ConfigScopeVScode, ConfigTarget } from '../config/configTargets.mjs';
import type * as config from '../config/cspellConfig/index.mjs';
import { Suggestion } from '../models/Suggestion.mjs';

export type {
ConfigKind,
Expand Down Expand Up @@ -58,7 +59,9 @@ export interface SplitTextIntoWordsResult {
words: string[];
}

export interface SpellingSuggestionsResult {}
export interface SpellingSuggestionsResult {
suggestions: Suggestion[];
}

export interface TextDocumentInfo {
uri?: UriString;
Expand Down

0 comments on commit eff9c8c

Please sign in to comment.