mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 17:12:53 +00:00
Ignore cancelled inlay hints responses
This commit is contained in:
parent
de278d1649
commit
b133a3b55c
@ -79,13 +79,15 @@ export class HintsUpdater {
|
||||
documentUri: string,
|
||||
editor: TextEditor
|
||||
): Promise<void> {
|
||||
const newHints = (await this.queryHints(documentUri)) || [];
|
||||
const newHints = await this.queryHints(documentUri);
|
||||
if (newHints != null) {
|
||||
const newDecorations = newHints.map(hint => ({
|
||||
range: hint.range,
|
||||
renderOptions: { after: { contentText: `: ${hint.label}` } }
|
||||
}));
|
||||
return editor.setDecorations(typeHintDecorationType, newDecorations);
|
||||
}
|
||||
}
|
||||
|
||||
private async queryHints(documentUri: string): Promise<InlayHint[] | null> {
|
||||
const request: InlayHintsParams = {
|
||||
|
Loading…
Reference in New Issue
Block a user