BetterThanTomorrow / joyride

Making VS Code Hackable like Emacs since 2022
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.joyride
Other
458 stars 17 forks source link

Enable loading cljc files and reader-conditionals #179

Closed djblue closed 9 months ago

djblue commented 9 months ago

Please answer the following questions and leave the below in as part of your PR.

borkdude commented 9 months ago

LGTM!

PEZ commented 9 months ago

Thanks, @djblue!

This enables the user to write scripts in .cljc files. I just tried and it works. Also as an automated test. With a vscode-test-runner/workspace-1/.joyride/scripts/a_cljc_script.cljc script like this:

(ns a-cljc-script)

:a-cljc-script

And a test like this:

(deftest-async run-a-ws-cljc-script
  (testing "Runs a workspace cljc script"
    (p/let [result (vscode/commands.executeCommand "joyride.runWorkspaceScript" "a_cljc_script.cljc")]
      (is (= :a-cljc-script
             result)))))

However, .cljc scripts do not show up in the *Run Workspace/User Script... menus. Which is inconsistent, I think. Can you add? I don't think there's a convenient way to test this with an automated test, so unless you know of a way, skip that.

djblue commented 9 months ago

@PEZ Good catch. updated the PR to include the test and enabled loading cljc scripts as well 👌