nickspoons / vim-sharpenup

Sharpen-up your OmniSharp-vim tooling
MIT License
46 stars 2 forks source link

Neovim Self-Closing #6

Closed SergioRibera closed 3 years ago

SergioRibera commented 3 years ago

Neovim works correctly without this plugin, but as soon as I integrate it and it's loading some project (.proj) it just closes until the terminal.

Nvim Version: NVIM v0.5.0-dev+1075-g02a3c4179 Terminal: st (my own version) Mono Version: 6.12.0

I attach an image of the plugins that I have installed in case that influences, besides the configuration that I tried to do. Vim-Screenshot_02052021_023758 Vim-Screenshot_02052021_023825

If you need more details, I would be happy to provide them.

nickspoons commented 3 years ago

Can you please paste the actual text of your init.vim? I'm not going to type it out to try to repro... Ideally, post your full init.vim so I can try it myself.

What OS is this?

Just guessing here but here are some things to try:

  1. In your plugin listings, move vim-sharpenup to below OmniSharp-vim. vim-sharpenup is dependent on OmniSharp-vim so should be listed afterwards
  2. Try disabling all other plugins to see if it's an interaction with another plugin causing the issue
SergioRibera commented 3 years ago

I have my init.vim somewhat dismembered and maybe with a lot of things wrong, so please don't judge xD. I forgot to put my operating system, I'm sorry.

SO: ArchLinux init.vim: https://termbin.com/eqm9 plugins.vim: https://termbin.com/hyjg pluginconfigs.vim: https://termbin.com/22q34 shortcuts.vim: https://termbin.com/494q themes.vim: https://termbin.com/cpwv

I did not manage to generate a log file for vim execution but if I did it would be very helpful.

nickspoons commented 3 years ago

OK it's a bit hard to debug a split up config like this. Could you try commenting out these lines and see if that changes things?

source ~/.config/nvim/pluginconfigs.vim
source ~/.config/nvim/shortcuts.vim
source ~/.config/nvim/themes.vim

And if it does, narrow it down to which script is the culprit?

nickspoons commented 3 years ago

I copied your config and tried running in archlinux with just OmniSharp-vim and vim-sharpenup. There are lots of errors due to other plugins and some strange config but after commenting some stuff out it works, nothing is hanging.

You say nvim just crashes and closes when you open a .proj file? This plugin shouldn't do anything in a .proj file...

nickspoons commented 3 years ago

Oh I think I see the problem. You are installing plugins into your autoload directory. I bet that's the culprit. This line:

call plug#begin('~/.config/nvim/autoload/plugged')

should be:

call plug#begin('~/.config/nvim/plugged')

(Before making this change, exit all nvims and just move the dir, to save vim-plug re-installing all your plugins:

mv ~/.config/nvim/autoload/plugged ~/.config/nvim/plugged
nickspoons commented 3 years ago

The previous comment is correct and you should definitely move that plugged dir out of autoload ... but it still works for me like that. I have copied your entire config and there are no errors. But there are some worrying things there that I think could be causing problems. Like these autocmds, which are not in augroups,:

au BufRead,BufNewFile *.ino,*.pde set filetype=cpp
" == AUTOCMD END ================================
autocmd FileType * command! -nargs=0 Prettier :CocCommand prettier.formatFile

And the mkview/loadview autocmds.

Can you tell me exactly how you're producing the issue? Can you share the project?

nickspoons commented 3 years ago

Demo running your full config:

asciicast

SergioRibera commented 3 years ago

I just tried everything you suggested, I moved my plugged folder to the place you mention, then I tried to open other c# projects and the truth is that the problem persists :c

nickspoons commented 3 years ago

OK. Let's try narrowing down what it is in vim-sharpenup which is causing conflicts, by disabling the individual parts of this plugin.

" Disable codeaction lookup
let g:sharpenup_codeactions = 0
" Disable mappings
let g:sharpenup_create_mappings = 0

You haven't added lightline integration so don't need to do anything there.

So if you add those 2 lines above, does the error go away? What about with just one or the other?

SergioRibera commented 3 years ago

OK. Let's try narrowing down what it is in vim-sharpenup which is causing conflicts, by disabling the individual parts of this plugin.

" Disable codeaction lookup
let g:sharpenup_codeactions = 0
" Disable mappings
let g:sharpenup_create_mappings = 0

You haven't added lightline integration so don't need to do anything there.

So if you add those 2 lines above, does the error go away? What about with just one or the other?

Apparently putting this in fixed it and now I can load any project without problems, but my question would be does this take away from my functionality? Because if there are certain things of this plugin that I would not like to lose, for example that popup that you open when you run \os

nickspoons commented 3 years ago

Yes these lines disable all of the plugin functionality 😄

Can you try with just one of those lines, then the other, and work out which one is causing the error?

The popups I was opening are just OmniSharp-vim popups, but using the mappings which vim-sharpenup creates automatically. I was using \osd for the documentation popup (:OmniSharpDocumentation) and <-\> for the signature help (:OmniSharpSignatureHelp). You already have your own mappings for omnisharp so you possibly don't need the vim-sharpenup ones, just map the OmniSharp-vim functions you want.

SergioRibera commented 3 years ago

Thank you very much for all your help and patience, it has worked and I will be looking in depth to see what is causing this problem.

SergioRibera commented 3 years ago

Just to let you know, the problem appears at the moment of activating this, see if it helps you.

let g:sharpenup_codeactions = 0
nickspoons commented 3 years ago

Sorry, I am a bit unsure which line is making the error go away. Each of those 2 lines disables part of the vim-sharpenup functionality.

So if you disable the mapping creation, your config is working correctly? You get the lightbulb icon (💡) popping up in lines where there are code actions available?

nickspoons commented 3 years ago

One last thing to test, if you don't mind (since I can't repro locally): if you add finish in your init.vim after sourcing all your scripts, at line 6, do you still get errors? You've already tested disabling all the other parts of your config, but not the other contents of your init.vim, so it would be good to know if something in the rest of the init.vim is conflicting somehow.

SergioRibera commented 3 years ago

Oh yes, I'm very interested in helping you, I'll let you know:

now I will try to deactivate all my configuration except my init and my plugins and see what happens with all the default settings.

SergioRibera commented 3 years ago

Apparently it works without loading the other settings, but I still don't see the lightbulb icon.

SergioRibera commented 3 years ago

I come to update the situation, something in my pluginconfigs.vim file is not liking to coexist with sharpenup and I have strong suspicions that Coc-vim is the culprit..

SergioRibera commented 3 years ago

I found the problem from the root and I'm sorry for the inconvenience, the problem is that I use a terminal (custom fork of st-suckless) and my version does not support fonts that have not been explicitly indicated to be used and the bulb icon is a non-unicode icon so I had problems with it, solution:

nickspoons commented 3 years ago

Ok great, glad to get to the root of the problem!