emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.76k stars 875 forks source link

Clojure completion of aliased dependencies only works in the REPL #4526

Open larrasket opened 1 month ago

larrasket commented 1 month ago

Thank you for the bug report

Bug description

Clojure completion of aliased dependencies only works in the REPL. Like in :

(ns hr
  (:require
   [clojure.string :as str]
   [clojure.edn :as edn]
   [clojure.pprint :as pp]))

Steps to reproduce

Expected behavior

Completion to work

Which Language Server did you use?

clojure-lsp

OS

Linux

Error callstack

No response

Anything else?

No response

larrasket commented 1 month ago

Example: In the REPL image

Code:

image

larrasket commented 1 month ago

I fixed it temporarily with:

(add-hook 'clojure-mode-hook
          (lambda ()
            (setq-local completion-at-point-functions
                        (list #'cider-complete-at-point
                              #'lsp-completion-at-point
                              #'lispy-clojure-complete-at-point))))
dgutov commented 1 week ago

Could it be a bug in the language server? You can double-check with some other editor as well.

larrasket commented 1 week ago

I did with vscode. It works fine with cider-complete-at-point (it gets it from the language server too)

dgutov commented 1 week ago

CIDER uses a different kind of language server.