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

unhandled method textDocument/* #1

Closed
derekstavis opened this issue May 8, 2018 · 7 comments · Fixed by #5
Closed

unhandled method textDocument/* #1

derekstavis opened this issue May 8, 2018 · 7 comments · Fixed by #5

Comments

@derekstavis
Copy link

derekstavis commented May 8, 2018

Hey, thanks for this package!! 👍

I have been trying to setup this language server with my neovim but I couldn't find a way to make it work.

Whenever I try to issue a command to it I get this unhandled method textDocument/*, where * is the command name. Here is my neovim setup:

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }

set hidden

let nodejs_prefix = systemlist('npm config get prefix')[0]

let g:LanguageClient_serverCommands = {
    \ 'css': [nodejs_prefix . '/bin/css-languageserver', '--stdio'],
    \ 'javascript': [nodejs_prefix . '/bin/js-langserver', '--stdio'],
    \ 'javascript.jsx': [nodejs_prefix . '/bin/js-langserver', '--stdio'],
    \ }

" Automatically start language servers.
let g:LanguageClient_autoStart = 1

nnoremap <silent> <leader>hv :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> <leader>gt :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <leader>rn :call LanguageClient#textDocument_rename()<CR>

I have double checked and the langserver is running:

screenshot from 2018-05-08 09-55-08

Is there something I'm doing the wrong way in here?

@bbenne10
Copy link

I'm running into this too after setting up emacs + lsp-mode. Further, I'm seeing an earlier debug message reported, as marked below with (**):

Turning on magit-auto-revert-mode...done
For information about GNU Emacs and the GNU system, type C-h C-a.
(**)Error from the Language Server: Request initialize failed with message: Cannot convert undefined or null to object (Internal Error)
File mode specification error: (lsp-empty-response-error initialize)
Error from the Language Server: Unhandled method textDocument/hover (Method not Found) [5 times]
mwheel-scroll: Beginning of buffer
Error from the Language Server: Unhandled method textDocument/hover (Method not Found) [2 times]

Unfortunately, I don't have any more information about WHAT is null or undefined.

This is a shame, as there's no real good alternative to this project for lsp for typescript-less JS development at the moment. I certainly hope we can resolve this!

@bbenne10
Copy link

bbenne10 commented Jun 22, 2018

If it helps I am happy to highlight the relevant bits of my emacs config. It looks like both the standard project setup instructions and @derekstavis are doing much the same thing I have to do, but in VimL rather than elisp so I'm not sure it will help the issue. If you want them, just ask.

@huyvohcmc
Copy link

huyvohcmc commented Sep 16, 2018

This js lang server just doesn't work at all. None of unhandled method textDocument/* work with this nvim config:

call plug#begin('~/.config/nvim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
      \ 'branch': 'next',
      \ 'do': 'bash install.sh',
      \ }
call plug#end()

let g:LanguageClient_serverCommands = {
      \ 'ruby': ['solargraph', 'stdio'],
      \ 'javascript': ['js-langserver', '--stdio'],
      \ 'javascript.jsx': ['js-langserver', '--stdio'],
      \ }
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>

@iamFIREcracker
Copy link
Contributor

Hey guys,

I have spent quite some time on this today trying to make it work, and I finally made it! I have already created a PR to tweak the ESLint integration, and soon will create a new one to fix the integration with Tern.

If you want to play around with my work, I pushed all my changes to my 'dev' branch -- https://github.com/iamFIREcracker/js-langserver/tree/dev

Let me know if that fixes some of the issues you were having.

Ciao,
Matteo

@tbodt
Copy link
Owner

tbodt commented Dec 5, 2018

oh god how did I not notice this issue for 7 months

@derekstavis
Copy link
Author

oh god how did I not notice this issue for 7 months

because GitHub notifications are usually so bloated that no one reads them 😂

@mwilliammyers
Copy link
Contributor

@iamFIREcracker unfortunately I am still getting the same error

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

Successfully merging a pull request may close this issue.

6 participants