mattn / efm-langserver

General purpose Language Server
MIT License
1.37k stars 62 forks source link

filetype: No filetypes defined, please define filetypes in setup() using neovim buildin LSP with nvim-lspconfig #118

Open kierun opened 3 years ago

kierun commented 3 years ago

I use the configuration file from the main repo verbatim. In my ~/.config/nvim/vim.init, I have:

lua << EOF
require "lspconfig".efm.setup { }
EOF

I have tried bash and Python files and nothing is happening. I tried running LspInfo and got this:

 Clients that match the filetype python: 

  Config: efm 
    filetype: No filetypes defined, please define filetypes in setup(). 

However, at this point, I am a little lost. The filetypes seem to be defined fine since neovim can tell which file type I am editing -- and launches correctly pyright for Python files.

Any suggestion as to what I am doing wrong?

rockerBOO commented 3 years ago

I have this same message but the client attaches for me. Would check the lsp log that's stated in :LspInfo.

Ex:

Configured servers: efm, elixirls, sumneko_lua, gopls, cssls, vimls, bashls, tsserver, rust_analyzer
Neovim logs at: /home/rockerboo/.config/cache/nvim/lsp.log

2 client(s) attached to this buffer: efm, tsserver

  Client: efm (id 1)
    root:      /home/rockerboo/code/ecogarden
    filetypes: 
    cmd:       efm-langserver

  Client: tsserver (id 2)
    root:      /home/rockerboo/code/ecogarden/create
    filetypes: javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx
    cmd:       typescript-language-server --stdio

2 active client(s): 

  Client: efm (id 1)
    root:      /home/rockerboo/code/ecogarden
    filetypes: 
    cmd:       efm-langserver

  Client: tsserver (id 2)
    root:      /home/rockerboo/code/ecogarden/create
    filetypes: javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx
    cmd:       typescript-language-server --stdio

Clients that match the filetype javascript:

Config: efm
    filetype: No filetypes defined, please define filetypes in setup().

  Config: tsserver
    cmd:               typescript-language-server --stdio
    cmd is executable: True
    identified root:   /home/rockerboo/code/ecogarden/create
    custom handlers:   
kierun commented 3 years ago

@rockerBOO There is nothing of note in the EFM log, even at level 10. Weird.

lukas-reineke commented 3 years ago

You don't have to define a filetype. If there is no filetype defined, Neovim will try to attach EFM to every buffer, and only the ones for which EFM has a configuration will work.

Especially for the EFM wildcard this is how it should work.

If you want to, you can of course define the filetype in setup. But you can ignore that error. (at least for now, there was some discussion to maybe change how this works in Neovim core)

jack828 commented 3 years ago

I had some issues like this (it would attach and report that it also didn't attach!) when using the config.yaml approach and ended up switching entirely to lua based config.

You could try that and see if it resolves your problem?

kierun commented 3 years ago

If you want to, you can of course define the filetype in setup. But you can ignore that error. (at least for now, there was some discussion to maybe change how this works in Neovim core)

I could ignore the error, however, EFM does not work so that is not that useful. Neither black nor isort provide any informations whatsoever in Python files.

I had some issues like this (it would attach and report that it also didn't attach!) when using the config.yaml approach and ended up switching entirely to lua based config.

You could try that and see if it resolves your problem?

I shall try that and see if it makes any difference. My config file is still the old style and converting it all to lua will take time and effort.

However, I hope that just a lua fragment will do the trick…

lukas-reineke commented 3 years ago

I could ignore the error, however, EFM does not work so that is not that useful.

That EFM doesn't work is 100% unrelated to this error.

Can you share your EFM config, and Neovims LSP log?

Configuring EFM through the config file or through lua should not make any difference.

kierun commented 3 years ago

Can you share your EFM config, and Neovims LSP log?

Sure thing. EFM config is a verbatim copy of the one in the repo. No changes whatsoever, just a log file at verbosity 10 as per the main repo.

In my ~/.config/nvim/vim.init, I have:

" EFM LSP
" https://github.com/mattn/efm-langserver
" -▼-
lua << EOF
require "lspconfig".efm.setup { }
EOF

The log file:

2021/04/30 10:23:16 jsonrpc2: --> request #1: initialize: {"rootUri":"file:///home/usr/proj/github/deployment-docker-compose","initializationOptions":{},"capabilities":{"window":{"showDocument":{"support":false},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":false}},"workDoneProgress":true},"workspace":{"workspaceFolders":true,"applyEdit":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalWorkspaceSymbolSupport":true},"configuration":true},"callHierarchy":{"dynamicRegistration":false},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"completion":{"completionItem":{"preselectSupport":false,"commitCharactersSupport":false,"snippetSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"]},"contextSupport":false,"dynamicRegistration":false,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false},"rename":{"prepareSupport":true,"dynamicRegistration":false},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"references":{"dynamicRegistration":false},"definition":{"linkSupport":true},"documentHighlight":{"dynamicRegistration":false},"typeDefinition":{"linkSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"synchronization":{"didSave":true,"willSaveWaitUntil":false,"willSave":false,"dynamicRegistration":false},"declaration":{"linkSupport":true},"implementation":{"linkSupport":true}}},"rootPath":"/home/usr/proj/github/deployment-docker-compose","clientInfo":{"version":"0.5.0","name":"Neovim"},"processId":45520,"trace":"off","workspaceFolders":[{"uri":"file:///home/usr/proj/github/deployment-docker-compose","name":"/home/usr/proj/github/deployment-docker-compose"}]}
2021/04/30 10:23:16 jsonrpc2: <-- result #1: initialize: {"capabilities":{"textDocumentSync":1,"definitionProvider":true,"documentFormattingProvider":true,"hoverProvider":true,"codeActionProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}
2021/04/30 10:23:16 jsonrpc2: --> notif: initialized: {}
2021/04/30 10:23:34 jsonrpc2: --> request #1: initialize: {"rootUri":"file:///home/usr","initializationOptions":{},"workspaceFolders":[{"uri":"file:///home/usr","name":"/home/usr"}],"rootPath":"/home/usr","clientInfo":{"version":"0.5.0","name":"Neovim"},"processId":45863,"trace":"off","capabilities":{"callHierarchy":{"dynamicRegistration":false},"window":{"showDocument":{"support":false},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":false}},"workDoneProgress":true},"workspace":{"workspaceFolders":true,"configuration":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalWorkspaceSymbolSupport":true},"applyEdit":true},"textDocument":{"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"references":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"rename":{"prepareSupport":true,"dynamicRegistration":false},"implementation":{"linkSupport":true},"completion":{"completionItem":{"snippetSupport":false,"commitCharactersSupport":false,"preselectSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"]},"contextSupport":false,"dynamicRegistration":false,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"documentHighlight":{"dynamicRegistration":false},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false},"typeDefinition":{"linkSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"synchronization":{"dynamicRegistration":false,"willSaveWaitUntil":false,"willSave":false,"didSave":true},"declaration":{"linkSupport":true},"definition":{"linkSupport":true}}}}
2021/04/30 10:23:34 jsonrpc2: <-- result #1: initialize: {"capabilities":{"textDocumentSync":1,"definitionProvider":true,"documentFormattingProvider":true,"hoverProvider":true,"codeActionProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}
2021/04/30 10:23:34 jsonrpc2: --> notif: initialized: {}
2021/04/30 10:23:47 jsonrpc2: --> request #2: shutdown: null
2021/04/30 10:25:53 jsonrpc2: --> request #2: shutdown: null

Configuring EFM through the config file or through lua should not make any difference.

I thought so too! ^_^

:LspInfo was the only thing I could see…

lukas-reineke commented 3 years ago

I don't think that's the LSP log. You get the path like this, :lua print(vim.lsp.get_log_path())

kierun commented 3 years ago

That is the entry when I run :lua print(vim.lsp.get_log_path()):

[ ERROR ] 2021-05-04T10:50:59+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:455 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/04 10:50:59 efm-langserver: reading on stdin, writing on stdout\n"

Any idea?

lukas-reineke commented 3 years ago

Looks normal so far, have you tried to use the server now? Try running :lua vim.lsp.buf.formatting_sync({},1000) and print the output again

kierun commented 3 years ago

Aha, thank you! Now, I am getting some errors:

[ ERROR ] 2021-05-05T10:41:19+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:455 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/05 10:41:19 efm-langserver: reading on stdin, writing on stdout\n"
[ WARN ] 2021-05-05T10:41:20+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ ERROR ] 2021-05-05T10:41:20+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:375 ]    "stubPath /home/usr/proj/github/deployment-docker-compose/typings is not a valid directory."
[ ERROR ] 2021-05-05T10:41:20+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:375 ]    "Exception received when installing recursive file system watcher"
[ WARN ] 2021-05-05T10:41:26+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp.lua:87 ]   "method textDocument/formatting is not supported by any of the servers registered for the current buffer"

@lukas-reineke Thank you so much for taking the time to go through this with me. It is much appreciated.

lukas-reineke commented 3 years ago

hmm this looks like your EFM does not have any formatters configured for python. Are you sure you have the correct file in the correct place? And if you run :set filetype in vim, it matches the key in the EFM config under languages?

kierun commented 3 years ago

I think I have the files in the right place:

√ ; ls ~/.config/efm-langserver/config.yaml
/home/usr/.config/efm-langserver/config.yaml
√ ; rg python ~/.config/efm-langserver/config.yaml
55:  python-flake8: &python-flake8
61:  python-mypy: &python-mypy
68:  python-black: &python-black
72:  python-autopep8: &python-autopep8
76:  python-yapf: &python-yapf
80:  python-isort: &python-isort
180:  python:
181:    - <<: *python-flake8
182:    - <<: *python-mypy
183:    # - <<: *python-autopep8
184:    # - <<: *python-yapf
185:    - <<: *python-black
186:    - <<: *python-isort

The set filetype returns python and I do get other Python (pyright by default) LSP working there fine. It is either black or isort which are not working at all.

lukas-reineke commented 3 years ago

If black or isort were the problem, you would see that in the logs. It looks like EFM is not responding with the correct capabilities. Not sure why though.

Can you try to change the EFM setup to this?

lspconfig.efm.setup {
    init_options = {documentFormatting = true},
}

This will overwrite the capabilities so that formatting is on.

kierun commented 3 years ago

I tried that and this is what I got…

Contents of ~/.cache/nvim/lsp.log follow:

[ ERROR ] 2021-05-11T08:36:56+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:455 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 08:36:56 efm-langserver: reading on stdin, writing on stdout\n"
[ WARN ] 2021-05-11T08:36:56+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"

[ ERROR ] 2021-05-11T08:37:02+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:455 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 08:37:02 efm-langserver: reading on stdin, writing on stdout\n"

And :LspInfo:

Configured servers: rust_analyzer, efm, pyright, gopls 

  1 client(s) attached to this buffer: pyright 

    Client: pyright (id 1) 
        root:      /home/usr 
        filetypes: python 
        cmd:       pyright-langserver --stdio 

  2 active client(s):  

    Client: pyright (id 1) 
        root:      /home/usr 
        filetypes: python 
        cmd:       pyright-langserver --stdio 

    Client: efm (id 2) 
        root:      /home/usr 
        filetypes:  
        cmd:       efm-langserver 

  Clients that match the filetype python: 

  Config: efm 
    filetype: No filetypes defined, please define filetypes in setup(). 

    Config: pyright 
        cmd:               pyright-langserver --stdio 
        cmd is executable: True 
        identified root:   /home/usr 
        custom handlers:   

and efm.log:

2021/05/11 08:32:28 jsonrpc2: --> request #1: initialize: {"rootUri":"file:///home/usr","initializationOptions":{"documentFormatting":true},"capabilities":{"window":{"showDocument":{"support":false},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":false}},"workDoneProgress":true},"workspace":{"workspaceFolders":true,"configuration":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalWorkspaceSymbolSupport":true},"applyEdit":true},"callHierarchy":{"dynamicRegistration":false},"textDocument":{"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"references":{"dynamicRegistration":false},"documentHighlight":{"dynamicRegistration":false},"rename":{"prepareSupport":true,"dynamicRegistration":false},"definition":{"linkSupport":true},"completion":{"completionItem":{"snippetSupport":false,"commitCharactersSupport":false,"preselectSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"]},"contextSupport":false,"dynamicRegistration":false,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"synchronization":{"didSave":true,"willSaveWaitUntil":false,"willSave":false,"dynamicRegistration":false},"typeDefinition":{"linkSupport":true},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false},"declaration":{"linkSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"implementation":{"linkSupport":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false}}},"rootPath":"/home/usr","clientInfo":{"version":"0.5.0","name":"Neovim"},"processId":10737,"trace":"off","workspaceFolders":[{"uri":"file:///home/usr","name":"/home/usr"}]}
2021/05/11 08:32:28 jsonrpc2: <-- result #1: initialize: {"capabilities":{"textDocumentSync":1,"definitionProvider":true,"documentFormattingProvider":true,"hoverProvider":true,"codeActionProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}
2021/05/11 08:32:28 jsonrpc2: --> notif: initialized: {}
2021/05/11 08:33:47 jsonrpc2: --> request #2: shutdown: null
lukas-reineke commented 3 years ago

And then run :lua vim.lsp.buf.formatting_sync({},1000) again, or nothing will happen.

kierun commented 3 years ago

Got this:

E5108: Error executing lua /home/usr/share/nvim/runtime/lua/vim/lsp.lua:1145: table index is nil
lukas-reineke commented 3 years ago

Can you please update to the latest version of Neovim and try again?

kierun commented 3 years ago

Can you please update to the latest version of Neovim and try again?

I was just doing that before I saw your message… :grin:

Output from ~/.cache/nvim/lsp.log:

[ START ] 2021-05-11T09:40:31+0100 ] LSP logging initiated
[ ERROR ] 2021-05-11T09:40:31+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 09:40:31 efm-langserver: reading on stdin, writing on stdout\n"
[ WARN ] 2021-05-11T09:40:31+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ ERROR ] 2021-05-11T09:40:43+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:410 ]    "stubPath /home/usr/typings is not a valid directory."
[ ERROR ] 2021-05-11T09:40:57+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "panic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code="
[ ERROR ] 2021-05-11T09:40:57+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "0x1 addr=0x20 pc=0x563d8a]\n\ngoroutine 7 [running]:\ntime.(*Timer).Stop(...)\n\t/usr/lib/golang/src/time/sleep.go:76\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc0000e4160, 0x5f6640, 0xc00001a140, 0xc0000d2120, 0xc000092410, 0xc0000922d0, 0x5cb698, 0xc00018dd68, 0x4d9b7e)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc0000e4160, 0x5f6640, 0xc00001a140, 0xc0000d2120, 0xc000092410, 0x22, 0xc000097920, 0x3, 0x3)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc0000ff4b0, 0x5f6640, 0xc00001a140, 0xc0000d2120, 0xc000092410)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20191222043438-96c4efab7ee2/handler_with_error.go:21 +0x73\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000d2120, 0x5f6640, 0xc00001a140)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20191222043438-96c4efab7ee2/jsonrpc2.go:522 +0x57e\n"
[ ERROR ] 2021-05-11T09:40:57+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "created by github.com/sourcegraph/jsonrpc2.NewConn\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.0.0-20191222043438-96c4efab7ee2/jsonrpc2.go:334 +0x1d5\n"
[ START ] 2021-05-11T09:40:59+0100 ] LSP logging initiated
[ ERROR ] 2021-05-11T09:41:00+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 09:41:00 efm-langserver: reading on stdin, writing on stdout\n"

Neovim version:

NVIM v0.5.0-dev+1315-g133351cbf
Build type: Debug
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=1 -I/home/usr/src/neovim/build/config -I/home/usr/src/neovim/src -I/home/usr/src/neovim/.deps/usr/include -I/usr/include -I/home/usr/src/neovim/build/src/nvim/auto -I/home/usr/src/neovim/build/include
Compiled by usr@nightwatch.example.com

Features: +acl +iconv +tui
See ":help feature-compile"

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

Run :checkhealth for more info
lukas-reineke commented 3 years ago

the panic looks like the same error as https://github.com/mattn/efm-langserver/issues/117

but that looks like a different problem. Run the formatting command again now in the latest version of neovim

kierun commented 3 years ago

The command (lua vim.lsp.buf.formatting_sync({},1000)) returns nothing in neovim itself.

Here's ~/.cache/nvim/lsp.log:

[ START ] 2021-05-11T11:47:46+0100 ] LSP logging initiated
[ ERROR ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 11:47:47 efm-langserver: reading on stdin, writing on stdout\n"
[ WARN ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "panic: runtime error: invalid memory address or nil pointer dereference\n"
[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564e8a]\n\ngoroutine 7 [running]:\ntime.(*Timer).Stop(...)\n\t/usr/lib/golang/src/time/sleep.go:76\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc0000e4160, 0x5f7780, "
[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "0xc00001a160, 0xc0000d2120, 0xc000092410, 0xc0000922d0, 0x5cc768, 0xc000189d68, 0x4d9bbe)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc0000e4160, 0x5f7780, "
[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "0xc00001a160, 0xc0000d2120, 0xc000092410, 0x22, 0xc000097920, 0x3, 0x3)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc0000ff4b0, 0x5f7780"
[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    ", 0xc00001a160, 0xc0000d2120, 0xc000092410)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/handler_with_error.go:21 +0x73\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000d2120, 0x5f7780, 0xc00001a160)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x57e\ncreated by github.com/sourcegraph/jsonrpc2.NewConn\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x1d5\n"
[ START ] 2021-05-11T11:47:53+0100 ] LSP logging initiated
[ ERROR ] 2021-05-11T11:47:53+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/11 11:47:53 efm-langserver: reading on stdin, writing on stdout\n"

and efm.log:

2021/05/11 11:47:47 jsonrpc2: --> request #1: initialize: {"initializationOptions":{"documentFormatting":true},"rootUri":"file:///home/usr","workspaceFolders":[{"uri":"file:///home/usr","name":"/home/usr"}],"rootPath":"/home/usr","clientInfo":{"version":"0.5.0","name":"Neovim"},"processId":53495,"trace":"off","capabilities":{"workspace":{"workspaceFolders":true,"workspaceEdit":{"resourceOperations":["rename","create","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalWorkspaceSymbolSupport":true},"configuration":true},"window":{"showDocument":{"support":false},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":false}},"workDoneProgress":true},"callHierarchy":{"dynamicRegistration":false},"textDocument":{"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"references":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"rename":{"prepareSupport":true,"dynamicRegistration":false},"definition":{"linkSupport":true},"synchronization":{"didSave":true,"willSaveWaitUntil":false,"willSave":false,"dynamicRegistration":false},"completion":{"completionItem":{"preselectSupport":false,"commitCharactersSupport":false,"snippetSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"]},"contextSupport":false,"dynamicRegistration":false,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"documentHighlight":{"dynamicRegistration":false},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"declaration":{"linkSupport":true},"implementation":{"linkSupport":true},"typeDefinition":{"linkSupport":true}}}}
2021/05/11 11:47:47 jsonrpc2: <-- result #1: initialize: {"capabilities":{"textDocumentSync":1,"definitionProvider":true,"documentFormattingProvider":true,"hoverProvider":true,"codeActionProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}
2021/05/11 11:47:47 jsonrpc2: --> notif: initialized: {}
2021/05/11 11:47:50 jsonrpc2: --> request #2: shutdown: null
2021/05/11 11:47:54 jsonrpc2: --> request #1: initialize: {"rootUri":"file:///home/usr","initializationOptions":{"documentFormatting":true},"workspaceFolders":[{"uri":"file:///home/usr","name":"/home/usr"}],"rootPath":"/home/usr","clientInfo":{"version":"0.5.0","name":"Neovim"},"processId":53788,"trace":"off","capabilities":{"callHierarchy":{"dynamicRegistration":false},"window":{"showDocument":{"support":false},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":false}},"workDoneProgress":true},"workspace":{"workspaceFolders":true,"configuration":true,"workspaceEdit":{"resourceOperations":["rename","create","delete"]},"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalWorkspaceSymbolSupport":true},"applyEdit":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false},"rename":{"prepareSupport":true,"dynamicRegistration":false},"references":{"dynamicRegistration":false},"synchronization":{"didSave":true,"willSaveWaitUntil":false,"willSave":false,"dynamicRegistration":false},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","Empty","QuickFix","Refactor","RefactorExtract","RefactorInline","RefactorRewrite","Source","SourceOrganizeImports","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"documentHighlight":{"dynamicRegistration":false},"typeDefinition":{"linkSupport":true},"completion":{"completionItem":{"preselectSupport":false,"commitCharactersSupport":false,"snippetSupport":false,"deprecatedSupport":false,"documentationFormat":["markdown","plaintext"]},"contextSupport":false,"dynamicRegistration":false,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"declaration":{"linkSupport":true},"implementation":{"linkSupport":true},"definition":{"linkSupport":true}}}}
2021/05/11 11:47:54 jsonrpc2: <-- result #1: initialize: {"capabilities":{"textDocumentSync":1,"definitionProvider":true,"documentFormattingProvider":true,"hoverProvider":true,"codeActionProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}
2021/05/11 11:47:54 jsonrpc2: --> notif: initialized: {}
2021/05/11 11:48:02 jsonrpc2: --> notif: textDocument/didOpen: {"textDocument":{"uri":"file:///home/usr/efm.log","version":0,"languageId":"","text":"2021/05/11 11:47:47 jsonrpc2: --\u003e request #1: initialize: {\"initializationOptions\":{\"documentFormatting\":true},\"rootUri\":\"file:///home/usr\",\"workspaceFolders\":[{\"uri\":\"file:///home/usr\",\"name\":\"/home/usr\"}],\"rootPath\":\"/home/usr\",\"clientInfo\":{\"version\":\"0.5.0\",\"name\":\"Neovim\"},\"processId\":53495,\"trace\":\"off\",\"capabilities\":{\"workspace\":{\"workspaceFolders\":true,\"workspaceEdit\":{\"resourceOperations\":[\"rename\",\"create\",\"delete\"]},\"applyEdit\":true,\"symbol\":{\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},\"dynamicRegistration\":false,\"hierarchicalWorkspaceSymbolSupport\":true},\"configuration\":true},\"window\":{\"showDocument\":{\"support\":false},\"showMessage\":{\"messageActionItem\":{\"additionalPropertiesSupport\":false}},\"workDoneProgress\":true},\"callHierarchy\":{\"dynamicRegistration\":false},\"textDocument\":{\"documentSymbol\":{\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},\"dynamicRegistration\":false,\"hierarchicalDocumentSymbolSupport\":true},\"references\":{\"dynamicRegistration\":false},\"publishDiagnostics\":{\"relatedInformation\":true,\"tagSupport\":{\"valueSet\":[1,2]}},\"rename\":{\"prepareSupport\":true,\"dynamicRegistration\":false},\"definition\":{\"linkSupport\":true},\"synchronization\":{\"didSave\":true,\"willSaveWaitUntil\":false,\"willSave\":false,\"dynamicRegistration\":false},\"completion\":{\"completionItem\":{\"preselectSupport\":false,\"commitCharactersSupport\":false,\"snippetSupport\":false,\"deprecatedSupport\":false,\"documentationFormat\":[\"markdown\",\"plaintext\"]},\"contextSupport\":false,\"dynamicRegistration\":false,\"completionItemKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"Empty\",\"QuickFix\",\"Refactor\",\"RefactorExtract\",\"RefactorInline\",\"RefactorRewrite\",\"Source\",\"SourceOrganizeImports\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}},\"dynamicRegistration\":false},\"documentHighlight\":{\"dynamicRegistration\":false},\"signatureHelp\":{\"signatureInformation\":{\"documentationFormat\":[\"markdown\",\"plaintext\"]},\"dynamicRegistration\":false},\"hover\":{\"dynamicRegistration\":false,\"contentFormat\":[\"markdown\",\"plaintext\"]},\"declaration\":{\"linkSupport\":true},\"implementation\":{\"linkSupport\":true},\"typeDefinition\":{\"linkSupport\":true}}}}\n2021/05/11 11:47:47 jsonrpc2: \u003c-- result #1: initialize: {\"capabilities\":{\"textDocumentSync\":1,\"definitionProvider\":true,\"documentFormattingProvider\":true,\"hoverProvider\":true,\"codeActionProvider\":true,\"workspace\":{\"workspaceFolders\":{\"supported\":true,\"changeNotifications\":true}}}}\n2021/05/11 11:47:47 jsonrpc2: --\u003e notif: initialized: {}\n2021/05/11 11:47:50 jsonrpc2: --\u003e request #2: shutdown: null\n2021/05/11 11:47:54 jsonrpc2: --\u003e request #1: initialize: {\"rootUri\":\"file:///home/usr\",\"initializationOptions\":{\"documentFormatting\":true},\"workspaceFolders\":[{\"uri\":\"file:///home/usr\",\"name\":\"/home/usr\"}],\"rootPath\":\"/home/usr\",\"clientInfo\":{\"version\":\"0.5.0\",\"name\":\"Neovim\"},\"processId\":53788,\"trace\":\"off\",\"capabilities\":{\"callHierarchy\":{\"dynamicRegistration\":false},\"window\":{\"showDocument\":{\"support\":false},\"showMessage\":{\"messageActionItem\":{\"additionalPropertiesSupport\":false}},\"workDoneProgress\":true},\"workspace\":{\"workspaceFolders\":true,\"configuration\":true,\"workspaceEdit\":{\"resourceOperations\":[\"rename\",\"create\",\"delete\"]},\"symbol\":{\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},\"dynamicRegistration\":false,\"hierarchicalWorkspaceSymbolSupport\":true},\"applyEdit\":true},\"textDocument\":{\"publishDiagnostics\":{\"relatedInformation\":true,\"tagSupport\":{\"valueSet\":[1,2]}},\"documentSymbol\":{\"symbolKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},\"dynamicRegistration\":false,\"hierarchicalDocumentSymbolSupport\":true},\"signatureHelp\":{\"signatureInformation\":{\"documentationFormat\":[\"markdown\",\"plaintext\"]},\"dynamicRegistration\":false},\"rename\":{\"prepareSupport\":true,\"dynamicRegistration\":false},\"references\":{\"dynamicRegistration\":false},\"synchronization\":{\"didSave\":true,\"willSaveWaitUntil\":false,\"willSave\":false,\"dynamicRegistration\":false},\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"Empty\",\"QuickFix\",\"Refactor\",\"RefactorExtract\",\"RefactorInline\",\"RefactorRewrite\",\"Source\",\"SourceOrganizeImports\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}},\"dynamicRegistration\":false},\"hover\":{\"dynamicRegistration\":false,\"contentFormat\":[\"markdown\",\"plaintext\"]},\"documentHighlight\":{\"dynamicRegistration\":false},\"typeDefinition\":{\"linkSupport\":true},\"completion\":{\"completionItem\":{\"preselectSupport\":false,\"commitCharactersSupport\":false,\"snippetSupport\":false,\"deprecatedSupport\":false,\"documentationFormat\":[\"markdown\",\"plaintext\"]},\"contextSupport\":false,\"dynamicRegistration\":false,\"completionItemKind\":{\"valueSet\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},\"declaration\":{\"linkSupport\":true},\"implementation\":{\"linkSupport\":true},\"definition\":{\"linkSupport\":true}}}}\n2021/05/11 11:47:54 jsonrpc2: \u003c-- result #1: initialize: {\"capabilities\":{\"textDocumentSync\":1,\"definitionProvider\":true,\"documentFormattingProvider\":true,\"hoverProvider\":true,\"codeActionProvider\":true,\"workspace\":{\"workspaceFolders\":{\"supported\":true,\"changeNotifications\":true}}}}\n2021/05/11 11:47:54 jsonrpc2: --\u003e notif: initialized: {}\n"}}
2021/05/11 11:48:02 lint for LanguageID not supported: 
2021/05/11 11:48:02 jsonrpc2: <-- notif: textDocument/publishDiagnostics: {"uri":"file:///home/usr/efm.log","diagnostics":[],"version":0}
2021/05/11 11:48:04 jsonrpc2: --> notif: textDocument/didClose: {"textDocument":{"uri":"file:///home/usr/efm.log"}}
2021/05/11 11:48:04 jsonrpc2: --> notif: textDocument/didOpen: {"textDocument":{"uri":"file:///home/usr/.cache/nvim/lsp.log","version":0,"languageId":"","text":"[ START ] 2021-05-11T11:47:46+0100 ] LSP logging initiated\n[ ERROR ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"2021/05/11 11:47:47 efm-langserver: reading on stdin, writing on stdout\\n\"\n[ WARN ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ]\t\"The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"panic: runtime error: invalid memory address or nil pointer dereference\\n\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564e8a]\\n\\ngoroutine 7 [running]:\\ntime.(*Timer).Stop(...)\\n\\t/usr/lib/golang/src/time/sleep.go:76\\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc0000e4160, 0x5f7780, \"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"0xc00001a160, 0xc0000d2120, 0xc000092410, 0xc0000922d0, 0x5cc768, 0xc000189d68, 0x4d9bbe)\\n\\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc0000e4160, 0x5f7780, \"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"0xc00001a160, 0xc0000d2120, 0xc000092410, 0x22, 0xc000097920, 0x3, 0x3)\\n\\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc0000ff4b0, 0x5f7780\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\", 0xc00001a160, 0xc0000d2120, 0xc000092410)\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/handler_with_error.go:21 +0x73\\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000d2120, 0x5f7780, 0xc00001a160)\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x57e\\ncreated by github.com/sourcegraph/jsonrpc2.NewConn\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x1d5\\n\"\n[ START ] 2021-05-11T11:47:53+0100 ] LSP logging initiated\n[ ERROR ] 2021-05-11T11:47:53+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"2021/05/11 11:47:53 efm-langserver: reading on stdin, writing on stdout\\n\"\n"}}
2021/05/11 11:48:04 lint for LanguageID not supported: 
2021/05/11 11:48:04 jsonrpc2: <-- notif: textDocument/publishDiagnostics: {"uri":"file:///home/usr/.cache/nvim/lsp.log","diagnostics":[],"version":0}
2021/05/11 11:48:12 jsonrpc2: --> notif: textDocument/didChange: {"contentChanges":[{"text":"[ START ] 2021-05-11T11:47:46+0100 ] LSP logging initiated\n[ ERROR ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"2021/05/11 11:47:47 efm-langserver: reading on stdin, writing on stdout\\n\"\n[ WARN ] 2021-05-11T11:47:47+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ]\t\"The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"panic: runtime error: invalid memory address or nil pointer dereference\\n\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564e8a]\\n\\ngoroutine 7 [running]:\\ntime.(*Timer).Stop(...)\\n\\t/usr/lib/golang/src/time/sleep.go:76\\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc0000e4160, 0x5f7780, \"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"0xc00001a160, 0xc0000d2120, 0xc000092410, 0xc0000922d0, 0x5cc768, 0xc000189d68, 0x4d9bbe)\\n\\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc0000e4160, 0x5f7780, \"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"0xc00001a160, 0xc0000d2120, 0xc000092410, 0x22, 0xc000097920, 0x3, 0x3)\\n\\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc0000ff4b0, 0x5f7780\"\n[ ERROR ] 2021-05-11T11:47:50+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\", 0xc00001a160, 0xc0000d2120, 0xc000092410)\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/handler_with_error.go:21 +0x73\\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc0000d2120, 0x5f7780, 0xc00001a160)\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x57e\\ncreated by github.com/sourcegraph/jsonrpc2.NewConn\\n\\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x1d5\\n\"\n[ START ] 2021-05-11T11:47:53+0100 ] LSP logging initiated\n[ ERROR ] 2021-05-11T11:47:53+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ]\t\"rpc\"\t\"efm-langserver\"\t\"stderr\"\t\"2021/05/11 11:47:53 efm-langserver: reading on stdin, writing on stdout\\n\"\n"}],"textDocument":{"uri":"file:///home/usr/.cache/nvim/lsp.log","version":8}}
2021/05/11 11:48:12 lint for LanguageID not supported: 
2021/05/11 11:48:12 jsonrpc2: <-- notif: textDocument/publishDiagnostics: {"uri":"file:///home/usr/.cache/nvim/lsp.log","diagnostics":[],

And efm-langserver 0.0.29 (rev: HEAD/go1.15.11) if that makes a difference -- I updated today.

lukas-reineke commented 3 years ago

Ah, EFM isn't even attached to the buffer. Sorry I didn't see that earlier. Are you in a git directory?

kierun commented 3 years ago

Ah, EFM isn't even attached to the buffer. Sorry I didn't see that earlier.

No worries! :grinning:

Are you in a git directory?

No, I am not. I tried in one and got this:

[ START ] 2021-05-14T08:50:52+0100 ] LSP logging initiated
[ START ] 2021-05-14T08:50:59+0100 ] LSP logging initiated
[ ERROR ] 2021-05-14T08:51:00+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/14 08:51:00 efm-langserver: reading on stdin, writing on stdout\n"
[ WARN ] 2021-05-14T08:51:00+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ] "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ ERROR ] 2021-05-14T08:51:00+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:410 ]    "stubPath /home/usr/worldr/github/deployment-docker-compose/typings is not a valid directory."
[ ERROR ] 2021-05-14T08:51:00+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:410 ]    "Exception received when installing recursive file system watcher"
[ ERROR ] 2021-05-14T08:51:15+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "panic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564e8a"
[ ERROR ] 2021-05-14T08:51:15+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "]\n\ngoroutine 19 [running]:\ntime.(*Timer).Stop(...)\n\t/usr/lib/golang/src/time/sleep.go:76\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc00017e160, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0, 0xc000140280, 0x5cc768, 0xc0001a1d68, 0x4d9bbe)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc00017e160, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0, 0x22, 0xc000123950, 0x3, 0x3)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc000199490, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/handler_with_error.go:21 +0x73\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc000168120, 0x5f7780, 0xc000126000)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x57e\ncreated by github.com/sourcegraph/jsonrpc2.NewConn\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x1d5\n"
[ START ] 2021-05-14T08:51:21+0100 ] LSP logging initiated
[ ERROR ] 2021-05-14T08:51:21+0100 ] /home/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:457 ] "rpc"   "efm-langserver"    "stderr"    "2021/05/14 08:51:21 efm-langserver: reading on stdin, writing on stdout\n"

Looks like a stack trace is buried in there…

rockerBOO commented 3 years ago

Looks like efm-langserver had a panic. Seems related to an issue in github.com/sourcegraph/jsonrpc2@v0.1.0

In efm-langserver it has a requirement of github.com/sourcegraph/jsonrpc2 v0.0.0-20191222043438-96c4efab7ee2 so seems the newly released v0.1.0 (vs v0.0.0-20191222043438-96c4efab7ee2) has something causing this.

panic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564e8a
]\n\ngoroutine 19 [running]:\ntime.(*Timer).Stop(...)\n\t/usr/lib/golang/src/time/sleep.go:76\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handleShutdown(0xc00017e160, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0, 0xc000140280, 0x5cc768, 0xc0001a1d68, 0x4d9bbe)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handle_shutdown.go:10 +0x2a\ngithub.com/mattn/efm-langserver/langserver.(*langHandler).handle(0xc00017e160, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0, 0x22, 0xc000123950, 0x3, 0x3)\n\t/home/usr/go/pkg/mod/github.com/mattn/efm-langserver@v0.0.29/langserver/handler.go:559 +0x19c\ngithub.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc000199490, 0x5f7780, 0xc000126000, 0xc000168120, 0xc0001403c0)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/handler_with_error.go:21 +0x73\ngithub.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc000168120, 0x5f7780, 0xc000126000)\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x57e\ncreated by github.com/sourcegraph/jsonrpc2.NewConn\n\t/home/usr/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x1d5\n