Open sucrecacao opened 1 year ago
Hi there!
Oh, that's a good idea! Making an extension is possible, but indeed since you have few commands to make you can just add a keybinding. See the run
documentation for more information.
As for the error you had, it's unrelated to Dance. You probably configured TypeScript to emit code targeting a particular version of JavaScript, and that version doesn't support using await
at the top level of your file, so TypeScript is complaining. Similarly, getExtension(...)
may return undefined
(if the extension isn't installed), in which case you can't directly call activate()
, and therefore TypeScript is complaining.
Thanks @71 for the quick answer
In which file json file should I put the snippet from https://github.com/71/dance/tree/master/src/commands#run ?
In keybindings.json
, the standard VS Code file for configuring key bindings. There is a VS Code command that brings it up, but I don't remember exactly what it is (and I don't have my laptop right now so I can't check).
Hi,
I was not able to write a script for dance. My goal is to port https://github.com/occivink/kakoune-vertical-selection to codium.
From the readme I understand that in order to do so I should create a new extension and to import dance api. However, I couldn't include
const { api } = await vscode.extensions.getExtension("gregoire.dance").activate();
on top myextension.ts
( from the "hello world" extension example from https://code.visualstudio.com/api/get-started/your-first-extension ). I got the following error:And:
Also, I was wondering if creating a new extension was the only option.
Is there a simpler way where I can just map a key to a simple javascript function that leverage Dance api ?