-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass configuration when running vls from command line? #13
Comments
It not support to pass |
I am still unfamiliar also with many basics of the LSP protocol. Having the request name, I grepped it within LanguageClient-neovim sources and found the answer:
Maybe it is worth mentioning explicitly in the documentation (as well as hints for some other popular clients). Thanks for the answer containing the crucial request name. |
The option PS. I don't use the other LSP client so i don't know how they config. PR is welcome. |
Yes, this examples are helpful, but only partially in my case. Probably it contains the part that is sent with the initial request and some of contents outside this part that are specific to, maybe, coc.nvim. Using logs from the client I see that the full long {
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"capabilities": {
"textDocument": {
"colorProvider": null,
"completion": {
"completionItem": {
"snippetSupport": false
}
},
"declaration": {
"linkSupport": true
},
"definition": {
"linkSupport": true
},
"implementation": {
"linkSupport": true
},
"publishDiagnostics": {
"relatedInformation": true
},
"signatureHelp": {
"signatureInformation": {
"parameterInformation": {
"labelOffsetSupport": true
}
}
},
"typeDefinition": {
"linkSupport": true
}
},
"workspace": {
"applyEdit": true,
"didChangeWatchedFiles": {
"dynamicRegistration": true
}
}
},
"initializationOptions": {
"diagnostic": {
"enable": true
},
"indexes": {
"count": 3,
"gap": 100,
"runtimepath": true
},
"iskeyword": "@,48-57,_,192-255,#",
"runtimepath": "/home/______/.config/nvim,/home/______/.config/nvim/bundle/LanguageClient-neovim,/home/______/.config/nvim/bundle/PHP-Indenting-for-VIm,/home/______/.config/nvim/bundle/ale,/home/______/.config/nvim/bundle/______,/home/______/.config/nvim/bundle/auto-pairs,/home/______/.config/nvim/bundle/bufexplorer,/home/______/.config/nvim/bundle/ctrlp.vim,/home/______/.config/nvim/bundle/deoplete-phpactor,/home/______/.config/nvim/bundle/deoplete.nvim,/home/______/.config/nvim/bundle/fugitive,/home/______/.config/nvim/bundle/fzf.vim,/home/______/.config/nvim/bundle/luciusColorscheme,/home/______/.config/nvim/bundle/neopairs.vim,/home/______/.config/nvim/bundle/nerdtree,/home/______/.config/nvim/bundle/nginx.vim,/home/______/.config/nvim/bundle/phpactor,/home/______/.config/nvim/bundle/snippets,/home/______/.config/nvim/bundle/surround,/home/______/.config/nvim/bundle/tabname,/home/______/.config/nvim/bundle/tail-bundle,/home/______/.config/nvim/bundle/tmux.vim,/home/______/.config/nvim/bundle/ultisnips,/home/______/.config/nvim/bundle/vdebug,/home/______/.config/nvim/bundle/vim-airline,/home/______/.config/nvim/bundle/vim-airline-themes,/home/______/.config/nvim/bundle/vim-commentary,/home/______/.config/nvim/bundle/vim-dispatch,/home/______/.config/nvim/bundle/vim-gitgutter,/home/______/.config/nvim/bundle/vim-javascript,/home/______/.config/nvim/bundle/vim-markdown,/home/______/.config/nvim/bundle/vim-markdown-folding,/home/______/.config/nvim/bundle/vim-move,/home/______/.config/nvim/bundle/vim-pasta,/home/______/.config/nvim/bundle/vim-pathogen,/home/______/.config/nvim/bundle/vim-repeat,/home/______/.config/nvim/bundle/vim-rhubarb,/home/______/.config/nvim/bundle/vim-spacejam,/home/______/.config/nvim/bundle/vim-test,/home/______/.config/nvim/bundle/vim-tmux-focus-events,/home/______/.config/nvim/bundle/vim-toml,/home/______/.config/nvim/bundle/vim-twig,/home/______/.config/nvim/bundle/vim-unimpaired,/etc/xdg/nvim,/home/______/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/share/nvim/runtime,/usr/share/nvim/runtime/pack/dist/opt/matchit,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/______/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/______/.config/nvim/bundle/vim-markdown-folding/after,/home/______/.config/nvim/bundle/vim-javascript/after,/home/______/.config/nvim/bundle/ultisnips/after,/home/______/.config/nvim/bundle/______/after,/home/______/.config/nvim/after,/usr/share/doc/fzf/examples",
"suggest": {
"fromRuntimepath": true,
"fromVimruntime": true
},
"vimruntime": "/usr/share/nvim/runtime"
},
"processId": 14056,
"rootPath": "/home/______/.vim",
"rootUri": "file:///home/______/.vim",
"trace": "verbose"
},
"id": 1
}
only if I put to the request the contents under {
"command": "vim-language-server",
"args": ["--stdio"],
"initializationOptions": {
"iskeyword": "@,48-57,_,192-255,#",
"vimruntime": "/usr/share/nvim/runtime",
"runtimepath": "/home/______/.config/nvim,/home/______/.config/nvim/bundle/LanguageClient-neovim,/home/______/.config/nvim/bundle/PHP-Indenting-for-VIm,/home/______/.config/nvim/bundle/ale,/home/______/.config/nvim/bundle/______,/home/______/.config/nvim/bundle/auto-pairs,/home/______/.config/nvim/bundle/bufexplorer,/home/______/.config/nvim/bundle/ctrlp.vim,/home/______/.config/nvim/bundle/deoplete-phpactor,/home/______/.config/nvim/bundle/deoplete.nvim,/home/______/.config/nvim/bundle/fugitive,/home/______/.config/nvim/bundle/fzf.vim,/home/______/.config/nvim/bundle/luciusColorscheme,/home/______/.config/nvim/bundle/neopairs.vim,/home/______/.config/nvim/bundle/nerdtree,/home/______/.config/nvim/bundle/nginx.vim,/home/______/.config/nvim/bundle/phpactor,/home/______/.config/nvim/bundle/snippets,/home/______/.config/nvim/bundle/surround,/home/______/.config/nvim/bundle/tabname,/home/______/.config/nvim/bundle/tail-bundle,/home/______/.config/nvim/bundle/tmux.vim,/home/______/.config/nvim/bundle/ultisnips,/home/______/.config/nvim/bundle/vdebug,/home/______/.config/nvim/bundle/vim-airline,/home/______/.config/nvim/bundle/vim-airline-themes,/home/______/.config/nvim/bundle/vim-commentary,/home/______/.config/nvim/bundle/vim-dispatch,/home/______/.config/nvim/bundle/vim-gitgutter,/home/______/.config/nvim/bundle/vim-javascript,/home/______/.config/nvim/bundle/vim-markdown,/home/______/.config/nvim/bundle/vim-markdown-folding,/home/______/.config/nvim/bundle/vim-move,/home/______/.config/nvim/bundle/vim-pasta,/home/______/.config/nvim/bundle/vim-pathogen,/home/______/.config/nvim/bundle/vim-repeat,/home/______/.config/nvim/bundle/vim-rhubarb,/home/______/.config/nvim/bundle/vim-spacejam,/home/______/.config/nvim/bundle/vim-test,/home/______/.config/nvim/bundle/vim-tmux-focus-events,/home/______/.config/nvim/bundle/vim-toml,/home/______/.config/nvim/bundle/vim-twig,/home/______/.config/nvim/bundle/vim-unimpaired,/etc/xdg/nvim,/home/______/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/share/nvim/runtime,/usr/share/nvim/runtime/pack/dist/opt/matchit,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/home/______/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/______/.config/nvim/bundle/vim-markdown-folding/after,/home/______/.config/nvim/bundle/vim-javascript/after,/home/______/.config/nvim/bundle/ultisnips/after,/home/______/.config/nvim/bundle/______/after,/home/______/.config/nvim/after,/usr/share/doc/fzf/examples",
"diagnostic": {
"enable": true
},
"indexes": {
"runtimepath": true,
"gap": 100,
"count": 3
},
"suggest": {
"fromVimruntime": true,
"fromRuntimepath": true
}
},
"filetypes": [ "vim" ]
} With this configuration I expected to see globals and functions available by autoloading from plugins in completion menu but none of them are present. I then suspect that the configuration is still incorrect. |
The log seems right. It need some time to index all your vim files in runtimepath. |
Long indexing is probably not the case. For elimination of such potential situation I restricted call LanguageClient# with the cursor at the end of line, I expect log.info(vscode_uri_1.default.file(path_1.join(p, 'f')).toString()); and I get
among other scanned directories. This at least seems to confirm that "runtimepath" is passed correctly in the initial request ;). Where the index is stored? Is it an in-memory instance only or has it persisted form to read at the next start of the server? |
From some hours I have one client-server connection. Indeed, most of autoloaded function are present in the suggestions list. The most of public functions defined in plugins is also visible. Some of plugins are still not invisible, although they are in runtimepath (and callable from the command line). First, I would like to get detailed log about when each file is indexed and when indexing is complete. Next, why some function and variable names are still not suggested (it seems that whole plugin directories are ignored, e.g. vdebug). Both problems exceed the topic of this issue. P.S. After reopening connection I noticed absence of many expected suggestions indexed previously. It suggests that there is no cached form of the index to initial use before slow reindexing. |
It must be something wrong, it can't take hours to index all plugins. It only take 1x-2x seconds to index 3x plugins with my macbook pro. If it parser the plugin's file fail, it will not get the items from that plugin's file, and it does not have cache by now. |
Thanks for info about VDebug before I worked out this. I found (using "print debugging" as a typescript beginner) two bugs. The first is the cause of absence of my local plugin. The second is related to logging. I can sent separate pull requests to propose the fixes. |
@iamcco Does the plugin automatically use |
@masaeedu The plugin will not use the |
@iamcco That's another thing; I am actually using that extension, but until I explicitly added that configuration block in |
@masaeedu The extension do not need configured in coc-settings.json |
Anybody had any luck configuring the server under LanguageClient-neovim ? I've been trying to get it working under vim 8.2 for the past couple of days, but alas - I am still new to the whole LSP thing. |
Hello,
I would like to use
vim-language-server
with https://github.com/autozimu/LanguageClient-neovimbut I (as not Node developer) have no idea how to pass the configuration presented for
--stdio
.With
seems to work, but I would like to configure
fromRuntimepath
and not only.Seriously: I even not know how to list possible options... Running
vim-language-server
without parameters throws the error with suggestion to use only the basicbut not how to display help message and how to inject any configuration.
Please complete documentation.
The text was updated successfully, but these errors were encountered: