clojure-lsp / clojure-lsp

Clojure & ClojureScript Language Server (LSP) implementation
https://clojure-lsp.io
MIT License
1.18k stars 154 forks source link

Duplicate completing for aliases when the alias is defined in multiple namespaces #1904

Open adham-omran opened 3 weeks ago

adham-omran commented 3 weeks ago

Describe the bug Completion displays duplicate aliases when they are defined in multiple namespaces, even if the alias is defined in the visited namespace.

To Reproduce Steps to reproduce the behavior:

(ns foo (:require [clojure.string :as str]))
(ns bar (:require [clojure.string :as string]))
str| ;; will list str and string

Expected behavior

(ns bar (:require [clojure.string :as string]))
str| ;; must list string only

User details (please complete the following information):

Additional context Talked about it in Slack: Link to Thread in #lsp channel

ericdallo commented 1 week ago

Currently clojure-lsp doesn't have a logic to check the current required ns to recommend that, but this could be improved indeed