Comments (7)
Perhaps this would work too? Not sure not the best coder in the world. it seems VS Code referees to any source file. as "text"
onDidSaveTextDocument: Event
There's also createFileSystemWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher
Your solution of a hot key to both would also solve the problem, have a look at those API references and let me know if either are useful
from auto-commit-msg.
Ah, nice idea
from auto-commit-msg.
I couldn't find that event here :( https://code.visualstudio.com/api/references/activation-events
Oh wait that is when the extension activates (like on startup), not when it runs.
from auto-commit-msg.
Let me know if you find anything. Or any extensions to base on.
Other extensions I know of listen use the format on save flow, so listening to format event rather than save event. Maybe I can hook into that? Can't see anything useful for formatting or saving here. https://github.com/prettier/prettier-vscode/search?q=save
An alternative would be to add another button, or a mode, or keyboard shortcut. To generate and commit in one move, at the loss of seeing the message in between.
from auto-commit-msg.
I found https://code.visualstudio.com/api/references/vscode-api in the docs
I am seeing stuff print when using onDidSaveTextDocument
like this.
context.subscriptions.push(disposable);
context.subscriptions.push(
vscode.workspace.onDidSaveTextDocument(e => {
console.log(`Running because of file change: ${e}`)
vscode.window.showInformationMessage(`Running because of file change: ${e}`)
})
)
Use in VS Code
And in another project
from auto-commit-msg.
@decryptedchaos I have #66 #67.
You can try it out
git checkout auto-commit-msg
git pull
git checkout feat-add-save-hook
make ext
from auto-commit-msg.
Yep, Will check it out when i'm back at my desk
Thanks for the addition.
from auto-commit-msg.
Related Issues (20)
- Get file extension for file counts
- Add docs site HOT 2
- Use full name on repeats
- Infer action from lines
- Suggestion: Allow you to define prefix HOT 4
- Filenames with spaces HOT 8
- Upgrade to Node 17
- Include An Option to Auto Commit Messages Using Smart Commit HOT 3
- Add scope
- Add test for moved file
- Not generating message HOT 2
- Add an option to make messages capitalized HOT 8
- Scope use case HOT 2
- Extension stopped working for me HOT 17
- Stopped working HOT 15
- Error on Windows - shell cannot spawn HOT 15
- Replace old message when generating a new one HOT 1
- Unable to load Git Extension HOT 3
- Clicking "auto commit message" collapses side bar HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-commit-msg.