vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

[Feature request] deno support

Open kinghat opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. add support for deno when its language server is active in the editor.

Describe the solution you'd like the extension supports typescript but only via node. it would be nice to have it conditionally use deno when its language server is active over built in node ts or js.

kinghat avatar Jan 20 '22 18:01 kinghat

Pretty easy using existing features. Auto-discovery of a Deno project might be nice, but this works pretty well for me. I set it in .vscode/settings.json in my Deno projects.

	"code-runner.executorMap": {
		"javascript": "deno run --unstable -A",
		"typescript": "deno run --unstable -A"
	}

There's also code-runner.executorMapByFileExtension and code-runner.executorMapByGlob; I can imagine using those in hybrid projects.

aaronhuggins avatar Apr 22 '23 23:04 aaronhuggins

Adding #!/usr/bin/env deno run --unstable -A at the beginning of the file might also work for linux/macos/wsl

shiftgeist avatar Jan 11 '24 14:01 shiftgeist

@shiftgeist That's an option, but it may suffer form portability concerns as not all unix/linux variants support multiple arguments in a hashbang, and those that do support it with /usr/bin/env may require the non-standard -S option passed to env right before the command to execute, like #!/usr/bin/env -S my_command --with arguments.

aaronhuggins avatar Jan 11 '24 15:01 aaronhuggins