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

Switch to onWillSaveTextDocument #76

Closed
SamVerschueren opened this issue Oct 6, 2016 · 2 comments · Fixed by #80
Closed

Switch to onWillSaveTextDocument #76

SamVerschueren opened this issue Oct 6, 2016 · 2 comments · Fixed by #80
Assignees

Comments

@SamVerschueren
Copy link
Collaborator

The latest insider build has this new event called onWillSaveTextDocument. This allows us to return a TextEdit array which will be applied to the document.

I already made the switch in my vscode-final-newline plugin. Works really great and this also works with the Save All option, which isn't the case with the current implementation.

I will have a look when I find the time.

@jednano
Copy link
Member

jednano commented Oct 6, 2016

Sounds excellent!

@SamVerschueren
Copy link
Collaborator Author

The onWillSaveTextDocument has more information regarding the source of the save action (e.g. autosave, manual save, etc.). Maybe we should only apply the transformations when the file is being saved manually? This might fix #58. Although not sure if that's a good strategy because people who use autosave might never press cmd+s themselves.

jednano pushed a commit that referenced this issue Oct 19, 2016
use onWillSaveTextDocument - fixes #76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants