GithubHelp home page GithubHelp logo

prabirshrestha / vim-lsp Goto Github PK

View Code? Open in Web Editor NEW
3.0K 51.0 296.0 1.78 MB

async language server protocol plugin for vim and neovim

License: MIT License

Go 0.02% Rust 0.08% Vim Script 99.90%
language-server-protocol vim vim-lsp async neovim vim8 asyncomplete

vim-lsp's Introduction

vim-lsp Gitter

Async Language Server Protocol plugin for vim8 and neovim.

Installing

Install vim-plug and then:

Plug 'prabirshrestha/vim-lsp'

Performance

Certain bottlenecks in Vim script have been implemented in lua. If you would like to take advantage of these performance gains use vim compiled with lua or neovim v0.4.0+

Registering servers

if executable('pylsp')
    " pip install python-lsp-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pylsp',
        \ 'cmd': {server_info->['pylsp']},
        \ 'allowlist': ['python'],
        \ })
endif

function! s:on_lsp_buffer_enabled() abort
    setlocal omnifunc=lsp#complete
    setlocal signcolumn=yes
    if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
    nmap <buffer> gd <plug>(lsp-definition)
    nmap <buffer> gs <plug>(lsp-document-symbol-search)
    nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
    nmap <buffer> gr <plug>(lsp-references)
    nmap <buffer> gi <plug>(lsp-implementation)
    nmap <buffer> gt <plug>(lsp-type-definition)
    nmap <buffer> <leader>rn <plug>(lsp-rename)
    nmap <buffer> [g <plug>(lsp-previous-diagnostic)
    nmap <buffer> ]g <plug>(lsp-next-diagnostic)
    nmap <buffer> K <plug>(lsp-hover)
    nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
    nnoremap <buffer> <expr><c-d> lsp#scroll(-4)

    let g:lsp_format_sync_timeout = 1000
    autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
    
    " refer to doc to add more commands
endfunction

augroup lsp_install
    au!
    " call s:on_lsp_buffer_enabled only for languages that has the server registered.
    autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

Refer to vim-lsp-settings on how to easily setup language servers using vim-lsp automatically.

Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'

auto-complete

Refer to docs on configuring omnifunc or asyncomplete.vim.

Snippets

vim-lsp does not support snippets by default. If you want snippet integration, you will first have to install a third-party snippet plugin and a plugin that integrates it in vim-lsp. At the moment, you have following options:

  1. vim-vsnip together with vim-vsnip-integ
  2. UltiSnips together with vim-lsp-ultisnips
  3. neosnippet.vim together with vim-lsp-neosnippet

For more information, refer to the readme and documentation of the respective plugins.

Folding

You can let the language server automatically handle folding for you. To enable this, you have to set 'foldmethod', 'foldexpr' and (optionally) 'foldtext':

set foldmethod=expr
  \ foldexpr=lsp#ui#vim#folding#foldexpr()
  \ foldtext=lsp#ui#vim#folding#foldtext()

If you would like to disable folding globally, you can add this to your configuration:

let g:lsp_fold_enabled = 0

Also see :h vim-lsp-folding.

Semantic highlighting

vim-lsp supports the unofficial extension to the LSP protocol for semantic highlighting (microsoft/vscode-languageserver-node#367). This feature requires Neovim highlights, or Vim with the textprop feature enabled. You will also need to link language server semantic scopes to Vim highlight groups. Refer to :h vim-lsp-semantic for more info.

Supported commands

Note:

  • Some servers may only support partial commands.
  • While it is possible to register multiple servers for the same filetype, some commands will pick only the first server that supports it. For example, it doesn't make sense for rename and format commands to be sent to multiple servers.
Command Description
:LspAddTreeCallHierarchyIncoming Find incoming call hierarchy for the symbol under cursor, but add the result to the current list
:LspCallHierarchyIncoming Find incoming call hierarchy for the symbol under cursor
:LspCallHierarchyOutgoing Find outgoing call hierarchy for the symbol under cursor
:LspCodeAction Gets a list of possible commands that can be applied to a file so it can be fixed (quick fix)
:LspCodeLens Gets a list of possible commands that can be executed on the current document
:LspDeclaration Go to the declaration of the word under the cursor, and open in the current window
:LspDefinition Go to the definition of the word under the cursor, and open in the current window
:LspDocumentDiagnostics Get current document diagnostics information
:LspDocumentFormat Format entire document
:LspDocumentRangeFormat Format document selection
:LspDocumentSymbol Show document symbols
:LspHover Show hover information
:LspImplementation Show implementation of interface in the current window
:LspNextDiagnostic jump to next diagnostic (all of error, warning, information, hint)
:LspNextError jump to next error
:LspNextReference jump to next reference to the symbol under cursor
:LspNextWarning jump to next warning
:LspPeekDeclaration Go to the declaration of the word under the cursor, but open in preview window
:LspPeekDefinition Go to the definition of the word under the cursor, but open in preview window
:LspPeekImplementation Go to the implementation of an interface, but open in preview window
:LspPeekTypeDefinition Go to the type definition of the word under the cursor, but open in preview window
:LspPreviousDiagnostic jump to previous diagnostic (all of error, warning, information, hint)
:LspPreviousError jump to previous error
:LspPreviousReference jump to previous reference to the symbol under cursor
:LspPreviousWarning jump to previous warning
:LspReferences Find references
:LspRename Rename symbol
:LspStatus Show the status of the language server
:LspTypeDefinition Go to the type definition of the word under the cursor, and open in the current window
:LspTypeHierarchy View type hierarchy of the symbol under the cursor
:LspWorkspaceSymbol Search/Show workspace symbol

Diagnostics

Document diagnostics (e.g. warnings, errors) are enabled by default, but if you preferred to turn them off and use other plugins instead (like Neomake or ALE, set g:lsp_diagnostics_enabled to 0:

let g:lsp_diagnostics_enabled = 0         " disable diagnostics support

Highlight references

Highlight references to the symbol under the cursor (enabled by default). You can disable it by adding

let g:lsp_document_highlight_enabled = 0

to your configuration.

To change the style of the highlighting, you can set or link the lspReference highlight group, e.g.:

highlight lspReference ctermfg=red guifg=red ctermbg=green guibg=green

Debugging

In order to enable file logging set g:lsp_log_file.

let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/vim-lsp.log')

" for asyncomplete.vim log
let g:asyncomplete_log_file = expand('~/asyncomplete.log')

You can get detailed status on your servers using :CheckHealth with a plugin on vim:

if !has('nvim') | Plug 'rhysd/vim-healthcheck' | endif
CheckHealth

Tests

vim-themis is used for testing. To run integration tests gopls executable must be in path.

Maintainers

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

vim-lsp's People

Contributors

clktmr avatar daisuzu avatar doriath avatar dotdash avatar hauleth avatar hiroebe avatar hrsh7th avatar idbrii avatar ilya-bobyr avatar itchyny avatar keremc avatar machakann avatar markonm avatar mattn avatar mikoto2000 avatar nickspoons avatar obcat avatar prabirshrestha avatar pusewicz avatar renovate[bot] avatar rhysd avatar ryu-ichiroh avatar smhc avatar subnut avatar thomasfaingnaert avatar tsufeki avatar tsuyoshicho avatar tyru avatar yuilib avatar zbinlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-lsp's Issues

support workspace/applyEdit

We already have support for this via s:apply_workspace_edits so should be easy to implement this. This will also pave us for the road to support codeActions responses.

vim-lsp completion is broken (at least for go, possibly other languages too)

Ran using the following:

vim -u example.vimrc go/src/golang.org/x/net/context/ctxhttp/ctxhttp.go

LspDocumentDiagnostics:
No diagnostics results

LspDefinition works fine
LspReferences works fine
LspSymbol works fine

Completion however does not work, omnicompletion or automatic (neither work).

If I open a flow document completion works fine there, so the brokeness seems specific to go; I did not try python because I did not want to pollute my system with python-language-server which requires tons of dependencies.

This is the example.vimrc file I am using (slightly modified from the suggested minimal example in one of the issues):

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim

call plug#begin('/tmp/plugged')
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
call plug#end()

imap <c-space> <Plug>(asyncomplete_force_refresh)
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
    autocmd FileType python setlocal omnifunc=lsp#complete
endif

if executable('flow-language-server')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'flow-language-server',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'flow-language-server --stdio']},
        \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), '.flowconfig'))},
        \ 'whitelist': ['javascript'],
        \})
    autocmd FileType javascript setlocal omnifunc=lsp#complete
endif

if executable('go-langserver')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'go-langserver',
        \ 'cmd': {server_info->['go-langserver', '-mode', 'stdio']},
        \ 'whitelist': ['go'],
        \})

    autocmd FileType go setlocal omnifunc=lsp#complete
endif

" autocmd VimEnter * PlugClean! | PlugUpdate --sync

I initially ran without the autocmd commented, but I also tried commenting that out (so that Plug doesn't reinstall everything everytime).

optimal .vimrc configuration for php autocompletion

I started using your packages for php for autocompletion .. etc

this is my .vimrc configuraiton


" PHP Language server
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'felixfbecker/php-language-server', {'do': 'composer install && composer run-script parse-stubs'}

" Autocomplete
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'


" PLUGIN: vim-lsp
" Register server
au User lsp_setup call lsp#register_server({
     \ 'name': 'php-language-server',
     \ 'cmd': {server_info->['php', expand('~/.vim/plugged/php-language-server/bin/php-language-server.php')]},
     \ 'whitelist': ['php'],
     \ })

nnoremap <buffer><silent> <c-]>  :LspDefinition<cr>
nnoremap <buffer><silent> K :LspHover<cr>

let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/vim-lsp.log')

" for asyncomplete.vim log
let g:asyncomplete_auto_popup=1
let g:asyncomplete_remove_duplicates=1
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
autocmd FileType php setlocal omnifunc=lsp#complete
let g:asyncomplete_log_file = expand('~/asyncomplete.log')

checking the logs, no errors reported, but I have the following issues / difficulties:

  1. Autocomplete doesn't work with omni CTRL+x,CTRL+o, doesn't autocomplete everything.
  2. Every time i open a file from the project folder, indexing starts from the beginning again, and it does not help in autocompletion as well.

Any help?

thanks.

Consider echo'ing instead of quickfixes for Hover

Would it make more sense to echo or echom the hover information? the quickfix list seems kinda obtrusive.

I realize this gets sticky when there are multiple servers providing hover information. My solution would be to select the first non-empty response and display that. Thoughts?

Using 'felixfbecker/php-language-server' as a lsp server

Hi, I am trying to use php-languange-server, already installed the plugins in vim (with Vundle.vim) with:
Plugin 'felixfbecker/php-language-server'
Plugin 'prabirshrestha/async.vim'
Plugin 'prabirshrestha/vim-lsp'

cd into .vim/bundle/php-language-server run composer install and then composer run-script parse-stub and started the server with php ~/.vim/bundle/php-language-server/bin/php-language-server.php

I think I need to register the server with vim-lsp, like:

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

but no idea how, can someone help me or point me in the right direction?

LspDefinition hook

I would like to create a script with a goto-stack like what's built in for ctags. To do this, I would be great to have a way to tell programmatically if LspDefinition/lsp#ui#vim#definition succeeded or not, e.g. an on_success callback.

If you're interested, I'll create a PR proposal.

Battery included?

Can we include the configuration of supported language server in the plugin? Just like the ALE does. This will lower the barrier to use the plugin. In this way the registering server API is hiding from the end user, giving you the freedom to change it in the future.

add diagnostics signs.

Although vim-lsp already supports :LspDiagnostics it would be good to have diagnostics signs working.

Seems like @tsufeki already got it running. https://github.com/tsufeki/vim-lsp/tree/diagnostic-signs. Any plans to send PR soon for this?

image

Ideally I would like to have another vim plugin that manages these signs and vim-lsp uses it. This ways other plugins besides vim-lsp can also work on it. Had posted my initial thoughts to ale but got rejected. dense-analysis/ale#517 (comment)

Would love to have the api look somewhat like VsCodes' DiagnosticsCollection simple and clear. https://code.visualstudio.com/docs/extensionAPI/vscode-api#DiagnosticCollection

Allow for direct jump to definition

For identifiers that only have a single definition location it's annoying to have to open the split just to jump to definition. I think one of the following could help alleviate this:

  • Jump directly to definition if the response list is of length 1
  • Provide :LspGoToDefinition

Thoughts?

global option support?

hi, current version of vim-lsp use the au command to set server for filetype. but I think au command is slow and not easy for new vimmer . would like to support a global option?

for example

let g:lsp_servers['python'] = {
        \ 'name': 'pyls',
        \ 'cmd': ['pyls'],
        \ }

or provide a global func

call lsp#reg_server(ft, cmd)

Second textDocument/didOpen notification is missing first line of file

This is a weird one. The second file being opened doesn't include the full contents. I couldn't figure it out from looking at the codebase so I was hoping you might have some insight.

Steps to replicate:

  1. Create two files:
    t1.java
    Hello
    There
    
    t2.java
    Hello
    There
    
  2. Open the first file: vim t1.java
  3. Edit the second: :e t2.java
  4. Check the logs:
Mon 28 Aug 2017 04:07:52 PM PDT:["lsp#register_server","server registered","Kythe Language Server"]
Mon 28 Aug 2017 04:07:52 PM PDT:["s:on_text_document_did_open()",1]
Mon 28 Aug 2017 04:07:52 PM PDT:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":1,"server_name":"Kythe Language Server"},"message":"started lsp server successfully"}}]
Mon 28 Aug 2017 04:07:52 PM PDT:["--->",1,"Kythe Language Server",{"method":"initialize","params":{"rootUri":"file:///[redacted]","capabilities":{},"rootPath":"file:///[redacted]"}}]
Mon 28 Aug 2017 04:07:52 PM PDT:["<---",1,"Kythe Language Server",{"response":{"id":1,"result":{"capabilities":{"hoverProvider":true,"definitionProvider":true,"textDocumentSync":1,"referencesProvider":true}},"jsonrpc":"2.0"},"request":{"method":"initialize","jsonrpc":"2.0","id":1,"params":{"rootUri":"file:///[redacted]","capabilities":{},"rootPath":"file:///[redacted]"}}}]
Mon 28 Aug 2017 04:07:52 PM PDT:["--->",1,"Kythe Language Server",{"method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///[redacted]/t1.java","version":1,"languageId":"java","text":"Hello\nThere"}}}]
Mon 28 Aug 2017 04:07:52 PM PDT:[{"response":{"data":{"path":"file:///[redacted]/t1.java","__data__":"vim-lsp","filetype":"java","server_name":"Kythe Language Server"},"message":"textDocument/open sent"}}]
Mon 28 Aug 2017 04:07:52 PM PDT:[{"response":{"data":{"path":"file://[redacted]/t1.java","__data__":"vim-lsp","server_name":"Kythe Language Server"},"message":"not dirty"}}]
Mon 28 Aug 2017 04:07:54 PM PDT:["s:on_text_document_did_close()",1]
Mon 28 Aug 2017 04:07:54 PM PDT:["s:on_text_document_did_open()",2]
Mon 28 Aug 2017 04:07:54 PM PDT:[{"response":{"data":{"__data__":"vim-lsp","server_name":"Kythe Language Server"},"message":"server already started"}}]
Mon 28 Aug 2017 04:07:54 PM PDT:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"result":{"capabilities":{"hoverProvider":true,"definitionProvider":true,"textDocumentSync":1,"referencesProvider":true}},"jsonrpc":"2.0"},"server_name":"Kythe Language Server"},"message":"lsp server already initialized"}}]
Mon 28 Aug 2017 04:07:54 PM PDT:["--->",1,"Kythe Language Server",{"method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///[redacted]/t2.java","version":1,"languageId":"java","text":"There"}}}]
Mon 28 Aug 2017 04:07:54 PM PDT:[{"response":{"data":{"path":"file:///[redacted]/t2.java","__data__":"vim-lsp","filetype":"java","server_name":"Kythe Language Server"},"message":"textDocument/open sent"}}]
Mon 28 Aug 2017 04:07:54 PM PDT:[{"response":{"data":{"path":"file:///[redacted]/t2.java","__data__":"vim-lsp","server_name":"Kythe Language Server"},"message":"not dirty"}}]
Mon 28 Aug 2017 04:07:56 PM PDT:["s:on_text_document_did_close()",2]
Mon 28 Aug 2017 04:07:56 PM PDT:["s:on_exit",1,"Kythe Language Server","exited",-1]

As you can see, the content of t1.java is reported as Hello\nThere while the content of t2.java is reported as There

respect line endings

Currently it always assumes \n. Need to respect the file's line endings.

function! s:get_text_document_text(buf) abort
    return join(getbufline(a:buf, 1, '$'), "\n")
endfunction

add more examples

Goto definition using javascript-typescript-langserver

let s:lsp_id = 0
let s:lsp_init_capabilities = {}
let s:lsp_last_request_id = 0

" Given a buffer and a filename, find the nearest file by searching upwards
" through the paths relative to the given buffer.
" https://github.com/w0rp/ale/blob/master/autoload/ale/util.vim
function! s:find_nearest_file(buffer, filename) abort
    let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')

    let l:relative_path = findfile(a:filename, l:buffer_filename . ';')

    if !empty(l:relative_path)
        return fnamemodify(l:relative_path, ':p')
    endif

    return ''
endfunction

function! s:is_file_uri(uri) abort
    return  stridx(a:uri, 'file:///') == 0
endfunction

function! s:path_to_uri(path) abort
    if has('win32') || has('win64')
        return 'file:///' . s:escape_path(a:path)
    else
        return 'file://' . a:path
    endif
endfunction

function! s:uri_to_path(uri) abort
    if has('win32') || has('win64')
        return substitute(a:uri[len('file:///'):], '/', '\\', 'g')
    else
        return uri[len('file://'):]
    endif
endfunction

function! s:escape_path(path) abort
    return substitute(a:path, '\', '/', 'g')
endfunction

function! s:get_line_from_buf_or_file(loc_bufnr, loc_filename, loc_line) abort
    " https://github.com/tjdevries/nvim-langserver-shim/blob/cf7cf980a2d23b79eb74d6c78495587fe9703d6a/autoload/langserver/util.vim#L254-L262
    if bufnr('%') == a:loc_bufnr
        return getline(a:loc_line)
    else
        return readfile(a:loc_filename, '', a:loc_line)[a:loc_line - 1]
    endif
endfunction

function! s:get_text_document_identifier(...) abort
    let l:path = a:0
    if empty(l:path)
        let l:path = expand('%:p')
    endif
    return { 'uri': s:path_to_uri(l:path) }
endfunction

function! s:get_text_document(...) abort
    return extend(call('s:get_text_document_identifier', a:000), {
        \ 'languageId': 'typescript',
        \ 'text': join(getline(1, '$'), "\n"),
        \ 'version': 1
        \ })
endfunction

function! s:get_text_document_position_params(...) abort
  return {
        \ 'textDocument': call('s:get_text_document_identifier', a:000),
        \ 'position': s:get_position(),
        \ }
endfunction

function! s:get_reference_params(...) abort
  return extend(call('s:get_text_document_position_params', a:000), {
    \ 'context': { 'includeDeclaration': v:true }
    \ })
endfunction

function! s:get_position() abort
    return { 'line': line('.') - 1, 'character': col('.') -1 }
endfunction

function! s:start_lsp() abort
    if s:lsp_id <= 0
        let l:tsconfig_json_path = s:find_nearest_file(bufnr('%'), 'tsconfig.json')
        if !empty(l:tsconfig_json_path)
            let s:lsp_id = lsp#lspClient#start({
                \ 'cmd': ['node', 'D:/tmp/javascript-typescript-langserver/build/language-server-stdio.js'],
                \ })
            if s:lsp_id > 0
                let s:lsp_last_request_id = lsp#lspClient#send(s:lsp_id, {
                    \ 'method': 'initialize',
                    \ 'params': {
                    \   'capabilities': {},
                    \   'rootPath': s:path_to_uri(fnamemodify(l:tsconfig_json_path, ':p:h')),
                    \ },
                    \ 'on_notification': function('s:on_initialize')
                    \ })
            endif
        endif
    endif
endfunction

function! s:on_notification_log(id, data, event) abort
    echom json_encode(a:data)
endfunction

function! s:on_initialize(id, data, event) abort
    if lsp#lspClient#is_error(a:data.response)
        echom json_encode(a:data.response)
        let s:lsp_init_response = {}
    else
        let s:lsp_init_capabilities = a:data.response.result.capabilities
        if s:lsp_last_request_id > 0
            " javascript-typescript-langserver doesn't support this method so don't call it
            " let s:lsp_last_request_id = lsp#lspClient#send(s:lsp_id, {
            "     \ 'method': 'textDocument/didOpen',
            "     \ 'params': {
            "     \   'textDocument': s:get_text_document(),
            "     \ },
            "     \ 'on_notification': function('s:on_notification_log')
            "     \ })
        endif
    endif
endfunction

function! s:goto_definition() abort
    if !s:supports_capability('definitionProvider')
        echom 'Go to definition not supported by the language server'
        return
    endif
    let s:lsp_last_request_id = lsp#lspClient#send(s:lsp_id, {
        \ 'method': 'textDocument/definition',
        \ 'params': {
        \   'textDocument': s:get_text_document_identifier(),
        \   'position': s:get_position(),
        \ },
        \ 'on_notification': function('s:on_goto_definition')
        \})
endfunction

function! s:on_goto_definition(id, data, event) abort
    if lsp#lspClient#is_error(a:data.response)
        echom 'error occurred going to definition'. json_encode(a:data)
        return
    endif
    if !has_key(a:data.response, 'result')  || len(a:data.response.result) == 0
        echom 'no results found'
        return
    endif
    let l:def = a:data.response.result[0]
    if s:is_file_uri(l:def.uri)
        if s:escape_path(expand('%:p') == s:escape_path(s:uri_to_path(l:def.uri)))
            call cursor(l:def.range.start.line + 1, l:def.range.start.character + 1)
        else
            execute 'edit +call\ cursor('.(l:def.range.start.line + 1).','.(l:def.range.start.character + 1).') '.s:uri_to_path(l:def.uri)
        endif
    else
        echom l:def.uri
    endif
endfunction

function! s:find_references() abort
    if !s:supports_capability('referencesProvider')
        echom 'FindReferences not supported by the language server'
        return
    endif
    let s:lsp_last_request_id = lsp#lspClient#send(s:lsp_id, {
        \ 'method': 'textDocument/references',
        \ 'params': s:get_reference_params(),
        \ 'on_notification': function('s:on_find_references')
        \})
endfunction

function! s:on_find_references(id, data, event) abort
    if lsp#lspClient#is_error(a:data.response)
        echom 'error occurred finding references'. json_encode(a:data)
        return
    endif
    if !has_key(a:data.response, 'result')  || len(a:data.response.result) == 0
        echom 'no references found'
        return
    endif

    let l:locations = []
    for l:location in a:data.response.result
        if s:is_file_uri(l:location.uri)
            let l:path = s:uri_to_path(l:location.uri)
            let l:bufnr = bufnr(path)
            let l:line = l:location.range.start.line + 1
            call add(l:locations, {
                \ 'filename': s:uri_to_path(l:location.uri),
                \ 'lnum': l:line,
                \ 'col': l:location.range.start.character + 1,
                \ 'text': s:get_line_from_buf_or_file(l:bufnr, l:path, l:line)
                \ })
        endif
    endfor

    call setloclist(0, l:locations, 'r')

    if !empty(l:locations)
        lwindow
    endif
endfunction

function s:get_capabilities() abort
    return s:lsp_init_capabilities
endfunction

function s:supports_capability(name) abort
    let l:capabilities = s:get_capabilities()
    if empty(l:capabilities) || !has_key(l:capabilities, 'referencesProvider') || l:capabilities.referencesProvider != v:true
        return 0
    else
        return 1
    endif
endfunction

command! GetCapabilities :echom json_encode(s:get_capabilities())
command! GoToDefinition call s:goto_definition()
command! FindReferences call s:find_references()

augroup lsp_ts
    autocmd!
    autocmd FileType typescript map <buffer> <C-]> :GoToDefinition<cr>
    autocmd FileType typescript map <buffer> <C-^> :FindReferences<cr>
    autocmd BufWinEnter,FileType typescript call s:start_lsp()
augroup END

send `textDocument/didSave` only if the server supports it

  • Don't send notification if it is of type TextDocumentSyncKind.
capabilities {
    textDocumentSync: TextDocumentSyncKind.Full,
}
  • Send notification only if it says it supports.
capabilities: {
    textDocumentSync: {
        save: {}
    }
}
  • Send notification along with the text only if includeText is true.
capabilities: {
    textDocumentSync: {
        save: {
            includeText: true
        }
    }
}

configuration of clangd?

When trying to autocomplete string goa_account_ in t_kinit.c (line 89) I enter

if (!goa_account

and I press Ctrl-X-Ctrl-O, but the suggested autocompletion is completely wrong:

screenshot from 2017-12-07 22-36-30

vim-lsp-log.txt is record of the conversation between vim and clangd.

When trying the same in vscode (not sure, whether it uses the same clangd or something of its own), autocompletion works just fine.

All that on RHEL-7, with clangd 5.0.0, vim 8.0.1367, vscode 1.18.1, vim-lsp from e7ab592.

Could the problem be that clangd is missing some configuration. When using Intellisense in VSCode, I need to add rather large configuration (especially include directories) in c_cpp_properties.json. Isn't the problem of vim-lsp, that it doesn't allow such configuration?

Cannot LspRename

I have opened this script, went to the line 26 and with cursor on provider_type, I run LspRename (manually, as I have no mapping for it). vim started do something, but actually with no result. Why LspRename doesn’t?

vim-lsp.log.txt is the log collected via g:lsp_verbose and g:lsp_log_file.

job.vim shouldn't be just copy of async.vim/autoload/job.vim

There should be introduced any dependency management mechanism, while async.vim can be useful as standalone library, but just copying it in your plugin's will lead to such behavior from other plugin developers. So there can be too big wish just to use your own modified copy of job.vim instead of contribute back.

use the PowerShellEditorServices language server

Hello,
I don't know if this is the right place to ask... but
can vim-lisp be configured to use the language server that is provided with the PowerShellEditorServices?
I have collected some information ...
If you look at the powershellscript on the following link you see that they start up a service.

from
https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/Start-EditorServices.ps1

This script contains startup logic for the PowerShell Editor Services
module when launched by an editor. It handles the following tasks:

  • Verifying the existence of dependencies like PowerShellGet
  • Verifying that the expected version of the PowerShellEditorServices module is installed
  • Installing the PowerShellEditorServices module if confirmed by the user
  • Finding unused TCP port numbers for the language and debug services to use
  • Starting the language and debug services from the PowerShellEditorServices module

and in
https://poshtools.com/2017/11/22/the-future-of-languages-in-visual-studio/

you can see some code that hooks it up to visual code.

extract...

PowerShell Editor Services works by starting up a TCP server within PowerShell and then communicates
back and forth to the editor of the port. The port that it’s listening on is written out to the session file that you > define on the command line. This file contains a bunch other info and is formatted as JSON. After starting
the editor services, I then can parse the JSON file and open a TCP client to the editor services running in
PowerShell.

So the question is : Is it possible to do this in vim-lsp and how?
Or is it not possible?
If I could do it myself, I would.
greetings

LSP with polymer-editor-service

Hi !

Thx for this component !

I have an issue with the polymer-editor-service from Polymer team.

With this config:

if executable('polymer-editor-service')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'polymer-editor-service',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'polymer-editor-service']},
        \ 'whitelist': ['html', 'javascript'],
        \ })
endif

LspDefinition and LspDocumentDiagnostics work on HTML files but not on JS files.

What I missed ?

fzf backend for LspReferences and LspDocumentSymbols

Currently these both display in the quickfix list.

It would be nice to provide backends or hooks to display this data differently. In particular displaying these inside fzf would be nice.

One easy way to do this would be to provide a function that prints the output as a list of strings. This would allow the user to easily write their own fzf hooks.

Minimal vimrc example

Thanks for your work, the async*.vim set of plugins seems really promising.

I was wondering if it would be possible to include a minimal vimrc example that uses vim-lsp and asyncomplete.vim to perform autocompletion. All I managed to achieve was through omnicomplete, but it doesn't look like the gifs you posted on the Neovim issue. I attached my vimrc below.
Neovim + vim-lsp + asyncomplete.vim via omnicomplete

Also, does vim-lsp support all LSP functionalities ? I couldn't find anything regarding signatures and code linting.

Best,
Séb

" -------------- My Vim --------------
let mapleader = ','
if &compatible
    set nocompatible               " Be iMproved
endif
filetype plugin indent on

" -------------- Dein Config --------------

set runtimepath+=~/.vim/repos/github.com/Shougo/dein.vim
if dein#load_state(expand('~/.vim'))
    " Required:
    call dein#begin(expand('~/.vim'))
    " Let dein manage dein
    call dein#add(expand('~/.vim/repos/github.com/Shougo/dein.vim'))

    " Language Server Protocol
    call dein#add('prabirshrestha/asyncomplete.vim')
    call dein#add('prabirshrestha/async.vim')
    call dein#add('prabirshrestha/vim-lsp')
    call dein#add('prabirshrestha/asyncomplete-lsp.vim')
    

    call dein#end()
    call dein#save_state()
endif
if dein#check_install()
    call dein#install()
endif

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

let g:lsp_async_completion = 1
imap <c-space> <Plug>(asyncomplete_force_refresh)
autocmd FileType python setlocal omnifunc=lsp#complete
let g:asyncomplete_auto_popup = 0

function! s:check_back_space() abort
    let col = col('.') - 1
    return !col || getline('.')[col - 1]  =~ '\s'
endfunction

inoremap <silent><expr> <TAB>
  \ pumvisible() ? "\<C-n>" :
  \ <SID>check_back_space() ? "\<TAB>" :
  \ asyncomplete#force_refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
set completeopt+=preview

pyls related error

Hi,

For pyls server code

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

I am getting following error.

Error detected while processing User Auto commands for "lsp_setup":
E15: Invalid expression: >['pyls']}, 'whitelist': ['python'], })

Error detected while processing User Auto commands for "lsp_setup":
E116: Invalid arguments for function lsp#register_server

Any suggestion how to fix it???

Thanks

Go to definition for the second time fails

Hello, I am using vim 8.0 with vim-lsp and dart_language_server and found very disturbing issue. When the file is loaded and for the first time go to definition of the word under the cursor, it works fine. But then whenever I go back with (ctrl-o) and once again try to go to the definition of the same word it hangs on 'Retrieving definition ...' on other words, works fine but still only once. Because I don't know vimscript very well all I could find is that the second time it hangs on getbufline(bufnr(l:path), l:line)[0] in ui/vim/utils.vim:16. Another issue that might be related with this is when I had set

autocmd FileType dart setlocal shiftwidth=2 tabstop=2 expandtab

