diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index e866c25e29d0..bb71c78f19ac 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -2375,6 +2375,8 @@ let }; }; + sumneko.lua = callPackage ./lua { }; + svelte.svelte-vscode = buildVscodeMarketplaceExtension { mktplcRef = { name = "svelte-vscode"; diff --git a/pkgs/applications/editors/vscode/extensions/lua/default.nix b/pkgs/applications/editors/vscode/extensions/lua/default.nix new file mode 100644 index 000000000000..529428de6702 --- /dev/null +++ b/pkgs/applications/editors/vscode/extensions/lua/default.nix @@ -0,0 +1,27 @@ +{ lib +, vscode-utils +, sumneko-lua-language-server +}: + +vscode-utils.buildVscodeMarketplaceExtension { + mktplcRef = { + name = "lua"; + publisher = "sumneko"; + version = "3.5.6"; + sha256 = "sha256-Unzs9rX/0MlQprSvScdBCCFMeLCaGzWsMbcFqSKY2XY="; + }; + + patches = [ ./remove-chmod.patch ]; + + postInstall = '' + ln -sf ${sumneko-lua-language-server}/bin/lua-language-server \ + $out/$installPrefix/server/bin/lua-language-server + ''; + + meta = with lib; { + description = "The Lua language server provides various language features for Lua to make development easier and faster."; + homepage = "https://marketplace.visualstudio.com/items?itemName=sumneko.lua"; + license = licenses.mit; + maintainers = with maintainers; [ lblasc ]; + }; +} diff --git a/pkgs/applications/editors/vscode/extensions/lua/remove-chmod.patch b/pkgs/applications/editors/vscode/extensions/lua/remove-chmod.patch new file mode 100644 index 000000000000..8b9028625aa8 --- /dev/null +++ b/pkgs/applications/editors/vscode/extensions/lua/remove-chmod.patch @@ -0,0 +1,16 @@ +diff --git a/client/out/languageserver.js b/client/out/languageserver.js +index 6c7429c..6f53aa4 100644 +--- a/client/out/languageserver.js ++++ b/client/out/languageserver.js +@@ -79,11 +79,9 @@ class LuaClient { + break; + case "linux": + command = this.context.asAbsolutePath(path.join('server', binDir ? binDir : 'bin-Linux', 'lua-language-server')); +- yield fs.promises.chmod(command, '777'); + break; + case "darwin": + command = this.context.asAbsolutePath(path.join('server', binDir ? binDir : 'bin-macOS', 'lua-language-server')); +- yield fs.promises.chmod(command, '777'); + break; + } + let serverOptions = {