Skip to content

Commit b921dec

Browse files
authored
Merge pull request #12 from ionide/issue-8_languageserver-command-not-defined
Set g:LanguageClient_serverCommands automatically
2 parents 2fa5812 + fab17eb commit b921dec

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.mkd

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,13 @@ call dein#add('ionide/Ionide-vim', {
7979
\ })
8080
~~~
8181

82-
#### Installing on Windows
83-
84-
Run `install.cmd`.
82+
#### Installing manually
8583

86-
### 3. Setting up the language client
84+
Clone Ionide-vim to some runtimepath and run `make fsautocomplete`.
8785

88-
Once you installed, add the following to somewhere in your `.vimrc`:
89-
90-
```vim
91-
let g:LanguageClient_serverCommands = {
92-
\ 'fsharp': g:fsharp#languageserver_command
93-
\ }
94-
```
86+
#### Installing on Windows
9587

96-
This will configure FSAC to be used from LanguageClient-neovim.
88+
Run `install.cmd`.
9789

9890
Note: if you append it before actually installing Ionide-vim, it will fail with `E121: Undefined variable: g:fsharp#languageserver_command`.
9991

ftplugin/fsharp.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ if empty(glob(fsac))
5656
finish
5757
endif
5858

59+
" add LanguageClient configuration
60+
61+
if !exists('g:LanguageClient_serverCommands')
62+
let g:LanguageClient_serverCommands = {}
63+
endif
64+
if !has_key(g:LanguageClient_serverCommands, 'fsharp')
65+
let g:LanguageClient_serverCommands.fsharp = g:fsharp#languageserver_command
66+
endif
67+
5968
if g:fsharp#automatic_workspace_init
6069
augroup LanguageClient_config
6170
autocmd!

0 commit comments

Comments
 (0)