-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroslyn.lua
More file actions
67 lines (63 loc) · 2.17 KB
/
roslyn.lua
File metadata and controls
67 lines (63 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
return {
{
"seblyng/roslyn.nvim",
-- ft = { "cs", "razor" },
dependencies = {
"neovim/nvim-lspconfig",
{
-- By loading as a dependencies, we ensure that we are available to set
-- the handlers for Roslyn.
"tris203/rzls.nvim",
config = true,
},
},
config = function()
local mason_registry = require("mason-registry")
local rzls_path = vim.fn.expand("$MASON/packages/rzls/libexec")
local cmd = {
"roslyn",
"--stdio",
"--logLevel=Information",
"--extensionLogDirectory=" .. vim.fs.dirname(vim.lsp.get_log_path()),
"--razorSourceGenerator=" .. vim.fs.joinpath(rzls_path, "Microsoft.CodeAnalysis.Razor.Compiler.dll"),
"--razorDesignTimePath="
.. vim.fs.joinpath(rzls_path, "Targets", "Microsoft.NET.Sdk.Razor.DesignTime.targets"),
"--extension",
vim.fs.joinpath(rzls_path, "RazorExtension", "Microsoft.VisualStudioCode.RazorExtension.dll"),
}
vim.lsp.config("roslyn", {
cmd = cmd,
handlers = require("rzls.roslyn_handlers"),
settings = {
["csharp|inlay_hints"] = {
csharp_enable_inlay_hints_for_implicit_object_creation = true,
csharp_enable_inlay_hints_for_implicit_variable_types = false,
csharp_enable_inlay_hints_for_lambda_parameter_types = true,
csharp_enable_inlay_hints_for_types = false,
dotnet_enable_inlay_hints_for_indexer_parameters = true,
dotnet_enable_inlay_hints_for_literal_parameters = true,
dotnet_enable_inlay_hints_for_object_creation_parameters = true,
dotnet_enable_inlay_hints_for_other_parameters = true,
dotnet_enable_inlay_hints_for_parameters = false,
dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix = true,
dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name = true,
dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent = true,
},
["csharp|code_lens"] = {
dotnet_enable_references_code_lens = true,
},
},
})
vim.lsp.enable("roslyn")
end,
init = function()
-- We add the Razor file types before the plugin loads.
vim.filetype.add({
extension = {
razor = "razor",
cshtml = "razor",
},
})
end,
},
}