Skip to content

Commit

Permalink
lsp: upgrade smithy server to 0.0.28 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe authored Oct 2, 2023
1 parent a8c1853 commit e006b51
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;

neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};

# nix lsp support
nixd.url = github:nix-community/nixd;
Expand Down Expand Up @@ -330,9 +332,7 @@
"neovim-nightly-flake"
"nmd"
"nixd"
"ts-build"
"tree-sitter-scala"
"tree-sitter-typescript"
];
in
builtins.attrNames (f nonPluginInputNames inputs);
Expand Down
21 changes: 0 additions & 21 deletions lib/buildPlugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,6 @@ let
EOL
'';

# without adding `list.smithy`, highlights are ignored
smithyParserHook = ''
substituteInPlace $out/lua/nvim-treesitter/parsers.lua \
--replace 'list.agda = {' '
list.smithy = {
install_info = {
url = "https://github.com/indoorvivants/tree-sitter-smithy",
branch = "main",
files = { "src/parser.c" },
generate_requires_npm = true,
},
filetype = "smithy",
maintainers = { "@gvolpe" },
}
list.agda = {
'
'';

# sync queries of tree-sitter-scala and nvim-treesitter
queriesHook = ''
cp ${inputs.tree-sitter-scala}/queries/scala/* $out/queries/scala/
Expand All @@ -78,8 +59,6 @@ let

tsPreFixupHook = ''
${queriesHook}
${smithyParserHook}
'';

tsPostPatchHook = ''
Expand Down
15 changes: 13 additions & 2 deletions modules/lsp/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ in
};
version = mkOption {
type = types.str;
default = "0.0.20";
default = "0.0.28";
description = "The Smithy LSP server dependency version";
};
class = mkOption {
type = types.str;
default = "software.amazon.smithy.lsp.Main";
description = "The Smithy LSP server main class";
};
};
};

Expand Down Expand Up @@ -433,7 +438,13 @@ in
on_attach = function(client, bufnr)
attach_keymaps(client, bufnr)
end,
cmd = { '${cfg.smithy.launcher}/bin/cs', 'launch', '${cfg.smithy.server.name}:${cfg.smithy.server.version}', '--' , '0' },
cmd = {
'${cfg.smithy.launcher}/bin/cs', 'launch',
'${cfg.smithy.server.name}:${cfg.smithy.server.version}',
'--ttl', '1h',
'--main-class', '${cfg.smithy.server.class}',
'--', '0'
},
root_dir = lspconfig.util.root_pattern("smithy-build.json")
}
''}
Expand Down

0 comments on commit e006b51

Please sign in to comment.