mfornet / acmx

Competitive programming made simple. VSCode extension.
MIT License
148 stars 9 forks source link

Add feat: workspaceStartUpCommand, add function runWorkspaceStartUpCo… #125

Closed Shahraaz closed 3 years ago

Shahraaz commented 3 years ago

…mmand to core.ts

mfornet commented 3 years ago

Hi @Shahraaz, thanks for contributing. This is an interesting feature, can you describe here what is the use case you have in mind?

One thing I don't like, is that for users that don't have this command set they will always see a notification about startup command not specified. And if it is specified the terminal will be open which is a little disruptive.

Shahraaz commented 3 years ago

Hi @mfornet,

I really love using acmx for automation; the reason to add this feature is by default, we can configure acmx to copy only launch.json and task.json; but I need to copy a few more filesc_cpp_properties.json and settings.json to the current workspace(for some compiler flags which are needed for IntelliSense).

The straight forward way would be to add some more code to copyDefaultFilesToWorkspace in core.js, but after consulting with @dgc9715 (who has introduced me to acmx), we decided to add a provision to suggest a workspaceStartUpCommand slot where the user can suggest to do run any command/script at the start up.

One thing I don't like, is that for users that don't have this command set they will always see a notification about startup command not specified. And if it is specified the terminal will be open which is a little disruptive.

I understand, sorry for missing this. The default command is to run echo\"$PATH\", which can be replaced with something else of your choice. The user will be shown a notification if the default command is cleared.

In my case I run "$HOME/bin/getVscode.sh $PATH" and my script copies .vscode folder to current workspace.

#!/bin/bash
path=$PWD
if [ -z "$1" ]
then
    path=$PWD
else
    path="$1"
fi
echo path is $path
cd "$path"
cp -r /home/shahraaz/bin/.vscode ./

Please share your views on this feature.