avli / clojureVSCode

Clojure support for Visual Studio Code
https://avli.github.io/clojureVSCode/
MIT License
204 stars 34 forks source link

Disable `:pedantic? :abort` when starting `lein repl` #96

Open marcomorain opened 6 years ago

marcomorain commented 6 years ago

At CircleCI we use :pedentic? :abort in most of our leiningen projects. This option prevents the leiningen from starting the repl unless there are no conflicting dependencies in the app.

When clojureVSCode starts the repl, it adds additional dependencies to the app, which often causes the :pedantic? :abort checks to fail, and the repl fails to start.

I suggest that we override the penantic flag set it to the default value, :ranges when starting the repl from VSCode.

Thoughts?

marcomorain commented 6 years ago

My current work around is comment out :penantic? :abort when loading a project in code.

marcomorain commented 6 years ago

Another option could to be to start leiningen with a specific profile when starting from vscode.

Then I could add a custom setting in my ~/.lein folder for this:

 {:vscode {:pedantic :ranges}}
avli commented 6 years ago

Hi @marcomorain and thank you for your recent contributions 👍

Could you point me out where do we set this option? I glanced through the code but haven't found any mentions of it. Is this option set by Leiningen implicitly?

marcomorain commented 6 years ago

We set this option on our projects in project.clj

This means that if our projects depend on any versions of nrepl or clj-fmt that are different from the versions that clojureVSCode injects, our projects fail to start.

I think I will make a PR to your README.clj with a description of the issue and how to fix it by editing ~/.lein/profiles.clj

👍

avli commented 6 years ago

Oh, now I see :-)

This makes me think, that the right approach here is to provide a configuration option for passing arbitrary parameters for nREPL as we do for cljfmt. What do you think?

marcomorain commented 6 years ago

If we invoke the repl with lein repl :headless :vscode then users could put any special lein options that they would like into a :vscode profile in ~/.lein/profiles.clj

marcomorain commented 6 years ago

As it stands, lein repl uses the :repl profile in ~/.lein/profiles.clj

avli commented 6 years ago

In this case, let's invoke nREPL with :vscode and add a section with the description of how to get an advantage of it to README.md. What do you think?

MikaelSmith commented 5 years ago

I'm running into this as well, and it appears the README update about how to work around it by editing ~/.lein/profiles.clj never happened. Would you mind outlining that fix here?