Closed gregveres closed 2 years ago
@gregveres
If you would like to use macros of workspace, you have to enter the path to your macro file in the Macro File Path
of the Workspace settings.
The settings are stored in the *.code-workspace
file.
Then you can run the workspace macro as follows.
Best regards,
Thank you. My problem was that I was trying to use a relative path from the workspace, but I was saving the settings in the user portion of the settings. Apparently when saving as the user settings, the path is relative to somewhere else.
saving in the workspace settings I was able to use the ".vscode/macros" directory.
@gregveres
Thank you for your reply.
I forgot to mention something important.
We are unable to use VSCode predefined variables such as ${workspaceFolder}
for the macro file path in VSCode Macros extension because VSCode does not provide an API to expand predefined variables so far.
Please see issue #3 for details.
Best regards,
No problem at all. Just defining the value as ".vscode/macros/macro-file.js" worked great. I am not sure I would need to expand those variables.
BTW, this is a great extension. I was able to quickly write a macro to open up three terminals and start nx serve X in each of those terminals to get my monorepo based application building with a single command. I love it!
I would like to have the macro file be part of the project. Is there a way to specify the workspace folder as the location for the macro file?
I have tried {workspaceFolder} as pointed out in the VSCode docs, but I think the docs are talking about using the variable from the user's point of view, not from the extension writer's point of view.
I tried this and it doesn't work: