Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cider-doc not recognize the right function. #3734

Open
eval-exec opened this issue Aug 18, 2024 · 3 comments
Open

cider-doc not recognize the right function. #3734

eval-exec opened this issue Aug 18, 2024 · 3 comments

Comments

@eval-exec
Copy link

eval-exec commented Aug 18, 2024

I am experiencing an issue with cider-doc in CIDER. Specifically, when I place the cursor on string/join in my Clojure code and invoke the cider-doc command, it seems cider-doc not recgnize the join is from clojure.string/join.

Expected behavior

When I hit K, cider-doc should show clojure.string/join's doc

Actual behavior

cider-doc give me a prompt, I have to type full clojure.string/join to cider-doc's prompt

Steps to reproduce the problem

  1. git clone https://github.com/functional-koans/clojure-koans.git
  2. open 02_strings.clj file, move cursor to line 28: (= "123" (string/join '(1 2 3)))
  3. put cursor to join word. hit K (cider-doc)

Environment & Version information

CIDER version information

Include here the version string displayed when
CIDER's REPL is launched. Here's an example:

;; CIDER 0.12.0snapshot (package: 20160331.421), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_31

;; Connected to nREPL server - nrepl://localhost:38447
;; CIDER 1.15.1 (Cogne), nREPL 1.3.0-beta3
;; Clojure 1.10.0, Java 21.0.3
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: <C-c C-q>
;;  Results: Stored in vars *1, *2, *3, an exception in *e;

Lein / Clojure CLI version

Leiningen 2.10.0 on Java 21.0.3 OpenJDK 64-Bit Server VM

Emacs version

GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-08-16

Operating system

❯ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.45, NixOS, 24.05 (Uakari), 24.05.20240813.4a92571`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(exec): `""`
 - channels(root): `""`
 - nixpkgs: `/nix/store/qszplw617r895nbcprgyj139c9a3r0xs-source`


JDK distribution

openjdk-21.0.3

❯ env | grep JAVA
JAVA_HOME=/nix/store/y9dcp2rgh70wz2q3nybv45k8zaz3jdwa-openjdk-21.0.3+9/lib/openjdk

@vemv
Copy link
Member

vemv commented Aug 18, 2024

Hi @eval-exec, thanks for the report.

I use cider-doc quite often and haven't experienced that.

Are you aware that the ns form where the string alias is declared has to be evaluated (in some or other way) for CIDER to be able to see it?

i.e. since the tool is based on runtime analysis, the alias must exist in the runtime first.

@eval-exec
Copy link
Author

Hi @eval-exec, thanks for the report.

I use cider-doc quite often and haven't experienced that.

Are you aware that the ns form where the string alias is declared has to be evaluated (in some or other way) for CIDER to be able to see it?

i.e. since the tool is based on runtime analysis, the alias must exist in the runtime first.

Thank you, I guess there something wrong in my local env. I think it's not important.

Is there some ways to help to debug why cider-doc not aware the join is from clojure.string/join?

@eval-exec
Copy link
Author

eval-exec commented Aug 18, 2024

Wow, I just try cider-doc on join, it works as expected, I don't know why. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants