]> git.lizzy.rs Git - rust.git/commitdiff
Don't update the server if managed by the user
authorLaurențiu Nicola <lnicola@dend.ro>
Thu, 7 Jan 2021 14:33:00 +0000 (16:33 +0200)
committerLaurențiu Nicola <lnicola@dend.ro>
Thu, 7 Jan 2021 14:37:08 +0000 (16:37 +0200)
editors/code/src/main.ts

index 4c132cabeeff7ba4b3059db796acdfdb28003c56..694da9409d01a9ac89778d5646634563cebbcbb7 100644 (file)
@@ -167,6 +167,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
         }
         return;
     };
+    if (serverPath(config) !== null) return;
 
     const now = Date.now();
     if (config.package.releaseTag === NIGHTLY_TAG) {
@@ -278,7 +279,7 @@ async function patchelf(dest: PathLike): Promise<void> {
 }
 
 async function getServer(config: Config, state: PersistentState): Promise<string | undefined> {
-    const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
+    const explicitPath = serverPath(config);
     if (explicitPath) {
         if (explicitPath.startsWith("~/")) {
             return os.homedir() + explicitPath.slice("~".length);
@@ -351,6 +352,10 @@ async function getServer(config: Config, state: PersistentState): Promise<string
     return dest;
 }
 
+function serverPath(config: Config): string | null {
+    return process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath;
+}
+
 async function isNixOs(): Promise<boolean> {
     try {
         const contents = await fs.readFile("/etc/os-release");