Closed panesofglass closed 5 years ago
Looks like the issue could be related to my switch to Vim8's built-in package manager pack/*/start
path, the install.fsx
places the built package in the wrong place. By changing the path to pack/bundle/start/*
in install.fsx
, it seems like it should work, but I see the same result.
I haven't really tested install.fsx
so much so it may be not working correctly. I'll investigate it.
As a workaround for now, you can use Plug or dein.vim and it should work as expected.
Did you use install.sh
for installing?
Yes, I used install.sh. I’m not interested in using plug or dein.vim, so I’ll pass for now. Thanks.
If you've installed to .vim/pack/*/start
, it won't work in neovim: try .local/share/nvim/site/pack/*/start
instead.
If not, let me know and I'll set up a new Ubuntu environment and try to figure out why it isn't working.
@cannorin I have the same issue actually, installing with Plug :D running vim on mac osx! LMK if you'd rather have another issue opened, or just continue here and more importantly if any more details could help you! I'd love to get this working :D
@giulioungaretti It could be because you added
let g:LanguageClient_serverCommands = {
\ 'fsharp': g:fsharp#languageserver_command
\ }
before you installed the plugin by executing :PlugInstall
. Adding it after installing should not trigger the error. If it wasn't the case, let me know more details.
:PlugInstall ✔️
Open vim in ~ get:
Error detected while processing /Users/unga/.vimPlug:
line 23:
E121: Undefined variable: g:fsharp#languageserver_command
Press ENTER or type command to continue
Open a .fs file:
Error detected while processing /Users/unga/.vim/plugged/Ionide-vim/ftplugin/fsharp.vim:
line 12:
FSAC not found. :FSharpUpdateFSAC to download.
Run said command:
E492: Not an editor command: FSharpUpdateFSAC
Which makes me think it could be related to some PATH issues ?
Ah, my bad. That's because I placed the existence-checking code before defining commands: https://github.com/ionide/Ionide-vim/blob/master/ftplugin/fsharp.vim#L11
As a workaround, could you try doing :call fsharp#updateFSAC()
and see what happens?
It's still not working for me. :( I'll continue to try again every so often.
@panesofglass I'll reproduce your environment and try to find out why it isn't working. Could you provide me the location of Ionide-vim and your .vimrc?
@giulioungaretti https://github.com/ionide/Ionide-vim/commit/5f4f194bc1d2721156fe0b861371360df40ed527 addressed the problem :FSharpUpdateFSAC
is not available. If you have not tried the workaround above, you can instead upgrade Ionide-vim to the latest.
I suspect that autoload/fsharp.vim
is not correctly loaded, so if my guess is correct it will give you a different error message.
@cannorin thank you! On Windows, I'm using ~\AppData\Local\nvim
with an init.vim
in that folder. On Linux, I'm using ~/.config/nvim
with init.vim
in that folder. I'm storing my plugins using ~/*/nvim/pack/bundle/start
. You can access my vimfiles where I'm trying to use Ionide-vim here. (I should have shared that sooner, come to think of it.)
@panesofglass
master
branch of LanguageClient-neovim which is very outdated and cannot be used. Switch to the next
branch and run install.sh
.@giulioungaretti @panesofglass I just created issue-8_languageserver-command-not-defined
branch and applied the fix (hopefully) to it. Can you switch to that branch and try it out?
The languageserver configuration is now done automatically and
let g:LanguageClient_serverCommands = {
\ 'fsharp': g:fsharp#languageserver_command
\ }
in vimrc/init.vim is not needed anymore.
@cannorin it works wonderfully with that branch! Tested on wsl2 + mac osx!
@giulioungaretti Great to hear that!
I've updated everything, but I still see the error on both wsl2 and windows. Maybe I missed something?
@panesofglass Make sure you removed the let g:LanguageClient_serverCommands = ...
line from your init.vim as it would be the only source of the "not defined" error.
Ah, thanks! I missed that bit. It works great now! By the way, if I wanted to add additional language server commands, would I just not add anything about fsharp?
Thanks! I'll merge the fix now.
The current implementation of Ionide-vim only adds the F# language server command when editing F# files, so you can just add language server of another languages.
@panesofglass @giulioungaretti Don't forget to switch back to the master branch (I'll delete the issue branch in few days). Thanks a lot for reporting a bug :joy:
Describe the bug
g:fsharp#languageserver_command
is not defined after installing Ionide-vim.To Reproduce Steps to reproduce the behaviour:
nvim .
Expected behaviour Correctly load a pre-configured variable named
g:fsharp#languageserver_command
to issue commands to FSAC.Screenshots
Environment (please complete the following information):