Skip to content
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

setup example #838

Closed
zhoupro opened this issue Jun 14, 2019 · 1 comment
Closed

setup example #838

zhoupro opened this issue Jun 14, 2019 · 1 comment

Comments

@zhoupro
Copy link

zhoupro commented Jun 14, 2019

purpose

I try your plugin with fail at first try. I found useful information from vim-lsp. So I try it , and It works perfect. Please add more instruction about how to setup language server and configure.

language server

java

  • Install Eclipse JDT Language Server
mkdir -p ~/lsp/eclipse.jdt.ls
cd ~/lsp/eclipse.jdt.ls
curl -L https://download.eclipse.org/jdtls/milestones/0.35.0/jdt-language-server-0.35.0-201903142358.tar.gz -O
tar xf jdt-language-server-0.35.0-201903142358.tar.gz
  • Create executable jdtls in path (e.g., /usr/local/bin/jdtls), with content
#!/usr/bin/env sh

server="/root/lsp"

java \
    -Declipse.application=org.eclipse.jdt.ls.core.id1 \
    -Dosgi.bundles.defaultStartLevel=4 \
    -Declipse.product=org.eclipse.jdt.ls.core.product \
    -noverify \
    -Xms1G \
    -jar $server/eclipse.jdt.ls/plugins/org.eclipse.equinox.launcher_1.*.jar \
    -configuration $server/eclipse.jdt.ls/config_linux/ \
    "$@"
  • Add to your vim config:
let g:LanguageClient_serverCommands = {
    \ 'java': ['/usr/local/bin/jdtls', '-data', getcwd()],
    \ }

php

  • install intelephense
npm -g install intelephense
  • add to your bashrc
let g:LanguageClient_serverCommands = {
\ 'php': ['node', '/usr/local/lib/node_modules/intelephense/lib/intelephense.js', '--stdio'],
    \ }

python

  • install python language server
pip install python-language-server
  • add to your bashrc
let g:LanguageClient_serverCommands = {
\ 'python': ['pyls'],
    \ }

lua

  • install lua language server
apt install  lua5.3-dev luarocks
luarocks install --server=http://luarocks.org/dev lua-lsp
  • add to config
let g:LanguageClient_serverCommands = {
\ 'lua': ['lua-lsp'],
    \ }

fe

  • install css js typescript language server
npm install -g typescript typescript-language-server
npm install -g vscode-css-languageserver-bin
  • add to config
let g:LanguageClient_serverCommands = {
\ 'css': ['css-languageserver',  '--stdio'],
\ 'less': ['css-languageserver',  '--stdio'],
\ 'sass': ['css-languageserver',  '--stdio'],
\ 'javascript': ['typescript-language-server',  '--stdio'],
\ 'javascript.jsx': ['typescript-language-server',  '--stdio'],
\ 'typescript': ['typescript-language-server',  '--stdio'],
\ 'typescript.tsx': ['typescript-language-server',  '--stdio'],
\ }
@autozimu
Copy link
Owner

Sorry for the confusion.

The concern with proposed approach is that those instructions to install language servers are very hard to be comprehensive and kept up to date. e.g., how to keep the java language server version number up to date, and what if user OS don't apt support.

That's why I prefer the end user would go the language server specific page to following the corresponding install steps, as linked in https://github.com/autozimu/LanguageClient-neovim#language-servers

It's welcome to improve if redirection is not clear enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants