emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.04k stars 139 forks source link

zig goto definition not working: wrong-type-argument sequencep #525

Closed travisstaloch closed 3 years ago

travisstaloch commented 3 years ago

I'm not positive this is an lsp-ui error. This is my best guess for now. As far as i can tell, everything else is working using https://github.com/zigtools/zls and suggested configs shown at bottom.

When selecting 'goto definition' from the right click context menu, i get the following:

Error running timer: (wrong-type-argument sequencep #s(hash-table size 65
 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("uri" "file:///.../file.zig" 
"range" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 
data ("start" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 
0.8125 data ("line" 471 "character" 15)) "end" #s(hash-table size 65 test equal 
rehash-size 1.5 rehash-threshold 0.8125 data ("line" 471 "character" 15)))))))

Also, i'm seeing this on startup which is a known zls (zig language server) issue even though hover seems to work fine:

Error (use-package): lsp-ui/:config: The connected server(s) does not support method textDocument/hover.

In zig's irc, they suggest this is likely some type of emacs error. Goto definition is working pretty well in vscode, vim, kakoune. Could these be related? Any ideas what could be happening or if i should ask elsewhere?

(require 'lsp)
(add-to-list 'lsp-language-id-configuration '(zig-mode . "zig"))
(lsp-register-client
  (make-lsp-client
    :new-connection (lsp-stdio-connection "/path/to/zls/here")
    :major-modes '(zig-mode)
    :server-id 'zls))

(use-package lsp-mode
  :commands lsp
  :hook ((zig-mode) . lsp)
  :bind (:map lsp-mode-map
              ;; ("TAB" . completion-at-point)
          ))

(use-package lsp-ui
  :hook (lsp-mode . lsp-ui-mode)
  :config
  (setq lsp-ui-sideline-enable t)
  (setq lsp-ui-sideline-show-hover nil)
  (setq lsp-ui-doc-position 'bottom)
  (lsp-ui-doc-show))
jcs090218 commented 3 years ago

Also, i'm seeing this on startup which is a known zls (zig language server) issue even though hover seems to work fine:

I assumed this is error message passed by lsp-mode?

I'm not positive this is an lsp-ui error.

Yeah, I don't think this is an error from this package. But I may be wrong to this.

Anyway, thanks for reporting this issue to us! 👍

travisstaloch commented 3 years ago

Thank you. Would you suggest posting this issue in lsp-mode then?

jcs090218 commented 3 years ago

Yes! Please do! And thank you!

jcs090218 commented 3 years ago

I will close this issue now. Feel free to reopen this if the issue is related from this package! Thanks! 😄