From 12a098856e4fe179b59a3cde1e68d184a9410a9a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Apr 2021 12:22:00 +0200 Subject: [PATCH] Fix TS warnings vscode is strict about style --- vscode_extension/src/extension.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/vscode_extension/src/extension.ts b/vscode_extension/src/extension.ts index 78469c68e..22b954080 100644 --- a/vscode_extension/src/extension.ts +++ b/vscode_extension/src/extension.ts @@ -23,27 +23,31 @@ import { let client: LanguageClient; function lspProgramNameSuffix(): string | null { - if (process.platform == "darwin") + if (process.platform === "darwin") { return "x86_64-apple-darwin"; - if (process.platform === "linux") { - if (process.arch === "x64") - return "x86_64-unknown-linux-gnu" } - if (process.platform == "win32") + if (process.platform === "linux") { + if (process.arch === "x64") { + return "x86_64-unknown-linux-gnu"; + } + } + if (process.platform === "win32") { return "x86_64-pc-windows-gnu.exe"; + } return null; } export function activate(context: ExtensionContext) { - let lsp_suffix = lspProgramNameSuffix(); - if (lsp_suffix == null) + let lspSuffix = lspProgramNameSuffix(); + if (lspSuffix === null) { return; + } - let serverModule = path.join(context.extensionPath, "bin", "sixtyfps-lsp-" + lsp_suffix); + let serverModule = path.join(context.extensionPath, "bin", "sixtyfps-lsp-" + lspSuffix); - if (!existsSync(serverModule)) + if (!existsSync(serverModule)) { serverModule = context.asAbsolutePath(path.join('..', 'target', 'debug', 'sixtyfps-lsp')); - + } if (!existsSync(serverModule)) { console.warn("Could not locate sixtyfps-server server binary, neither in bundled bin/ directory nor relative in ../target"); return;