iabdelkareem / csharp.nvim

Neovim plugin written in Lua, powered by omnisharp-roslyn, that aims to enhance the development experience for .NET developers.
MIT License
228 stars 13 forks source link

Error with starting the debugger, weird nil value being sent to log #16

Open Sofistico opened 1 month ago

Sofistico commented 1 month ago

I know there isn't enough information, i can't seem to reproduce what could possible be the problem... If you need any information, don't hesitate to ask!

E5108: Error executing lua: ...Data/Local/nvim-data/lazy/csharp.nvim/lua/csharp/log.lua:39: attempt to index a nil value stack traceback: ...Data/Local/nvim-data/lazy/csharp.nvim/lua/csharp/log.lua:39: in function 'log' ...Data/Local/nvim-data/lazy/csharp.nvim/lua/csharp/log.lua:75: in function 'error' ...ta/Local/nvim-data/lazy/csharp.nvim/lua/csharp/utils.lua:46: in function 'run_async' ...a/lazy/csharp.nvim/lua/csharp/features/debugger/init.lua:75: in function <...a/lazy/csharp.nvim/lua/csharp/features/debugger/init.lua:74>

Sofistico commented 1 month ago

When i put my config on lazyvim as this: { 'iabdelkareem/csharp.nvim', dependencies = { 'williamboman/mason.nvim', -- Required, automatically installs omnisharp 'mfussenegger/nvim-dap', 'Tastyep/structlog.nvim', -- Optional, but highly recommended for debugging }, event = 'BufEnter *.cs', --opts = { --lsp = { enable = false }, --}, }, The error occurs, but when i uncomment the opts it works

iabdelkareem commented 1 month ago

The current implementation of the debugger relies on Omnisharp LSP. When you set lsp = {enable = false} the plugin doesn't attempt to automatically install and run Omnisharp but if you have it running in any other way the plugin should be able to use it without problem but if you use another language server (e.g., csharp-ls or roslyn) the debugger won't work.

Sofistico commented 4 weeks ago

The weird thing is, that when the Omnisharp is already configured and i use the default values for this puglin, this error occurs

Though when i configure the plugin to set lsp = {enable = false} the error doesn't happen.