mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 01:38:40 +02:00
plugins/rustaceanvim: switch to mkNeovimPlugin
This commit is contained in:
parent
c490fbe5d9
commit
5b09c711e2
6 changed files with 590 additions and 440 deletions
|
@ -7,150 +7,143 @@
|
|||
plugins.rustaceanvim = {
|
||||
enable = true;
|
||||
|
||||
tools = {
|
||||
executor = "termopen";
|
||||
onInitialized = null;
|
||||
reloadWorkspaceFromCargoToml = true;
|
||||
hoverActions = {
|
||||
replaceBuiltinHover = true;
|
||||
settings = {
|
||||
|
||||
tools = {
|
||||
executor = "termopen";
|
||||
test_executor = "background";
|
||||
crate_test_executor = "background";
|
||||
cargo_override = null;
|
||||
enable_nextest = true;
|
||||
enable_clippy = true;
|
||||
on_initialized = null;
|
||||
reload_workspace_from_cargo_toml = true;
|
||||
hover_actions = {
|
||||
replace_builtin_hover = true;
|
||||
};
|
||||
code_actions = {
|
||||
group_icon = " ▶";
|
||||
ui_select_fallback = false;
|
||||
};
|
||||
float_win_config = {
|
||||
auto_focus = false;
|
||||
open_split = "horizontal";
|
||||
};
|
||||
crate_graph = {
|
||||
backend = "x11";
|
||||
output = null;
|
||||
full = true;
|
||||
enabled_graphviz_backends = [
|
||||
"bmp"
|
||||
"cgimage"
|
||||
"canon"
|
||||
"dot"
|
||||
"gv"
|
||||
"xdot"
|
||||
"xdot1.2"
|
||||
"xdot1.4"
|
||||
"eps"
|
||||
"exr"
|
||||
"fig"
|
||||
"gd"
|
||||
"gd2"
|
||||
"gif"
|
||||
"gtk"
|
||||
"ico"
|
||||
"cmap"
|
||||
"ismap"
|
||||
"imap"
|
||||
"cmapx"
|
||||
"imap_np"
|
||||
"cmapx_np"
|
||||
"jpg"
|
||||
"jpeg"
|
||||
"jpe"
|
||||
"jp2"
|
||||
"json"
|
||||
"json0"
|
||||
"dot_json"
|
||||
"xdot_json"
|
||||
"pdf"
|
||||
"pic"
|
||||
"pct"
|
||||
"pict"
|
||||
"plain"
|
||||
"plain-ext"
|
||||
"png"
|
||||
"pov"
|
||||
"ps"
|
||||
"ps2"
|
||||
"psd"
|
||||
"sgi"
|
||||
"svg"
|
||||
"svgz"
|
||||
"tga"
|
||||
"tiff"
|
||||
"tif"
|
||||
"tk"
|
||||
"vml"
|
||||
"vmlz"
|
||||
"wbmp"
|
||||
"webp"
|
||||
"xlib"
|
||||
"x11"
|
||||
];
|
||||
pipe = null;
|
||||
};
|
||||
open_url = "require('rustaceanvim.os').open_url";
|
||||
};
|
||||
floatWinConfig = {
|
||||
border = [
|
||||
[
|
||||
"╭"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"─"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"╮"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"│"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"╯"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"─"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"╰"
|
||||
"FloatBorder"
|
||||
]
|
||||
[
|
||||
"│"
|
||||
"FloatBorder"
|
||||
]
|
||||
];
|
||||
max_width = null;
|
||||
max_height = null;
|
||||
auto_focus = false;
|
||||
server = {
|
||||
auto_attach = ''
|
||||
function(bufnr)
|
||||
if #vim.bo[bufnr].buftype > 0 then
|
||||
return false
|
||||
end
|
||||
local path = vim.api.nvim_buf_get_name(bufnr)
|
||||
if not os.is_valid_file_path(path) then
|
||||
return false
|
||||
end
|
||||
local cmd = types.evaluate(RustaceanConfig.server.cmd)
|
||||
---@cast cmd string[]
|
||||
local rs_bin = cmd[1]
|
||||
return vim.fn.executable(rs_bin) == 1
|
||||
end
|
||||
'';
|
||||
on_attach = null;
|
||||
cmd = ''
|
||||
function()
|
||||
return { 'rust-analyzer', '--log-file', RustaceanConfig.server.logfile }
|
||||
end
|
||||
'';
|
||||
settings = ''
|
||||
function(project_root, default_settings)
|
||||
return require('rustaceanvim.config.server').load_rust_analyzer_settings(project_root, { default_settings = default_settings })
|
||||
end
|
||||
'';
|
||||
standalone = true;
|
||||
logfile.__raw = "vim.fn.tempname() .. '-rust-analyzer.log'";
|
||||
load_vscode_settings = false;
|
||||
};
|
||||
crateGraph = {
|
||||
backend = "x11";
|
||||
output = null;
|
||||
full = true;
|
||||
enabledGraphvizBackends = [
|
||||
"bmp"
|
||||
"cgimage"
|
||||
"canon"
|
||||
"dot"
|
||||
"gv"
|
||||
"xdot"
|
||||
"xdot1.2"
|
||||
"xdot1.4"
|
||||
"eps"
|
||||
"exr"
|
||||
"fig"
|
||||
"gd"
|
||||
"gd2"
|
||||
"gif"
|
||||
"gtk"
|
||||
"ico"
|
||||
"cmap"
|
||||
"ismap"
|
||||
"imap"
|
||||
"cmapx"
|
||||
"imap_np"
|
||||
"cmapx_np"
|
||||
"jpg"
|
||||
"jpeg"
|
||||
"jpe"
|
||||
"jp2"
|
||||
"json"
|
||||
"json0"
|
||||
"dot_json"
|
||||
"xdot_json"
|
||||
"pdf"
|
||||
"pic"
|
||||
"pct"
|
||||
"pict"
|
||||
"plain"
|
||||
"plain-ext"
|
||||
"png"
|
||||
"pov"
|
||||
"ps"
|
||||
"ps2"
|
||||
"psd"
|
||||
"sgi"
|
||||
"svg"
|
||||
"svgz"
|
||||
"tga"
|
||||
"tiff"
|
||||
"tif"
|
||||
"tk"
|
||||
"vml"
|
||||
"vmlz"
|
||||
"wbmp"
|
||||
"webp"
|
||||
"xlib"
|
||||
"x11"
|
||||
];
|
||||
pipe = null;
|
||||
dap = {
|
||||
autoload_configurations = true;
|
||||
adapter = null;
|
||||
};
|
||||
openUrl = "require('rustaceanvim.os').open_url";
|
||||
};
|
||||
server = {
|
||||
autoAttach = ''
|
||||
function()
|
||||
local cmd = types.evaluate(RustaceanConfig.server.cmd)
|
||||
---@cast cmd string[]
|
||||
local rs_bin = cmd[1]
|
||||
return vim.fn.executable(rs_bin) == 1
|
||||
end
|
||||
'';
|
||||
cmd = ''
|
||||
function()
|
||||
return { 'rust-analyzer', '--log-file', RustaceanConfig.server.logfile }
|
||||
end
|
||||
'';
|
||||
settings = ''
|
||||
function(project_root)
|
||||
return require('rustaceanvim.config.server').load_rust_analyzer_settings(project_root)
|
||||
end
|
||||
'';
|
||||
standalone = true;
|
||||
logfile.__raw = "vim.fn.tempname() .. '-rust-analyzer.log'";
|
||||
};
|
||||
dap = {
|
||||
autoloadConfigurations = true;
|
||||
adapter = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
with-lspconfig = {
|
||||
plugins = {
|
||||
lsp.enable = true;
|
||||
rustaceanvim.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
rust-analyzer-settings = {
|
||||
plugins.rustaceanvim = {
|
||||
enable = true;
|
||||
|
||||
server.settings = {
|
||||
settings.server.settings = {
|
||||
linkedProjects = [ "foo/bar/hello" ];
|
||||
numThreads = 42;
|
||||
joinLines.joinElseIf = true;
|
||||
|
@ -163,7 +156,7 @@
|
|||
plugins.rustaceanvim = {
|
||||
enable = true;
|
||||
|
||||
dap.adapter = {
|
||||
settings.dap.adapter = {
|
||||
type = "executable";
|
||||
name = "lldb";
|
||||
command = "lldb-vscode";
|
||||
|
@ -176,7 +169,7 @@
|
|||
plugins.rustaceanvim = {
|
||||
enable = true;
|
||||
|
||||
dap.adapter = {
|
||||
settings.dap.adapter = {
|
||||
type = "server";
|
||||
name = "my-dap-server";
|
||||
host = "127.0.0.1";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue