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

Custom repl commands show error if run from non-clojure file #1203

Closed
bpringe opened this issue Jun 15, 2021 · 6 comments
Closed

Custom repl commands show error if run from non-clojure file #1203

bpringe opened this issue Jun 15, 2021 · 6 comments
Labels
beginner ux User experience related

Comments

@bpringe
Copy link
Member

bpringe commented Jun 15, 2021

When running a custom repl command from a non-clojure file VS Code shows an error that the command resulted in an error. We should more gracefully handle this situation, maybe by informing the user that the commands can only be run from clojure files.

image

@bpringe bpringe added ux User experience related beginner labels Jun 15, 2021
@PEZ
Copy link
Collaborator

PEZ commented Jun 30, 2021

Maybe not enable the command in non-clojure files? And also not enable any of the shortcuts in that case.

That would make it difficult to provoke this situation and we wouldn't need to handle it more gracefully. 😄

@bpringe
Copy link
Member Author

bpringe commented Jul 1, 2021

That's arguably another way of handling it gracefully. 😄

@leifericf
Copy link

leifericf commented Apr 5, 2022

I see that this is already fixed and merged in this commit.

It checks the language identifier to enable the command (editorLangId == clojure).

But is "Run Custom REPL Command" supposed to work for ClojureScript? Currently, the command does not show up for ClojureScript files, but I'm unsure whether it should show up.

As far as I can tell from the documentation, Visual Studio Code does not have a Language Identifier for ClojureScript.

@leifericf
Copy link

leifericf commented Apr 5, 2022

Ah! Upon further inspection, I found this in calva/package.json:

    "languages": [
      {
        "id": "clojure",
        "aliases": [
          "Clojure",
          "clojure"
        ],
        "extensions": [
          ".clj",
          ".cljs",
          ".cljc",
          ".cljd",
          ".cljx",
          ".clojure",
          ".edn",
          ".joke",
          ".boot",
          ".bb",
          ".calva-repl"
        ],
        "configuration": "./language-configuration.json"
      }
    ]

Which includes the ClojureScript extension: .cljs

I suppose this implies that Calva does not need to distinguish between Clojure and ClojureScript?

@leifericf leifericf added good first issue Good for newcomers beginner and removed beginner good first issue Good for newcomers labels Apr 5, 2022
@PEZ
Copy link
Collaborator

PEZ commented Apr 5, 2022

is "Run Custom REPL Command" supposed to work for ClojureScript?

Yes. You can configure custom commands to use the Clojure or ClojureScript REPL, or leave it at ”whatever is the current REPL”. Do you have a REPL connected when you test that?

I suppose this implies that Calva does not need to distinguish between Clojure and ClojureScript?

Calva actually distinguishes between Clojure and ClojureScript, even if VS Code only cares about ”clojure”.

@bpringe
Copy link
Member Author

bpringe commented Apr 17, 2022

Seems this should have been closed after the merge. Please continue the conversation here if necessary, though.

@bpringe bpringe closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner ux User experience related
Projects
None yet
Development

No branches or pull requests

3 participants