in my .vimrc file every time on go to definition and back, the shiftwidth was set to 8 (default value?), no idea why and had to change the line above from setlocal to just set to make it fixed. Is it some kind of buffer issue? How to fix it. Thank you in advance.

Flow doesn't work with Hover

I use vim-lsp with flow-language-server and have autocompletion, document symbols and go to definition commands. But hover doesn't work (I saw it in the code). When I call lspHover command I got Retrieving hover...

Here is vim-lsp log

Thu Dec 14 12:24:02 2017:["s:on_text_document_did_save()", 4]
Thu Dec 14 12:24:11 2017:[{"response": {"data": {"__data__": "vim-lsp", "server_name": "flow-language-server"}, "message": "server already started"}}]
Thu Dec 14 12:24:11 2017:[{"response": {"data": {"__data__": "vim-lsp", "init_result": {"id": 1, "jsonrpc": "2.0", "result": {"capabilities": {"hoverProvider": true, "documentSymbolProvider": true, "definitionProvider": true, "textDocumentSync": 2, "completionProvider": {"resolveProvider": true, "triggerCharacters": ["."]}}}}, "server_name": "flow-language-server"}, "message": "lsp server already initialized"}}]
Thu Dec 14 12:24:11 2017:[{"response": {"data": {"path": ".../src/example.js", "__data__": "vim-lsp", "server_name": "flow-language-server"}, "message": "already opened"}}]
Thu Dec 14 12:24:11 2017:[{"response": {"data": {"path": ".../src/example.js", "__data__": "vim-lsp", "server_name": "flow-language-server"}, "message": "not dirty"}}]
Thu Dec 14 12:24:11 2017:["--->", 2, "flow-language-server", {"method": "textDocument/hover", "on_notification": "---funcref---", "params": {"textDocument": {"uri": ".../src/example.js"}, "position": {"character": 11, "line": 205}}}]
Thu Dec 14 12:24:11 2017:["<---", 2, "flow-language-server", {"response": {"id": 16, "jsonrpc": "2.0", "result": {"range": {"end": {"character": 14, "line": 205}, "start": {"character": 4, "line": 205}}, "contents": {"language": "javascript", "value": "...code..."}}}, "request": {"method": "textDocument/hover", "jsonrpc": "2.0", "id": 16, "params": {"textDocument": {"uri": ".../src/example.js"}, "position": {"character": 11, "line": 205}}}}]
Thu Dec 14 12:24:11 2017:["s:on_stdout client request on_notification() error", "Vim(call):E714: List required"]

Initilization Status

Is there any way to get server initialization status?
I want to show on status line the server status.

send textDocument/close notifications

Currently vim-lsp doesn't send textDocument/close notifications. Need to send this notification so servers can do appropriate cleaning if they want. Make sure that the notification is only sent once all buffers for that filetype is closed.

Cant jump to c++ standard library header

Hello @prabirshrestha , I've run into a small issue using this plugin with cquery server. My environment is linux, c++ project with cmake build system. It works well, except one case when I try to jump to some class or function that is defined in standard library, for example a std::string. libstdc++ headers are usually located somewhere in /usr/include/c++/<compiler version>/. Server replies to my request like this:

2018 14:50:52:["<---",1,"cquery",{"response":{"id":16,"jsonrpc":"2.0",
"result":[{"uri":"file:///usr/include/c%2B%2B/7.2.0/bits/stringfwd.h",
"range":{"end":{"character":38,"line":73},"start":{"character":32,"line":73}}}]},
"request":{"method":"textDocument/definition","jsonrpc":"2.0","id":16,
"params":{"textDocument":{"uri":"file:///home/pablo/myproject/myfile.cpp"},
"position":{"character":26,"line":21}}}}]

As you can see, path to the header with string contains c%2B%2B, which is the root of this issue, as far as I can see. When vim opens a file, I see that '%' signs are substituted with a path to the original file, maybe it is treated like a mask somewhere in the plugin code. I've also seen cases when the path from cquery is just used as it is, with c%2B%2B. Anyway, vim is not able to find a file this way. I'm not sure if it is a bug in the plugin or in cquery, though. What do you think?

p.s. Thanks for your work on this plugin, it's so cool that now vim has a proper lsp support!

javascript function signatures

Is it possible to display function signatures for built in javascript (typescript) functions? Maybe after selecting, and typeing the '(' and show while inside of '( <> )'

Add omni completion support

It would be much appreciated if you could add support for Vim's built-in omni completion. This way, those who prefer not to use any third-party completion plugins can also enjoy LSP goodness.

I've tried to do it myself but my VimL knowledge isn't up to par ☹️.

Cannot read property 'ocamlmerlin' of undefined

Hello,

First off, thank you for your work on this awesome plugin. I am able to use the javascript server implementation with no issues.

However, my ocaml server is having issues that I would like to diagnose with you.

Setup:
WSL on Windows 10, running Ubuntu 17.04
Vim in Tmux

Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
let g:lsp_async_completion = 1
Fri 05 Jan 2018 08:45:01 AM STD:["lsp#register_server","server registered","ocaml-language-server"] Fri 05 Jan 2018 08:45:01 AM STD:["s:on_text_document_did_open()",1,"","/Documents/z/dashboard_frontend",null] Fri 05 Jan 2018 08:45:07 AM STD:["s:on_text_document_did_open()",1,"reason","/Documents/z/dashboard_frontend","file:///Documents/z/dashboard_frontend/src/app.re"] Fri 05 Jan 2018 08:45:07 AM STD:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":1,"server_name":"ocaml-language-server"},"message":"started lsp server successfully"}}] Fri 05 Jan 2018 08:45:07 AM STD:["--->",1,"ocaml-language-server",{"method":"initialize","params":{"rootUri":"file:///Documents/z/dashboard_frontend","initializationOptions":{},"capabilities":{},"rootPath":"/Documents/z/dashboard_frontend","trace":"off"}}] Fri 05 Jan 2018 08:45:07 AM STD:["<---",1,"ocaml-language-server",{"response":{"id":1,"jsonrpc":"2.0","error":{"code":-32603,"message":"Request initialize failed with message: Cannot read property 'ocamlmerlin' of undefined"}},"request":{"method":"initialize","jsonrpc":"2.0","id":1,"params":{"rootUri":"file:///Documents/z/dashboard_frontend","initializationOptions":{},"capabilities":{},"rootPath":"/Documents/z/dashboard_frontend","trace":"off"}}}] Fri 05 Jan 2018 08:45:15 AM STD:["s:on_text_document_did_close()",1]

As you can see, it appears that the ocaml server is being found and booted up, however any request put through the server fails. Above is a hover request.

Thanks!

Add a command to restart the language server

Sometimes LSP just stops working. I have to reload vim to get it to work again. Would be nice if there was a command like :LspRestart, so I don't have to lose all my state...

Jump to the top when retrieving defintion

Hi,

when I do Ctrl-] to get to the definition of the symbol under the cursor, it looks like the found definition is put just to the middle of the screen, so it looks I would press zz after the command. However, I would prefer if the found symbol was shown on the top of the screen. I have to literally run zt after every jump to the definition. Would it be possible to add some option switching vertical location of the jump target, please?

Thank you

clangd doesn't complete external libraries

clangd doesn't complete libaries that are not standard libraries. I realize that this is not an issue of vim-lsp, but since you provide instructions to set up clangd I wonder how this can be achieved.

Support for textDocument/signatureHelp

LSP supports parameter hints through textDocument/signatureHelp. Here's a recent usecase video demonstration on Sublime Text: https://reviews.llvm.org/D38048#889568. Hints just display information when filling/inspecting parameters but don't insert any text. Vim complete-items has an empty item that serves as flag for showing menu completions even when the word item for insertion text is empty. This is useful for showing current parameter information or current prototypes but not offering any completion text for what is displayed in the popup, with popup menu then just serving for display. I had implemented this for YCM a long time ago, even supporting triggers agnostic to surrounding whitespace (such hints are only shown right after the trigger — when the user starts typing after the trigger, hints are gone and normal completion is back, on my implementation). There's discussion on the rationale for different kinds of hints at https://reviews.llvm.org/D38048#888461. It may contain useful information on what to do when there's multiple overloads, long prototypes, etc.

I was wondering whether vim-lsp coupled with asyncomplete.vim could support this (if it doesn't already)?

vim-lsp appears to not be working for me

I am struggling to get vim-lsp working so off the back of #38 I have used the example vimrc given there. I have saved it below as examplerc.vim. (BTW, that's a great way to do testing :) )

So after pip install python-language-server and checking pyls is in my PATH I ran:

vim -u examplerc.vim test.py

test.py:

def greet(name):
    print 'Hello, ', name

greet('Jack')
greet('Jill')
greet('Bob')

And then tried, whilst the cursor is over one of the invocations of greet, :LspRename to which the reply is Renaming not support by python. All the Lsp* functions have similar responses. My processes show no launches for pyls as well.

I have tested with Vim 8.0.1098 and Neovim 0.2.0. Python version is 2.7.14. Full --version output below:

❯ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct  7 2017 14:12:12)
MacOS X (unix) version
Included patches: 1-1098
Compiled by MacPorts
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminal
++builtin_terms  +fork()          +multi_lang      +terminfo
+byte_offset     +gettext         -mzscheme        +termresponse
+channel         -hangul_input    +netbeans_intg   +textobjects
+cindent         +iconv           +num64           +timers
-clientserver    +insert_expand   +packages        +title
+clipboard       +job             +path_extra      -toolbar
+cmdline_compl   +jumplist        -perl            +user_commands
+cmdline_hist    +keymap          +persistent_undo +vertsplit
+cmdline_info    +lambda          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
-cscope          +lispindent      +python3/dyn     +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      +lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      +startuptime     -xpm
+eval            +mouse_dec       +statusline      -xsmp
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_clipboard
+extra_search    -mouse_jsbterm   +syntax          -xterm_save
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "/opt/local/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/opt/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -I/opt/local/include -DMACOS_X_UNIX  -pipe -Os -arch x86_64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang   -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -o vim        -lm  -lncurses -liconv -lintl -framework Cocoa  -L/opt/local/lib -llua

❯ nvim --version
NVIM v0.2.0
Build type: Release
Compilation: /usr/bin/clang -pipe -Os -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/config -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/neovim-0.2.0/src -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/src/nvim/auto -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/local/share/nvim"

Rename not working properly

I'm not sure if this belongs here or the language server. I'm using vim8 with the javascript. I followed the examples and most things work fine except for the rename. When I perform a rename, the word seems to get mixed with the previous word.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.