Unverified Commit dbb6ecc6 authored by Artturin's avatar Artturin Committed by GitHub
Browse files

Merge pull request #329074 from BirdeeHub/fixtsserver

typescript-language-server: fix requires typescript
parents 8be9f941 623403fd
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
diff --git a/src/lsp-server.ts b/src/lsp-server.ts
index ef5907d..9494430 100644
--- a/src/lsp-server.ts
+++ b/src/lsp-server.ts
@@ -323,6 +323,10 @@ export class LspServer {
             }
         }

+        if (!fallbackTsserverPath) {
+            fallbackTsserverPath = "@typescript@";
+        }
+
         const fallbackVersionProvider = new TypeScriptVersionProvider(fallbackTsserverPath, this.logger);
         const fallbackSettingVersion = fallbackVersionProvider.getUserSettingVersion();
         if (fallbackSettingVersion) {
+9 −0
Original line number Diff line number Diff line
@@ -6,8 +6,10 @@
, makeWrapper
, nodejs
, prefetch-yarn-deps
, substituteAll
, yarn
, testers
, typescript
}:

stdenv.mkDerivation (finalAttrs: {
@@ -21,6 +23,13 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-FCv0+tA7AuCdGeG6FEiMyRAHcl0WbezhNYLL7xp5FWU=";
  };

  patches = [
    (substituteAll {
      src = ./default-fallbackTsserverPath.diff;
      typescript = "${typescript}/lib/node_modules/typescript/lib/tsserver.js";
    })
  ];

  offlineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-nSMhPfbWD93sGIKehBBE/bh4RzHXFtGAjeyG20m/LWQ=";