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

Add vscode command that can take string to evaluate in the repl. #2422

Open
chromalchemy opened this issue Mar 6, 2024 · 1 comment
Open

Comments

@chromalchemy
Copy link

Instead of necessarily inferring code from a selection or or cursor position in the current editor. I would like to pass a string directly to a calva vscode command. So the command should be able to take at least one (string) argument.

This would allow me to use calva repl evaluation from a vscode api level, without the ceremony of declaring a naming Calva repl snippets (which are awesome btw!)

It would be great if it could also optionally take a namespace to evaluate the string in.
And would be cool if the string could still use the snippet substitution vars!

@PEZ
Copy link
Collaborator

PEZ commented Mar 6, 2024

Hi! I think i lied to you about that we don't have this. Reading the issue text, and you mentioning you want to be able to include a namespace and also the snippet variables, reminded med. I have things like this in my keybindings.json file:

    {
        "key": "ctrl+alt+m ctrl+enter",
        "command": "calva.runCustomREPLCommand",
        "args": {
            "repl": "clj",
            "snippet": "(require '[malli.provider :as mp]) (mp/provide $current-form)",
        }
    },

Meaning that we have the command, and that it actually is custom repl snippets being used for it. Saying this without fully understanding your use case, so please let me know if this is not what you're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants