Skip to content

Use project detection code from clojure-mode #173

New issue

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

By clicking “No 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? No Sign in to your account

Closed
bbatsov opened this issue Apr 19, 2020 · 8 comments · Fixed by #176
Closed

Use project detection code from clojure-mode #173

bbatsov opened this issue Apr 19, 2020 · 8 comments · Fixed by #176
Labels
enhancement good first issue Friendly for first time contributors

Comments

@bbatsov
Copy link
Member

bbatsov commented Apr 19, 2020

Probably it didn't exist back when I created inf-clojure. Now we can remove the custom code and simplify inf-clojure a bit.

Adding a project name to each REPL might be the simplest way to having multiple REPLs support.

@bbatsov bbatsov added enhancement good first issue Friendly for first time contributors labels Apr 19, 2020
@arichiardi
Copy link
Contributor

I am not sure about this one. I have had "mixed" projects, like a single file (project.clj) that generates the classpath for both shadow-cljs and lumo.

I think what we really want is to detect the REPL type for a file for the above use case.

It might be just me though so maybe we can just say we support "single type" projects and not mix types. It would be great to survey a bit usage of inf-clojure so that we don't break existing workflows.

@bbatsov
Copy link
Member Author

bbatsov commented Apr 22, 2020

I was under the impression we want to drop the REPL type detection and just have users always specify it explicitly. The only reason for the project root is to know in which folder to start a REPL, although we can obvious prompt for this as well. //cc @dpsutton

@arichiardi
Copy link
Contributor

Oh ok yes that would definitely work here, however I still think that it can get a bit hairy cause you will have to fiddle with folders and .dir-locals.el.

Agree though that the current detection mechanisms is brittle and we should probably try something else (or drop it as already said).

Simpler is better for sure.

@dpsutton
Copy link
Contributor

I was under the impression we want to drop the REPL type detection and just have users always specify it explicitly.

I think the project detection is pretty good actually. I think it would be better to show the detected repl type so its more easily correctable rather than making the user choose this each time. It will feel silly if you choose planck as the startup and then have to choose planck as type. But alternatively, if a person types in clj -m cljs.main -t node -r its not easy to know which repl type it is but we can detect cljs.repl at runtime.

@bbatsov
Copy link
Member Author

bbatsov commented Apr 23, 2020

It will feel silly if you choose planck as the startup and then have to choose planck as type.

Why would you do something like this? If you choose planck as the startup command you immediately set the type to planck as well. This was what I had in mind. In practice you need detection only for some generic REPL type, but I guess then it's fine to ask the user for the REPL type. Still, I can imagine the usefulness of the detection in such cases (and most of all if you're doing inf-clojure-connect), but I definitely don't think any auto-detection is needed in cases when the type of REPL is clear from the command used to start it.

@dpsutton
Copy link
Contributor

Fair enough. We can set it automatically if the user uses one of the startup commands and otherwise we will offer a prompt after choosing. I'll get to it this weekend and also using the clojure-mode project directory stuff. thanks!

@bbatsov
Copy link
Member Author

bbatsov commented Apr 24, 2020

I should be thanking you for tackling this!

@dpsutton
Copy link
Contributor

this should be resolved by #174

bbatsov pushed a commit that referenced this issue Apr 25, 2020
We also get as an extra benefit project type caching and all of the project
types supported by clojure-mode.
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
enhancement good first issue Friendly for first time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants