Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to autorun certain commands on file actions #4

Merged

Conversation

jel-massih
Copy link
Collaborator

Runs:
edit on file save
add on file create
delete on file delete
These are all behind configuration options and disabled by default. Highly experimental.

Note some significant changes:
Activates the plugin on VSCode launch now, however will only apply listeners if the respective options are enabled.

Not very thoroughly tested so probably many edge cases. Very experimental.

Also sucks that VSCode doesnt have a presave hook so you have to choose "overwrite" when saving an existing file the first time if write protected.

@stef-levesque
Copy link
Owner

Hey, I was to code those features today! 😄
(but got lazy and play GTAV instead 😉 )

I would like to avoid "activationEvents" : "*" as much as possible, maybe @egamma know a way to do that.

As for Pre-save, this is part of their Roadmap (see microsoft/vscode#239)

I'll take some time to test your change before merging it, but so far, this seems fine. Thanks!

@jel-massih
Copy link
Collaborator Author

Yeah I agree with the activation events. Would be cool to have some kind of conditionals where certain activation rules are only set when certain configuration options are set or something.

Maybe just have a start command that activates the extension?

Also, added check to make sure file is in the p4 client root when saving. Uses p4 info.

I die a little inside everytime I nest another callback 😭

@jel-massih
Copy link
Collaborator Author

Also added editOnFileModified.

Checksout file when modified (caches until different file modified)

stef-levesque added a commit that referenced this pull request Nov 23, 2015
Added option to autorun certain commands on file actions
@stef-levesque stef-levesque merged commit c23a09d into stef-levesque:master Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants