1610: Ignore cancelled inlay hints responses r=matklad a=SomeoneToIgnore

Fixes #1607

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
bors[bot] 2019-07-29 08:40:17 +00:00
commit e2f65f61af

View File

@ -79,12 +79,17 @@ export class HintsUpdater {
documentUri: string,
editor: TextEditor
): Promise<void> {
const newHints = (await this.queryHints(documentUri)) || [];
const newDecorations = newHints.map(hint => ({
range: hint.range,
renderOptions: { after: { contentText: `: ${hint.label}` } }
}));
return editor.setDecorations(typeHintDecorationType, newDecorations);
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> {