❔ Inlay hints in omnisharp and neovim

Anyone know how could I make use of inlay hints when coding with omnisharp? In this screenshot I have a hello world omnisharp file on the left and on the right a deno typescript file. Inlay hints work as expected in deno, but they don't show up at all in C#. Anyone know what gives? Here's my neovim relevant config snippet
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
require("lsp-inlayhints").setup()
require("lsp-inlayhints").on_attach(client, bufnr)
end
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
vim.api.nvim_create_autocmd("LspAttach", {
group = "LspAttach_inlayhints";
callback = function(args)
if not (args.data and args.data.client_id) then return end

local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
require("lsp-inlayhints").on_attach(client, bufnr)
end;
})
require("lspconfig").omnisharp.setup({
cmd = { "omnisharp" };
handlers = {
["textDocument/definition"] = require("omnisharp_extended").handler;
};
on_attach = on_attach;
enable_editorconfig_support = true;
enable_ms_build_load_projects_on_demand = false;
enable_roslyn_analyzers = true;
organize_imports_on_format = true;
enable_import_completion = true;
sdk_include_prereleases = true;
analyze_open_documents_only = false;
})
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
require("lsp-inlayhints").setup()
require("lsp-inlayhints").on_attach(client, bufnr)
end
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
vim.api.nvim_create_autocmd("LspAttach", {
group = "LspAttach_inlayhints";
callback = function(args)
if not (args.data and args.data.client_id) then return end

local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
require("lsp-inlayhints").on_attach(client, bufnr)
end;
})
require("lspconfig").omnisharp.setup({
cmd = { "omnisharp" };
handlers = {
["textDocument/definition"] = require("omnisharp_extended").handler;
};
on_attach = on_attach;
enable_editorconfig_support = true;
enable_ms_build_load_projects_on_demand = false;
enable_roslyn_analyzers = true;
organize_imports_on_format = true;
enable_import_completion = true;
sdk_include_prereleases = true;
analyze_open_documents_only = false;
})
2 Replies
WhiteBlackGoose
is O# loaded? :OmniSharpReloadProject
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server