Skip to content

Commit

Permalink
Adds support for spell checking comment editors
Browse files Browse the repository at this point in the history
This enables spell check in VS Code's comment editors. Depends on microsoft/vscode#209512
  • Loading branch information
mjbvz committed Apr 4, 2024
1 parent a493f52 commit b9c18df
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/_includes/generated-docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,10 @@ Description
- `vscode-notebook-cell` - Used for validating segments of a Notebook.
- `vscode-userdata` - Needed to spell check `.code-snippets`
- `vscode-scm` - Needed to spell check Source Control commit messages.
- `comment` - Used for new comment editors.

Default
: [ _`"file"`_, _`"gist"`_, _`"repo"`_, _`"sftp"`_, _`"untitled"`_, _`"vscode-notebook-cell"`_, _`"vscode-scm"`_, _`"vscode-userdata"`_, _`"vscode-vfs"`_, _`"vsls"`_ ]
: [ _`"file"`_, _`"gist"`_, _`"repo"`_, _`"sftp"`_, _`"untitled"`_, _`"vscode-notebook-cell"`_, _`"vscode-scm"`_, _`"comment"`_, _`"vscode-userdata"`_, _`"vscode-vfs"`_, _`"vsls"`_ ]

---

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1578,14 +1578,15 @@
"untitled",
"vscode-notebook-cell",
"vscode-scm",
"comment",
"vscode-userdata",
"vscode-vfs",
"vsls"
],
"items": {
"type": "string"
},
"markdownDescription": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.",
"markdownDescription": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.\n- `comment` - Used for new comment editors.",
"scope": "window",
"title": "Define Allowed Schemas",
"type": "array"
Expand Down
12 changes: 11 additions & 1 deletion packages/__utils/src/uriHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { URI as Uri, Utils as UriUtils } from 'vscode-uri';

export const supportedSchemes = ['file', 'gist', 'repo', 'sftp', 'untitled', 'vscode-notebook-cell', 'vscode-scm', 'vscode-userdata'];
export const supportedSchemes = [
'file',
'gist',
'repo',
'sftp',
'untitled',
'vscode-notebook-cell',
'vscode-scm',
'vscode-userdata',
'comment',
];
export const setOfSupportedSchemes = new Set(supportedSchemes);

export function isSupportedUri(uri?: Uri): boolean {
Expand Down
5 changes: 3 additions & 2 deletions packages/_server/spell-checker-config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1098,15 +1098,16 @@
"untitled",
"vscode-notebook-cell",
"vscode-scm",
"comment",
"vscode-userdata",
"vscode-vfs",
"vsls"
],
"description": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.",
"description": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.\n- `comment` - Used for new comment editors.",
"items": {
"type": "string"
},
"markdownDescription": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.",
"markdownDescription": "Control which file schemas will be checked for spelling (VS Code must be restarted for this setting to take effect).\n\n\nSome schemas have special meaning like:\n- `untitled` - Used for new documents that have not yet been saved\n- `vscode-notebook-cell` - Used for validating segments of a Notebook.\n- `vscode-userdata` - Needed to spell check `.code-snippets`\n- `vscode-scm` - Needed to spell check Source Control commit messages.\n- `comment` - Used for new comment editors.",
"scope": "window",
"title": "Define Allowed Schemas",
"type": "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export interface SpellCheckerSettings extends SpellCheckerShouldCheckDocSettings
* - `vscode-notebook-cell` - Used for validating segments of a Notebook.
* - `vscode-userdata` - Needed to spell check `.code-snippets`
* - `vscode-scm` - Needed to spell check Source Control commit messages.
* - `comment` - Used for new comment editors.
* @title Define Allowed Schemas
* @scope window
* @default ["file", "gist", "repo", "sftp", "untitled", "vscode-notebook-cell", "vscode-scm", "vscode-userdata", "vscode-vfs", "vsls"]
* @default ["file", "gist", "repo", "sftp", "untitled", "vscode-notebook-cell", "vscode-scm", "comment", "vscode-userdata", "vscode-vfs", "vsls"]
*/
allowedSchemas?: string[];

Expand Down

0 comments on commit b9c18df

Please sign in to comment.