OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.7k stars 169 forks source link

Omnisharp-vim debug project failed #794

Closed huyHA9597 closed 2 years ago

huyHA9597 commented 2 years ago

Details

I created a new console app and create vimspector.json file using :OmnisharpCreateDebugConfig. Then try to debug project using command :OmniSharpDebugProject and the error happened. But when I using Vimspector command :VimspectorLaunch, it's ok.

Screen Shot 2022-07-09 at 07 16 53

Configuration

Neovim version

nvim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.7.2/share/nvim"

Run :checkhealth for more info

OS Version

MacOS Monterrey 12.4 - M1 Arm 64

.NET Version and SDK

dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.301
 Commit:    43f9b18481

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.4
 OS Platform: Darwin
 RID:         osx.12-x64
 Base Path:   /usr/local/share/dotnet/x64/sdk/6.0.301/

Host (useful for support):
  Version: 6.0.6
  Commit:  7cca709db2

.NET SDKs installed:
  3.1.420 [/usr/local/share/dotnet/x64/sdk]
  5.0.408 [/usr/local/share/dotnet/x64/sdk]
  6.0.301 [/usr/local/share/dotnet/x64/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.26 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.26 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]
nickspoons commented 2 years ago

Hi, thanks for the detailed report.

This looks to me like a neovim bug. What happens is that the configuration is built as a vim dict which is sent to vimspector, which converts it to a python object with :py3 vim.eval(). This command succeeds in vim and fails in neovim, because when neovim converts this dict it converts boolean values to strings:

" vim:
:py3 print(vim.eval('{"a":1,"b":v:true,"c":"a string"}'))
" {'a': '1', 'b': True, 'c': 'a string'}
" neovim:
:py3 print(vim.eval('{"a":1,"b":v:true,"c":"a string"}'))
" {'a': '1', 'b': 'True', 'c': 'a string'}

I've started talking to puremourning about it, not sure if the best way forward right now is to try to work around it, or to get it fixed upstream.

nickspoons commented 2 years ago

@puremourning gave me a tip to use vimspector type coersion to work around this, and now launching the debugger for a project works as expected in neovim.