diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 7e13ee15364e..a6233605f7c9 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -46,4 +46,5 @@ mapAliases { manta = pkgs.node-manta; # Added 2023-05-06 thelounge = pkgs.thelounge; # Added 2023-05-22 triton = pkgs.triton; # Added 2023-05-06 + vscode-langservers-extracted = pkgs.vscode-langservers-extracted; # Added 2023-05-27 } diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 635677feb6a1..1e08e599aba1 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -380,7 +380,6 @@ , "vscode-html-languageserver-bin" , "vscode-json-languageserver" , "vscode-json-languageserver-bin" -, "vscode-langservers-extracted" , "vue-cli" , "vue-language-server" , "wavedrom-cli" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index a4110da48ed1..74e750192f56 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -144915,56 +144915,6 @@ in bypassCache = true; reconstructLock = true; }; - vscode-langservers-extracted = nodeEnv.buildNodePackage { - name = "vscode-langservers-extracted"; - packageName = "vscode-langservers-extracted"; - version = "4.7.0"; - src = fetchurl { - url = "https://registry.npmjs.org/vscode-langservers-extracted/-/vscode-langservers-extracted-4.7.0.tgz"; - sha512 = "OZWgreyvCKdKV4TfBGXrxiJVaT041SkoE3TzQUCS/EnK55zMGM1fq1HoXtFLMvqatEuVYSPF2lywrAj2Ac0maQ=="; - }; - dependencies = [ - sources."@vscode/l10n-0.0.13" - sources."core-js-3.31.0" - sources."jsonc-parser-3.2.0" - sources."picomatch-2.3.1" - sources."regenerator-runtime-0.13.11" - sources."request-light-0.7.0" - sources."typescript-4.9.5" - (sources."vscode-css-languageservice-6.2.6" // { - dependencies = [ - sources."@vscode/l10n-0.0.14" - ]; - }) - (sources."vscode-html-languageservice-5.0.6" // { - dependencies = [ - sources."@vscode/l10n-0.0.14" - ]; - }) - sources."vscode-json-languageservice-5.3.5" - sources."vscode-jsonrpc-8.1.0" - sources."vscode-languageserver-8.1.0" - sources."vscode-languageserver-protocol-3.17.3" - sources."vscode-languageserver-textdocument-1.0.10" - sources."vscode-languageserver-types-3.17.3" - (sources."vscode-markdown-languageservice-0.3.0" // { - dependencies = [ - sources."@vscode/l10n-0.0.10" - ]; - }) - sources."vscode-nls-5.2.0" - sources."vscode-uri-3.0.7" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "HTML/CSS/JSON/ESLint language servers extracted from [vscode](https://github.com/Microsoft/vscode)."; - homepage = "https://github.com/hrsh7th/vscode-langservers-extracted#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; vue-cli = nodeEnv.buildNodePackage { name = "vue-cli"; packageName = "vue-cli"; diff --git a/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix b/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix new file mode 100644 index 000000000000..fdaa503c77af --- /dev/null +++ b/pkgs/development/tools/language-servers/vscode-langservers-extracted/default.nix @@ -0,0 +1,38 @@ +{ lib, buildNpmPackage, fetchFromGitHub, vscode }: + +buildNpmPackage rec { + pname = "vscode-langservers-extracted"; + version = "4.7.0"; + + src = fetchFromGitHub { + owner = "hrsh7th"; + repo = pname; + rev = "v${version}"; + hash = "sha256-RLRDEHfEJ2ckn0HTMu0WbMK/o9W20Xwm+XI6kCq57u8="; + }; + + npmDepsHash = "sha256-QhiSj/DigsI4Bfwmk3wG4lDQOWuDDduc/sfJlXiEoGE="; + + postPatch = '' + # TODO: Add vscode-eslint as a dependency + # Eliminate the vscode-eslint bin + sed -i '/^\s*"vscode-eslint-language-server":.*bin\//d' package.json package-lock.json + ''; + + buildPhase = let + extensions = "${vscode}/lib/vscode/resources/app/extensions"; + in '' + npx babel ${extensions}/css-language-features/server/dist/* --out-dir lib/css-language-server/node/ + npx babel ${extensions}/html-language-features/server/dist/* --out-dir lib/html-language-server/node/ + npx babel ${extensions}/json-language-features/server/dist/* --out-dir lib/json-language-server/node/ + npx babel ${extensions}/markdown-language-features/server/dist/* --out-dir lib/markdown-language-server/node/ + mv lib/markdown-language-server/node/workerMain.js lib/markdown-language-server/node/main.js + ''; + + meta = with lib; { + description = "HTML/CSS/JSON/ESLint language servers extracted from vscode."; + homepage = "https://github.com/hrsh7th/vscode-langservers-extracted"; + license = licenses.mit; + maintainers = with maintainers; [ lord-valen ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e26435ed865e..a2b5ea8f4bae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17782,6 +17782,8 @@ with pkgs; verible = callPackage ../development/tools/language-servers/verible { }; + vscode-langservers-extracted = callPackage ../development/tools/language-servers/vscode-langservers-extracted { }; + zls = callPackage ../development/tools/language-servers/zls { zig = buildPackages.zig_0_10; };