1+ -- NOTE: Functions converted to immediate values for Neovim 0.10+ compatibility
2+ -- vim.lsp.config() cannot serialize functions
3+ local omnisharp_path = vim .fn .glob (vim .fn .stdpath (' data' ) .. ' /mason/' ) .. ' packages/omnisharp/libexec/OmniSharp.dll'
4+
5+ local handlers
6+ local status , handler = pcall (require , ' omnisharp_extended' )
7+ if status then
8+ handlers = {
9+ [' textDocument/definition' ] = handler .definition_handler ,
10+ [' textDocument/typeDefinition' ] = handler .type_definition_handler ,
11+ [' textDocument/references' ] = handler .references_handler ,
12+ [' textDocument/implementation' ] = handler .implementation_handler ,
13+ }
14+ end
15+
116return {
2- cmd = function ()
3- local omnisharp_path = vim .fn .glob (vim .fn .stdpath (' data' ) .. ' /mason/' ) .. ' packages/omnisharp/libexec/OmniSharp.dll'
4- return { ' dotnet' , omnisharp_path }
5- end ,
17+ cmd = { ' dotnet' , omnisharp_path },
618 filetypes = { ' cs' , ' vb' },
719 init_options = {},
820 settings = {
@@ -23,16 +35,5 @@ return {
2335 IncludePrereleases = true ,
2436 },
2537 },
26- handlers = function ()
27- local status , handler = pcall (require , ' omnisharp_extended' )
28- if status then
29- return {
30- [' textDocument/definition' ] = handler .definition_handler ,
31- [' textDocument/typeDefinition' ] = handler .type_definition_handler ,
32- [' textDocument/references' ] = handler .references_handler ,
33- [' textDocument/implementation' ] = handler .implementation_handler ,
34- }
35- end
36- return {}
37- end ,
38+ handlers = handlers ,
3839}
0 commit comments