lsp/presets/fsautocomplete: init

This commit is contained in:
Snoweuph 2026-04-12 14:54:47 +02:00
commit 3aa1b7a9d6
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 55 additions and 0 deletions

View file

@ -7,6 +7,7 @@
./bash-language-server.nix
./deno.nix
./emmet-ls.nix
./fsautocomplete.nix
./gleam.nix
./glsl_analyzer.nix
./gopls.nix

View file

@ -0,0 +1,54 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.generators) mkLuaInline;
cfg = config.vim.lsp.presets.fsautocomplete;
in {
options.vim.lsp.presets.fsautocomplete = {
enable = mkEnableOption "the F# Autocomplete Language Server";
};
config = mkIf cfg.enable {
vim.lsp.servers.fsautocomplete = {
enable = true;
cmd = [(getExe pkgs.fsautocomplete) "--adaptive-lsp-server-enabled"];
root_dir = mkLuaInline ''
function(bufnr, on_dir)
on_dir(vim.fs.root(bufnr, function(name, path)
return name == ".git" or name:match("%.sln$") or name:match("%.fsproj$")
end))
end
'';
init_options = {
AutomaticWorkspaceInit = true;
};
settings = {
FSharp = {
keywordsAutocomplete = true;
ExternalAutocomplete = false;
Linter = true;
UnionCaseStubGeneration = true;
UnionCaseStubGenerationBody = ''failwith "Not Implemented"'';
RecordStubGeneration = true;
RecordStubGenerationBody = ''failwith "Not Implemented"'';
InterfaceStubGeneration = true;
InterfaceStubGenerationObjectIdentifier = "this";
InterfaceStubGenerationMethodBody = ''failwith "Not Implemented"'';
UnusedOpensAnalyzer = true;
UnusedDeclarationsAnalyzer = true;
UseSdkScripts = true;
SimplifyNameAnalyzer = true;
ResolveNamespaces = true;
EnableReferenceCodeLens = true;
};
};
};
};
}