zigtools / zls

A Zig language server supporting Zig developers with features like autocomplete and goto definition
MIT License
2.84k stars 286 forks source link

Neovim lspconfig Integration Flakes #228

Closed hspak closed 3 years ago

hspak commented 3 years ago

Hello. I'm stuck trying to debug my neovim+lspconfig+zls config.

Zls works for me, but I see this error pop up when opening new files and saving.

LSP[zls]: Error NO_RESULT_CALLBACK_FOUND: {
  id = 0,
  jsonrpc = "2.0",
  result = {
    data = { 0, 0, 31, 8, 0, 1, 0, 43, 8, 0, 1, 0, 75, 8, 0, 1, 0, 78, 8, 0, 1, 0, 44, 8, 0, 1, 0, 5, 7, 0, 0, 6, 3, 0, 33, 0, 4, 1, 11,
 0, 0, 2, 7, 12, 0, 0, 8, 12, 9, 0, 1, 0, 5, 7, 0, 0, 6, 2, 0, 33, 0, 3, 1, 11, 0, 0, 2, 3, 0, 1, 0, 4, 2, 0, 1, 2, 0, 3, 7, 0, 0, 4, 2,
 7, 0, 0, 3, 14, 0, 256, 0, 15, 8, 7, 0, 0, 9, 11, 1, 32, 0, 13, 5, 0, 0, 0, 7, 8, 7, 0, 0, 9, 10, 1, 32, 0, 12, 4, 0, 0, 0, 6, 4, 0, 0,
 1, 4, 6, 7, 0, 0, 7, 6, 7, 0, 1, 8, 17, 4, 0, 0, 19, 10, 1, 0, 1, 8, 4, 4, 0, 0, 6, 8, 0, 2, 0, 9, 1, 11, 0, 0, 2, 8, 0, 2, 0, 9, 4, 6,
 0, 2, 8, 3, 7, 0, 0, 4, 5, 7, 0, 0, 6, 5, 2, 32, 0, 6, 1, 11, 0, 0, 2, 10, 1, 0, 1, 8, 3, 7, 0, 0, 4, 5, 7, 0, 0, 6, 6, 0, 34, 0, 7, 1,
 11, 0, 0, 2, 2, 0, 1, 0, 3, 6, 0, 0, 0, 7, 1, 11, 0, 0, 1, 4, 0, 2, 0, 6, 5, 2, 0, 0, 7, 5, 6, 0, 2, 8, 5, 7, 0, 0, 6, 4, 0, 34, 0, 5,
1, 11, 0, 0, 2, 5, 12, 0, 1, 8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 4,
 5, 1, 0, 0, 10, 2, 11, 0, 0, 3, 4, 1, 0, 0, 5, 4, 4, 0, 0, 5, 14, 6, 0, 1, 16, 3, 7, 0, 0, 4, 4, 1, 0, 0, 5, 5, 6, 0, 1, 16, 6, 7, 0, 0
, 7, 4, 1, 0, 0, 5, 17, 4, 0, 0, 18, 5, 6, 0, 0, 6, 5, 1, 0, 2, 12, 4, 1, 0, 0, 5, 4, 4, 0, 0, 5, 19, 6, 0, 0, 20, 5, 1, 0, 1, 12, 6, 7,
 0, 0, 7, 5, 1, 0, 5, 0, 3, 7, 0, 0, 4, 2, 7, 0, 0, 3, 14, 6, 256, 0, 15, 17, 1, 32, 0, 19, 7, 0, 0, 0, 9, 14, 0, 0, 0, 15, 4, 10, 0, 0,
 6, 7, 12, 0, 0, 8, 17, 1, 0, 1, 4, 6, 7, 0, 0, 10, 1, 4, 0, 0, 1, 17, 4, 0, 0, 18, 1, 11, 0, 0, 2, 17, 1, 0 }
  }

zig version 0.8.0-dev.1129+65279c4f5 zls version (commit): c98c44460cfd98e74e239a2605c5c0043294216d (self compiled) neovim version NVIM v0.5.0-dev+1056-gad98b8400

I don't think it's a neovim/lspconfig issue because I have gopls configured as well and it works without a hitch. Here are my relevant vimrc configs.

I'm thinking the problem is PEBCAK, but I'm not sure where to look. :sweat_smile:

hspak commented 3 years ago

Ah, looks like a dupe of https://github.com/zigtools/zls/issues/135 (As in neovim lsp still doesn't support semantic tokens so it barfs)

Setting enable_semantic_tokens to false fixes this.