-
Notifications
You must be signed in to change notification settings - Fork 73
Completion is one character behind in neovim #432
Comments
Since it's just a warning, does it impact the functionality in any way? |
In a sample file like this: import React from 'react';
React. There's no completion after the dot (I have it set as a trigger, manually triggering the completion also doesn't work). Heres a dump of the requests to the server: https://gist.github.com/kyrisu/8420bc5d289b530caa4813c656fe64c3 |
I don't see any |
You are right - by accident I've cut the logs short :/ After running it few more times and I realize there are times when I don't see these warnings. After commenting out my deoplete config I got to the point where I'm experiencing the same issue as in #423 Interestingly enough when I type this: const a = [];
a. The first time I type the dot I get the proper completion options, then I try to remove it and retype it again and I get the invalid ones. https://gist.github.com/kyrisu/3797ace47fe2cfa7d32da5685aa73791 (line 630 is when I got the proper completion) |
So you're saying you get no completions? Because I don't see a |
I think you might be looking at the first gist - I've created a new one (linked in the previous comment). You can see I get correct completion on line 598 in the logs:
Unfortunately then on line 649 I get random suggestions without context. |
Sorry, but I don't know what suggestions you would expect? According to the last
This is the content of the file: const a = [];
a With the cursor being at |
If that is not the file content you were seeing on screen then that's a bug in the client |
Thank you very much for your help today - I will tinker with this tomorrow and hopefully find what's wrong. |
I'm seeing this too on Vim and it makes it impossible to use the As far as I can tell I only see these issues when the project has a |
@sQVe try adding {
"compilerOptions": {
"target": "es2017",
"checkJs": true,
"allowSyntheticDefaultImports": true
},
"exclude": ["node_modules"]
} This should force the language server to ignore node_modules if this is the issue in your case. |
@sQVe for external modules try |
@kyrisu How does that make a difference? I've installed all dependencies the regular way. I don't really have the freedom to change the whole package.json just got it to work on my machine. |
@sQVe For me, it solved the issue of not being able to find external modules. Editors like VS Code download types for us but it seems that language servers do not. You don't need to modify your package.json - just install them without saving in dependencies. As I've mentioned before - it's not the full solution but just something that may be worth trying. Btw - I've since switched to nvim-typescript with javascript support enabled which seems to work. |
@kyrisu I'm currently running |
@sQVe -
|
@kyrisu |
Closing this issue since it seems to be a bug in the neovim client (#432 (comment)) |
@felixfbecker, |
@kreedz - probably so as I was using LanguageClient-neovim when I have opened this issue. I have also opened an issue there: autozimu/LanguageClient-neovim#316 but it was closed with:
so I gave up :) |
Made a gif where you can see: nvim --version: call plug#begin('~/.local/share/nvim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
let g:deoplete#enable_at_startup = 1
language messages C
let g:python_host_prog = '/usr/bin/python'
let g:python3_host_prog = '/usr/bin/python3'
" LanguageClient
let g:LanguageClient_serverCommands = {
\ 'javascript': ['javascript-typescript-stdio'],
\ 'javascript.jsx': ['javascript-typescript-stdio'],
\ 'typescript': ['javascript-typescript-stdio'],
\ }
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
autocmd BufNewFile,BufRead *.ts set filetype=typescript
au BufNewFile,BufRead *.tsx set filetype=typescript
nnoremap <silent><CR> :noh<CR><CR>
|
@kreedz this issue has already been debugged above, please read the thread. The warning messages are only warnings, they are unrelated to completion. The client didn't sync the most up-to-date document content before requesting completion. |
Thank you for the quick response! Warnings are related to javascript-typescript-langserver? |
You can fix them by doing a PR that makes sure the files requested by TS are fetched before initializing TS. But you should expect the logging window to always have a lot of output, that's the point of logs... |
Anyway it's not the cause of OP's issue so please open a new issue to not clutter this thread more. |
If I see something like an error or a warning in the logs, I'm trying to figure out what it is and how to fix it, rather than just leaving it if it does not even impact the functionality. |
@kyrisu I have also been facing this problem, so I thought I would have a look in the logs of the typescript server. I'm using javascript-typescript-langserver v2.11.2 and Changing my
to this (I added a log)
Has fixed the problem for me. @felixfbecker it makes me wonder if there is an issue with the javascript-typescript-langserver? |
@piersy suggestion worked for me too. It is possible that |
I have installed the plugin together with LanguageClient-neovim and Deoplete, but for some reason I get the following warning (in neovim messages) for multiple files:
Files exist as I can access them by copying & pasting the path into the console.
Any help help would be appreciated - it seems to be something on my machine as I didn't find similar issue on github but looking at traces from the langserver I do not see other warnings or errors.
I'm happy to provide logs / traces but the
-t
switch doesn't seem to work with stdio version of the server (file pass to-l
switch is empty).The text was updated successfully, but these errors were encountered: