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

Connect fails when there is no project file (deps.edn, etc) #1613

Closed
brettrowberry opened this issue Mar 23, 2022 · 7 comments
Closed

Connect fails when there is no project file (deps.edn, etc) #1613

brettrowberry opened this issue Mar 23, 2022 · 7 comments

Comments

@brettrowberry
Copy link
Contributor

brettrowberry commented Mar 23, 2022

I have a custom project type in .vscode/settings.json:

{
    "calva.replConnectSequences": [
        {
            "name": "Monorepo REPL",
            "projectType": "generic",
            "nReplPortFile": [".nrepl-port"],
            "afterCLJReplJackInCode": "(start)",
            "cljsType": "none"
        }
    ]
}

In 2.0.256, I can connect a REPL client.

In 2.0.257, I

  1. Start my REPL server
  2. Run Calva: Connect to a running REPL Server
  3. I'm greeted with the new Project root picker
  4. I bypass with Esc
  5. I'm greeted with Please select a project type
  6. I choose Monorepo REPL
  7. A popup appears with message Failed initializing project root directory:

I think this was introduced by #1254.

@PEZ
Copy link
Collaborator

PEZ commented Mar 23, 2022

Hello. Thanks for reporting!

We should probably complain at 4 instead of pretending things will work. You need to pick a project root. The same one as was auto-picked before #1609 is now pre-selected in the project root menu, so you should be able to connect by pressing enter instead of esc.

@brettrowberry
Copy link
Contributor Author

I don't know which project root was auto-picked before #1609, but all the project roots surfaced now look to be locations containing a deps.edn and none is pre-selected.
The project root I want is some Bazel thing. Now both enter and esc seem to be no-ops.

@PEZ
Copy link
Collaborator

PEZ commented Mar 23, 2022

I checked the Calva code now, and esc and enter do the same thing. I'm sorry for the misinformation. (Still think we probably should complain on esc rather than auto-selecting something.)

Can you describe the project and what file you have open when you run the connect command? What is a Bezel thing? Judging from the connect sequence you have, it looks like the workspace root should be the project root. Do you have a deps.edn there?

@brettrowberry
Copy link
Contributor Author

brettrowberry commented Mar 24, 2022

Making a minimal repro is beyond my current understanding of what we've built using https://bazel.build. However, adding a deps.edn containing {} at the root of my repo worked.

@PEZ
Copy link
Collaborator

PEZ commented Mar 24, 2022

Thanks for the update, @brettrowberry!

I'll reopen the issue because we should probably do something about it. At least document it...

@PEZ PEZ reopened this Mar 24, 2022
@CFiggers
Copy link

CFiggers commented Mar 24, 2022

Possibly related:

With 256, I can connect to a Babasha nREPL using the Calva: Start a Project REPL command in a completely empty directory.

Repro:

$ mkdir calva-testing
$ cd calva-testing
$ code .

Within VS Code:

  1. Run Calva: Start a Project REPL (aka Jack-In)
    => Get "Please select a project type" pop-up:

image

  1. Select Babashka
    => Successful Jack-in

With 257, following the exact same steps does not present the "Please select a project type" pop-up.

Repro:

$ mkdir calva-testing
$ cd calva-testing
$ code .

Within VS Code:

  1. Run Calva: Start a Project REPL (a.k.a Jack-in)
    => Nothing

image


After adding a deps.edn containing {} at project root, I get the "Please select a project type" pop-up with Babashka, nbb, and deps.edn options:

image

But a bb.edn containing {} at project root does not have the same effect.

@PEZ
Copy link
Collaborator

PEZ commented Mar 24, 2022

And the winner for best repro description is @CFiggers ! Thanks 🙏 ❤️ (Close call, 😄 )

A first an easy fix is to include bb.edn as a project root ”marker”. Something I was already planning to do, so extra thanks for confirming that.

We need to do more to fix the problem in general... I need to ponder about exactly what though. 😄

@PEZ PEZ changed the title 2.0.257 Connect Issue Connect fails when there is no project file (deps.edn, etc) Mar 25, 2022
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

3 participants