Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support preferred suggestions (#3885)
To support AutoFix, it is necessary to distinguish which suggestions are preferred. Preferred suggestions are AutoFix candidates.
- Loading branch information
Showing
16 changed files
with
165 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface ExtendedSuggestion { | ||
word: string; | ||
isPreferred?: boolean; | ||
} |
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,7 @@ | ||
import type { ExtendedSuggestion } from './Suggestion'; | ||
import type { ValidationResult } from './ValidationResult'; | ||
|
||
export interface ValidationIssue extends ValidationResult { | ||
suggestions?: string[]; | ||
suggestionsEx?: ExtendedSuggestion[]; | ||
} |
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,7 @@ | ||
import { TextOffset as TextOffsetRW, Issue } from '@cspell/cspell-types'; | ||
|
||
export interface ValidationResult extends TextOffsetRW, Pick<Issue, 'message' | 'issueType'> { | ||
line: TextOffsetRW; | ||
isFlagged?: boolean | undefined; | ||
isFound?: boolean | undefined; | ||
} |
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
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,9 +1,11 @@ | ||
export type { ValidationIssue } from '../Models/ValidationIssue'; | ||
export type { ValidationResult } from '../Models/ValidationResult'; | ||
export { checkText, checkTextDocument, IncludeExcludeFlag } from './checkText'; | ||
export type { CheckTextInfo, TextInfoItem } from './checkText'; | ||
export { DocumentValidator } from './docValidator'; | ||
export type { DocumentValidatorOptions } from './docValidator'; | ||
export type { Offset, SimpleRange } from './parsedText'; | ||
export { calcTextInclusionRanges } from './textValidator'; | ||
export type { CheckOptions, IncludeExcludeOptions, ValidationOptions, ValidationResult } from './ValidationTypes'; | ||
export type { CheckOptions, IncludeExcludeOptions, ValidationOptions } from './ValidationTypes'; | ||
export { validateText } from './validator'; | ||
export type { ValidateTextOptions, ValidationIssue } from './validator'; | ||
export type { ValidateTextOptions } from './validator'; |
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
Oops, something went wrong.