Minor refactor
This commit is contained in:
parent
6b118c9b8d
commit
da80b6c1e1
@ -1,14 +1,13 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { Range, TextDocumentChangeEvent, TextEditor } from 'vscode';
|
import * as lc from 'vscode-languageclient';
|
||||||
import { TextDocumentIdentifier } from 'vscode-languageclient';
|
|
||||||
import { Server } from '../server';
|
import { Server } from '../server';
|
||||||
|
|
||||||
interface InlayHintsParams {
|
interface InlayHintsParams {
|
||||||
textDocument: TextDocumentIdentifier;
|
textDocument: lc.TextDocumentIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InlayHint {
|
interface InlayHint {
|
||||||
range: Range;
|
range: vscode.Range;
|
||||||
kind: string;
|
kind: string;
|
||||||
label: string;
|
label: string;
|
||||||
}
|
}
|
||||||
@ -32,11 +31,10 @@ export class HintsUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async refreshHintsForVisibleEditors(
|
public async refreshHintsForVisibleEditors(
|
||||||
cause?: TextDocumentChangeEvent,
|
cause?: vscode.TextDocumentChangeEvent,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (!this.displayHints) {
|
if (!this.displayHints) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
cause !== undefined &&
|
cause !== undefined &&
|
||||||
(cause.contentChanges.length === 0 ||
|
(cause.contentChanges.length === 0 ||
|
||||||
@ -79,7 +77,7 @@ export class HintsUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async updateDecorationsFromServer(
|
private async updateDecorationsFromServer(
|
||||||
editor: TextEditor,
|
editor: vscode.TextEditor,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const newHints = await this.queryHints(editor.document.uri.toString());
|
const newHints = await this.queryHints(editor.document.uri.toString());
|
||||||
if (newHints !== null) {
|
if (newHints !== null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user