vimPlugins.copilot-lua: fix packaged language server

Version 3.1.5 selects the server through server.custom_server_filepath. Set that default to the packaged executable instead of rewriting the old bundled JavaScript path.
This commit is contained in:
Austin Horstman
2026-09-10 05:29:19 -05:00
parent 19de6ba60c
commit 12c73a6e4a

View File

@@ -1027,18 +1027,11 @@ assertNoAdditions {
};
copilot-lua = super.copilot-lua.overrideAttrs {
# Avoid copying the bundled 500MB language server into the plugin output.
preInstall = ''
rm -rf copilot/js
'';
postInstall = ''
mkdir -p $target/copilot
ln -s ${copilot-language-server}/share/copilot-language-server $target/copilot/js
substituteInPlace $target/lua/copilot/lsp/nodejs.lua \
--replace-fail "copilot/js/language-server.js" "copilot/js/main.js"
sed -i 's/version = "[^"]*"/version = "${copilot-language-server.version}"/' $target/lua/copilot/util.lua
# Use the packaged language server instead of the runtime installer.
postPatch = ''
substituteInPlace lua/copilot/config/server.lua \
--replace-fail 'custom_server_filepath = nil,' \
'custom_server_filepath = "${lib.getExe copilot-language-server}",'
'';
runtimeDeps = [