mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Adds a CodeAction provider to support fixits
This commit is contained in:
parent
2389ae38aa
commit
b8063f957f
5 changed files with 87 additions and 5 deletions
|
|
@ -146,6 +146,12 @@ export class TypeScriptWorker implements ts.LanguageServiceHost {
|
|||
return Promise.resolve(diagnostics);
|
||||
}
|
||||
|
||||
getSuggestionDiagnostics(fileName: string): Promise<ts.DiagnosticWithLocation[]> {
|
||||
const diagnostics = this._languageService.getSuggestionDiagnostics(fileName);
|
||||
TypeScriptWorker.clearFiles(diagnostics);
|
||||
return Promise.resolve(diagnostics);
|
||||
}
|
||||
|
||||
getCompilerOptionsDiagnostics(fileName: string): Promise<ts.Diagnostic[]> {
|
||||
const diagnostics = this._languageService.getCompilerOptionsDiagnostics();
|
||||
TypeScriptWorker.clearFiles(diagnostics);
|
||||
|
|
@ -200,6 +206,11 @@ export class TypeScriptWorker implements ts.LanguageServiceHost {
|
|||
return Promise.resolve(this._languageService.getEmitOutput(fileName));
|
||||
}
|
||||
|
||||
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes:number[], formatOptions: ts.FormatCodeOptions): Promise<ReadonlyArray<ts.CodeFixAction>> {
|
||||
const preferences = {}
|
||||
return Promise.resolve(this._languageService.getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences));
|
||||
}
|
||||
|
||||
updateExtraLibs(extraLibs: IExtraLibs) {
|
||||
this._extraLibs = extraLibs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue