-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add command to autofix spelling issues. (#2906)
- Loading branch information
Showing
12 changed files
with
87 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './api.js'; | ||
// export * from './api.old.js'; | ||
export * from './apiModels.js'; | ||
export type * from './apiModels.js'; | ||
export * from './CommandsToClient.js'; | ||
export { SpellCheckerDiagnosticData } from './models/DiagnosticData.mjs'; | ||
export { Suggestion } from './models/Suggestion.mjs'; | ||
export type * from './models/index.mjs'; | ||
export type { Suggestion } from './models/Suggestion.mjs'; |
11 changes: 10 additions & 1 deletion
11
..._server/src/api/models/DiagnosticData.mts → ...ges/_server/src/api/models/Diagnostic.mts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import type { IssueType } from 'cspell-lib'; | ||
import type { IssueType } from '@cspell/cspell-types'; | ||
import type { Diagnostic } from 'vscode-languageserver-types'; | ||
|
||
import type { Suggestion } from './Suggestion.mjs'; | ||
import type { DiagnosticSource } from './types.mjs'; | ||
|
||
export interface SpellCheckerDiagnosticData { | ||
/** The text of the issue. It is expected to match `document.getText(diag.range)` */ | ||
text?: string; | ||
issueType?: IssueType | undefined; | ||
/** The issue indicates that the word has been flagged as an error. */ | ||
isFlagged?: boolean | undefined; | ||
/** The issue is a suggested change, but is not considered an error. */ | ||
isSuggestion?: boolean | undefined; | ||
suggestions?: Suggestion[] | undefined; | ||
} | ||
|
||
export interface SpellingDiagnostic extends Diagnostic { | ||
source: DiagnosticSource; | ||
data: SpellCheckerDiagnosticData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type { SpellCheckerDiagnosticData, SpellingDiagnostic } from './Diagnostic.mjs'; | ||
export type { DiagnosticSource, ExtensionId } from './types.mjs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type ExtensionId = 'cSpell'; | ||
|
||
export type DiagnosticSource = ExtensionId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters