lsp: use nvim-metals instead of lsp-config for scala
This commit is contained in:
parent
4ca81595ba
commit
97de7e0020
3 changed files with 57 additions and 4 deletions
40
config/lsp/nvim-metals.nix
Normal file
40
config/lsp/nvim-metals.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ pkgs, helpers, ... }:
|
||||
|
||||
{
|
||||
extraPlugins = [
|
||||
pkgs.vimPlugins.nvim-metals
|
||||
pkgs.vimPlugins.plenary-nvim
|
||||
];
|
||||
|
||||
extraPackages = [
|
||||
pkgs.metals
|
||||
];
|
||||
|
||||
autoGroups.nvim_metals_group = {
|
||||
clear = true;
|
||||
};
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
event = "FileType";
|
||||
group = "nvim_metals_group";
|
||||
desc = "Initialize nvim-metals";
|
||||
callback = helpers.mkRaw ''
|
||||
function()
|
||||
metals_config = require("metals").bare_config()
|
||||
metals_config.init_options.statusBarProvider = "off"
|
||||
metals_config.settings = {
|
||||
showInferredType = true,
|
||||
showImplicitArguments = false,
|
||||
showImplicitConversionsAndClasses = false,
|
||||
metalsBinaryPath = "${pkgs.lib.getExe pkgs.metals}",
|
||||
useGlobalExecutable = true
|
||||
}
|
||||
require("metals").initialize_or_attach(metals_config)
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
plugins.fidget.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue