Skip to content

Commit

Permalink
neovim: fix omnisharp jump to definition for assembly/decompilation l…
Browse files Browse the repository at this point in the history
…oading
  • Loading branch information
contrun committed Dec 8, 2023
1 parent 92c4037 commit b394c43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions dot_config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ return require('packer').startup({
use {"williamboman/mason.nvim"}
use {"williamboman/mason-lspconfig.nvim"}

use {"Hoffs/omnisharp-extended-lsp.nvim"}
use {
'ionide/Ionide-vim',
config = function()
Expand Down
21 changes: 16 additions & 5 deletions dot_config/nvim/lua/plugins/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,23 @@ local setup_servers = function()
return options
end,
["omnisharp"] = function(options)
local pid = vim.fn.getpid()
local omnisharp_bin = "omnisharp"
options.cmd = {
omnisharp_bin, "--languageserver", "--hostPID",
tostring(pid)
options.handlers = {
["textDocument/definition"] = require('omnisharp_extended').handler
}
local omnisharp_bin
for _, bin in ipairs({"omnisharp", "OmniSharp"}) do
if vim.fn.executable(bin) == 1 then
omnisharp_bin = bin
break
end
end
if omnisharp_bin then
local pid = vim.fn.getpid()
options.cmd = {
omnisharp_bin, "--languageserver", "--hostPID",
tostring(pid)
}
end
return options
end
}
Expand Down

0 comments on commit b394c43

Please sign in to comment.