mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Merge 37ba67ead0 into ec78a33c7b
This commit is contained in:
commit
7588d4fe31
2 changed files with 27 additions and 0 deletions
|
|
@ -547,6 +547,18 @@ export interface TypeScriptWorker {
|
|||
* @returns `Promise<typescript.InlayHint[]>`
|
||||
*/
|
||||
provideInlayHints(fileName: string, start: number, end: number): Promise<ReadonlyArray<any>>;
|
||||
|
||||
/**
|
||||
* Get encoded semantic classifications in the range of the file.
|
||||
*
|
||||
* The returned number array is encoded as triples of [start, length, ClassificationType, ...].
|
||||
* @returns `Promise<typescript.Classifications | undefined>`
|
||||
*/
|
||||
getEncodedSemanticClassifications(
|
||||
fileName: string,
|
||||
start: number,
|
||||
end: number
|
||||
): Promise<{ spans: number[] } | undefined>;
|
||||
}
|
||||
|
||||
// --- TypeScript configuration and defaults ---------
|
||||
|
|
|
|||
|
|
@ -473,6 +473,21 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
|
|||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async getEncodedSemanticClassifications(
|
||||
fileName: string,
|
||||
start: number,
|
||||
end: number
|
||||
): Promise<ts.Classifications | undefined> {
|
||||
if (fileNameIsLib(fileName)) {
|
||||
return undefined;
|
||||
}
|
||||
return this._languageService.getEncodedSemanticClassifications(
|
||||
fileName,
|
||||
{ start, length: end - start },
|
||||
'2020' as ts.SemanticClassificationFormat
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export interface ICreateData {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue