clojure-lsp / clojure-lsp/clojure-lsp
Enhance CodeLens to show defs that are private and external to the namespace.
- Vorherrschende Sprache
- Clojure
- Sterne
- 1.3k
- Forks
- 180
- Ø Merge
- 3 T. 18 Std.
- Gemergte PRs (30 T.)
- 5
Beschreibung
**Is your feature request related to a problem? Please describe.**
It's often quite difficult, in large namespaces, to know which functions (for example) are being used outside of that namespace, in other namespaces. Right now, with the help of clj-kondo, clojure-lsp would show me (as a codeLens feature), something like this:

What is not clear to me, is whether that function is being used only within the scope of the namespace, or is really being used elsewhere (maybe both, once locally and once externally). Here is another example:

There are 9 references to that function. This function is only ever used in that namespace. The quickest way (at the moment), is to highlight references, i.e,

It would be far nicer if instead codeLens could show me as I'm browsing through the file.
**Describe the solution you'd like**
I think a nice addition to codeLens would be the ability to show whether any defs/defns are private to the namespace and thus allow for a quick and easy way to mark the defs/defns private (maybe a further enhancement migth be for a codeAction to do it all for me - but for now, doing that manually is okay).
It might do something like:
`(defn add-ontology-entity-name > 9 private references)`
or, in the case of a mix:
`(defn add-ontology-entity-name > 6 private references, 3 external references)`
or, in the case of them all being external:
`(defn add-ontology-entity-name > 9 external references)`
Whether or not the wording should change to be something other than `private` or `external` is fine with me (e.g., 9 local references; 5 local references, 4 external references etc...)
**Describe alternatives you've considered**
I can get the information from using `(coc-references)`, but it's something I have to do, and not that friendly, in the sense that it would be nicer if the inline reference information could be shown against the function.
Thank you for your consideration.
-=david=-
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die vorhandenen CodeLens-Referenzanzahlen und die Art und Weise nachzuverfolgen, wie clj-kondo Referenzinformationen bereitstellt. Vergleiche diese Anzahlen mit dem Namespace jedes def oder defn, einschließlich des im Issue beschriebenen Verhaltens von coc-references. Erledigt ist die Aufgabe, wenn CodeLens lokale und externe Referenzen mit den angeforderten Anzahlen unterscheidet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- clojure
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100