typescript-language-server: fix requires typescript

typescript-language-server had an override that used lndir to
provide the typescript dependency. When typescript-language-server
was moved, this was not included.
This commit is contained in:
BirdeeHub 2024-07-21 22:04:35 -07:00
parent 14282b939f
commit 623403fdd5
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,15 @@
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) {

View File

@ -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=";