claude-code: add lsp servers support
This commit is contained in:
parent
f0e123a7e2
commit
a455ac1bb3
5 changed files with 86 additions and 3 deletions
|
|
@ -47,7 +47,7 @@
|
|||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"`programs.claude-code.package` cannot be null when `mcpServers` or `enableMcpIntegration` is configured"
|
||||
"`programs.claude-code.package` cannot be null when `mcpServers`, `lspServers`, or `enableMcpIntegration` is configured"
|
||||
"Cannot specify both `programs.claude-code.memory.text` and `programs.claude-code.memory.source`"
|
||||
"Cannot specify both `programs.claude-code.agents` and `programs.claude-code.agentsDir`"
|
||||
"Cannot specify both `programs.claude-code.commands` and `programs.claude-code.commandsDir`"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
claude-code-basic = ./basic.nix;
|
||||
claude-code-full-config = ./full-config.nix;
|
||||
claude-code-lsp = ./lsp.nix;
|
||||
claude-code-mcp = ./mcp.nix;
|
||||
claude-code-mcp-integration = ./mcp-integration.nix;
|
||||
claude-code-assertion = ./assertion.nix;
|
||||
|
|
|
|||
2
tests/modules/programs/claude-code/expected-lsp-wrapper
Normal file
2
tests/modules/programs/claude-code/expected-lsp-wrapper
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#! /nix/store/00000000000000000000000000000000-bash/bin/bash -e
|
||||
exec -a "$0" "/nix/store/00000000000000000000000000000000-claude-code/bin/.claude-wrapped" "$@" --plugin-dir /nix/store/00000000000000000000000000000000-claude-code-lsp-plugin
|
||||
38
tests/modules/programs/claude-code/lsp.nix
Normal file
38
tests/modules/programs/claude-code/lsp.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.claude-code = {
|
||||
package = config.lib.test.mkStubPackage {
|
||||
name = "claude-code";
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
touch $out/bin/claude
|
||||
chmod 755 $out/bin/claude
|
||||
'';
|
||||
};
|
||||
enable = true;
|
||||
|
||||
lspServers = {
|
||||
go = {
|
||||
command = "gopls";
|
||||
args = [ "serve" ];
|
||||
extensionToLanguage = {
|
||||
".go" = "go";
|
||||
};
|
||||
};
|
||||
typescript = {
|
||||
command = "typescript-language-server";
|
||||
args = [ "--stdio" ];
|
||||
extensionToLanguage = {
|
||||
".ts" = "typescript";
|
||||
".tsx" = "typescriptreact";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
normalizedWrapper=$(normalizeStorePaths home-path/bin/claude)
|
||||
assertFileContent $normalizedWrapper ${./expected-lsp-wrapper}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue