-
Context
DescriptionAt this stage, I cannot seem to find a way to pass arguments when triggering a user defined command via the command executable pattern for hover content. Currently the only API available is to have links that look like: const link = "[Execute](command:myCommandId)"; It would be useful to pass arguments with this execution pattern such as: const args = ["a", "b"];
const link = `[Execute](command:myCommandId{${args.join()}})`; As the current workaround, I have implemented a global argument stack that pushes the current desired arguments for the next user command handler. This works, but it would be far easier to append command arguments when building the IMarkdownString objects. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Here is an example that shows how arguments can be passed in by serializing them as query parameters -- https://github.com/microsoft/vscode/blob/3a73bf805c0396d9e578f73586b90de63811dca2/extensions/npm/src/scriptHover.ts#L92-L99 |
Beta Was this translation helpful? Give feedback.
-
Brilliant thank you! Is there any chance that items such as this (and I know for some of the markdown implementation), whether there will be more explicit documentation about it in the future? |
Beta Was this translation helpful? Give feedback.
-
PR to improve the documentation most welcome. |
Beta Was this translation helpful? Give feedback.
Here is an example that shows how arguments can be passed in by serializing them as query parameters -- https://github.com/microsoft/vscode/blob/3a73bf805c0396d9e578f73586b90de63811dca2/extensions/npm/src/scriptHover.ts#L92-L99