Code review fixes

Co-Authored-By: Veetaha <veetaha2@gmail.com>
This commit is contained in:
Kirill Bulatov
2020-03-22 00:40:07 +02:00
parent 590af37bff
commit b892a48740
5 changed files with 18 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ import { Config } from './config';
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
export function configToServerOptions(config: Config): object {
export function configToServerOptions(config: Config) {
return {
publishDecorations: !config.highlightingSemanticTokens,
lruCapacity: config.lruCapacity,

View File

@@ -17,9 +17,11 @@ export function activateInlayHints(ctx: Ctx) {
) {
return this.dispose();
}
if (!this.updater) this.updater = new HintsUpdater(ctx);
this.updater.syncCacheAndRenderHints();
if (this.updater) {
this.updater.syncCacheAndRenderHints();
} else {
this.updater = new HintsUpdater(ctx);
}
},
dispose() {
this.updater?.dispose();
@@ -126,7 +128,7 @@ class HintsUpdater implements Disposable {
this.syncCacheAndRenderHints();
}
public syncCacheAndRenderHints() {
syncCacheAndRenderHints() {
// FIXME: make inlayHints request pass an array of files?
this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => {
if (!hints) return;

View File

@@ -95,7 +95,7 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.workspace.onDidChangeConfiguration(
_ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
null,
ctx?.subscriptions,
ctx.subscriptions,
);
}