Clojure-lsp: Wrong completion item type is reported

Created on 15 May 2021  路  3Comments  路  Source: clojure-lsp/clojure-lsp

Describe the bug
Completion items assigned wrong types, resulting wrong icons and wrong descriptions in completion frontends

To Reproduce
Steps to reproduce the behavior:

  1. Open some project
  2. Start clojure-lsp in Emacs, or VS Code
  3. type (->
  4. -> is not a variable, but the server reports it as a variable:

image

The icon suggests that -> macro is a variable, accordingly to the official icon list

Same happens in Emacs:

image

None of these are variables. If I actually connect to nREPL with CIDER, the list shows correct types:

image

Same when connecting to nREPL with Calva:

image

Expected behavior
Correct type reported


Log - /tmp/clojure-lsp.*.out

2021-05-15T14:56:45.170Z s540 INFO [clojure-lsp.main:391] - Starting server...
2021-05-15T14:56:45.174Z s540 DEBUG [clojure-lsp.nrepl:24] - nrepl not found, skipping nrepl server start...
2021-05-15T14:56:45.181Z s540 INFO [clojure-lsp.main:293] - Initializing...
2021-05-15T14:56:45.702Z s540 INFO [clojure-lsp.crawler:217] - Analyzing source paths for project root /home/andreyorst/Git/time-control
2021-05-15T14:56:45.827Z s540 INFO [clojure-lsp.crawler:175] - Paths analyzed, took 0.12471838 secs. Caching for next startups...
2021-05-15T14:56:45.832Z s540 DEBUG [clojure-lsp.main:?] - :initialize 650ms
2021-05-15T14:56:45.857Z s540 INFO [clojure-lsp.main:339] - Initialized!
2021-05-15T14:56:45.858Z s540 DEBUG [clojure-lsp.main:?] - :initialized 1ms
2021-05-15T14:56:45.863Z s540 DEBUG [clojure-lsp.main:?] - :didOpen 4ms
2021-05-15T14:56:45.874Z s540 DEBUG [clojure-lsp.main:?] - :documentHighlight 2ms
2021-05-15T14:56:45.880Z s540 DEBUG [clojure-lsp.main:?] - :codeAction 9ms
2021-05-15T14:56:45.913Z s540 DEBUG [clojure-lsp.main:?] - :documentHighlight 0ms
2021-05-15T14:56:45.913Z s540 DEBUG [clojure-lsp.main:?] - :codeAction 0ms
2021-05-15T14:56:45.960Z s540 DEBUG [clojure-lsp.main:?] - :documentHighlight 0ms
2021-05-15T14:56:45.961Z s540 DEBUG [clojure-lsp.main:?] - :codeAction 1ms
2021-05-15T14:56:45.978Z s540 DEBUG [clojure-lsp.main:?] - :documentHighlight 0ms
2021-05-15T14:56:45.979Z s540 DEBUG [clojure-lsp.main:?] - :codeAction 0ms
2021-05-15T14:57:03.235Z s540 DEBUG [clojure-lsp.main:?] - :documentHighlight 0ms
2021-05-15T14:57:03.235Z s540 DEBUG [clojure-lsp.main:?] - :codeAction 1ms
2021-05-15T14:57:05.586Z s540 DEBUG [clojure-lsp.main:?] - :didChange 0ms
2021-05-15T14:57:05.603Z s540 DEBUG [clojure-lsp.main:?] - :completion 15ms
2021-05-15T14:57:06.092Z s540 DEBUG [clojure-lsp.main:?] - :hover 6ms
2021-05-15T14:57:06.180Z s540 DEBUG [clojure-lsp.main:?] - :resolveCompletionItem 4ms

User details (please complete the following information):

  • OS: Fedora 34
  • Editor: Emacs, VSCode (Calva)
  • Version: clojure-lsp 2021.05.14-15.26.02
    clj-kondo 2021.04.24-SNAPSHOT
bug

Most helpful comment

@andreyorst Fixed on master, available on next release!

All 3 comments

Thanks for the report!
Yeah, ATM we are returning incorrectly variable for everything in clojure.core/cljs.core 馃槄, I'll try to improve it in a simple way

@andreyorst Fixed on master, available on next release!

thanks!

Was this page helpful?
0 / 5 - 0 ratings