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

Joyride: Run Workspace Script... error on windows #183

Open
tshemeng opened this issue Jan 11, 2024 · 4 comments
Open

Joyride: Run Workspace Script... error on windows #183

tshemeng opened this issue Jan 11, 2024 · 4 comments
Labels
javascript Related to the JavaScript support

Comments

@tshemeng
Copy link

Open any project on Windows, run command Joyride: Run Workspace Script..., select a .js file, VSCode Joyride got error
image

@PEZ
Copy link
Collaborator

PEZ commented Jan 11, 2024

Hi! Looks like you have something in hello.js that JavaScript doesn't like. Can you share the script?

This script should work:

const vscode = require("vscode");

showHelloMessage = async () => {
  const button = await vscode.window.showInformationMessage("Hello World!", "Cancel", "OK");
  if (button === "OK") {
    vscode.window.showInformationMessage("You clicked OK! Try clicking Cancel too?.");
  } else {
    const name = await vscode.window.showInputBox({
      title: "CIA wants to know",
      prompt: "What is your name?",
    });
    vscode.window.showInformationMessage(`Hello ${name}!`);
  }
};

showHelloMessage();

@tshemeng
Copy link
Author

tshemeng commented Jan 11, 2024

@PEZ i test on three computers got same error, here is screen recording test your code:
https://github.com/BetterThanTomorrow/joyride/assets/8343797/3cba8142-dbf8-4458-a411-34e857474658

@PEZ PEZ added the javascript Related to the JavaScript support label Jan 11, 2024
@PEZ
Copy link
Collaborator

PEZ commented Jan 11, 2024

@tshemeng, thanks for testing that. I don't know what's going on, but could be specific to Windows. I'll get hold of a Windows machine to test this on.

Can you confirm that ClojureScript (.cljs) scripts work? You can try with this one for a direct compare:

(require '["vscode" :as vscode]
         '[promesa.core :as p])

(defn show-hello-message []
  (p/let [button (vscode/window.showInformationMessage "Hello World!" "Cancel" "OK")]
    (if (= "OK" button)
      (vscode/window.showInformationMessage "You clicked OK! Try clicking Cancel too?.")
      (p/let [name (vscode/window.showInputBox #js {:title "CIA wants to know",
                                                    :prompt "What is your name?"})]
        (vscode/window.showInformationMessage (str "Hello " name))))))

(show-hello-message)

@tshemeng
Copy link
Author

@PEZ .cljs works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Related to the JavaScript support
Projects
None yet
Development

No branches or pull requests

2 participants