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

dialog with two definitions for one function on Go To Definition (F12) #1426

Closed
blueskyonmars opened this issue Dec 8, 2021 · 6 comments · Fixed by #1428
Closed

dialog with two definitions for one function on Go To Definition (F12) #1426

blueskyonmars opened this issue Dec 8, 2021 · 6 comments · Fixed by #1428

Comments

@blueskyonmars
Copy link

blueskyonmars commented Dec 8, 2021

I have a simple file with two functions, one which calls the other. When I stand a function call (doubleme) and hit F12, I see a popup to disambiguate which function it should go to. There's only one actual function in the code though.

Project is attached, code looks like this:

(ns mytest.core)

(defn- doubleme [])

(defn foo
  "I don't do a whole lot."
  [x]
  (doubleme)
  (println x "Hello, World!"))

I noticed three phases, just after I open the project with VS Code+Calva:

  1. immediately after, nothing happens when I hit F12 except a message saying "No definition found for doubleme",
  2. after 20 seconds or so when I hit F12 it goes directly to the function without a popup, and then
  3. eventually a popup gets in the way when I hit F12. Phase 3 seems to be after I see the message "Connected to nREPL." The whole process takes maybe 2 minutes on my old OS X Big Sur system.

I first saw this in a different project, and we discussed on the calva slack channel.

mytest.zip
clojure-language-client-output.log
dialog-screenshot

@bpringe
Copy link
Member

bpringe commented Dec 8, 2021

Phase 3 seems to be after I see the message "Connected to nREPL."

So you are connecting Calva to an nrepl server or jacking in? Calva doesn't connect to nrepl automatically (in any case that I know of), so I just want to make sure I understand correctly.

@bpringe bpringe added code navigation bug Something isn't working and removed bug Something isn't working labels Dec 8, 2021
@PEZ
Copy link
Collaborator

PEZ commented Dec 8, 2021

The message Connected to nREPL. does not come from Calva.

I'm guessing you are using some other nREPL extension (maybe the Clojure extension?). Then maybe both clojure-lsp and that other extension finds the function and that's why you get two options.

@blueskyonmars
Copy link
Author

OMG, you're right! I had tried the Clojure extension before I found Calva and forgot it was still enabled. Sorry!

@PEZ
Copy link
Collaborator

PEZ commented Dec 8, 2021

Don't be sorry. It is quite common and you are reminding us that we should maybe detect this situation and issue a warning about it, as we do with some other potential extension conflicts.

@PEZ
Copy link
Collaborator

PEZ commented Dec 8, 2021

This issue is an excellent example of providing context, btw. It made it possible to spot a probable cause quickly.

@PEZ
Copy link
Collaborator

PEZ commented Dec 8, 2021

@bpringe

Calva doesn't connect to nrepl automatically (in any case that I know of), so I just want to make sure I understand correctly.

I just tried with the Clojure extension installed. It actually just starts a REPL and connects automatically. 😄

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

Successfully merging a pull request may close this issue.

3 participants