mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-16 07:15:24 +00:00
Style and test fixes
This commit is contained in:
parent
15411d4474
commit
3fb6462d54
2 changed files with 45 additions and 34 deletions
|
@ -27,14 +27,19 @@ export class HintsUpdater {
|
|||
if (this.displayHints) {
|
||||
const documentUri = this.getEditorDocumentUri(editor);
|
||||
if (documentUri !== null) {
|
||||
const latestDecorations = this.drawnDecorations.get(documentUri);
|
||||
const latestDecorations = this.drawnDecorations.get(
|
||||
documentUri
|
||||
);
|
||||
if (latestDecorations === undefined) {
|
||||
await this.updateDecorationsFromServer(
|
||||
documentUri,
|
||||
editor!
|
||||
);
|
||||
} else {
|
||||
await editor!.setDecorations(typeHintDecorationType, latestDecorations);
|
||||
await editor!.setDecorations(
|
||||
typeHintDecorationType,
|
||||
latestDecorations
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,9 +53,12 @@ export class HintsUpdater {
|
|||
if (displayHints) {
|
||||
return this.updateHints();
|
||||
} else {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (this.getEditorDocumentUri(editor) !== null) {
|
||||
return editor!.setDecorations(typeHintDecorationType, []);
|
||||
const currentEditor = vscode.window.activeTextEditor;
|
||||
if (this.getEditorDocumentUri(currentEditor) !== null) {
|
||||
return currentEditor!.setDecorations(
|
||||
typeHintDecorationType,
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +100,10 @@ export class HintsUpdater {
|
|||
|
||||
this.drawnDecorations.set(documentUri, newDecorations);
|
||||
|
||||
if (this.getEditorDocumentUri(vscode.window.activeTextEditor) === documentUri) {
|
||||
if (
|
||||
this.getEditorDocumentUri(vscode.window.activeTextEditor) ===
|
||||
documentUri
|
||||
) {
|
||||
return editor.setDecorations(
|
||||
typeHintDecorationType,
|
||||
newDecorations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue