Fixed #23. This commit causes options.sourceMap to be overwritten, why do you do this? Incorrectly resolved merge conflict?
Retarget to vscode 1.6, so I can use the new onWillSaveTextDocument instead of onDidSaveTextDocument.
onWillSaveTextDocument event will be triggered when auto-save or explicitly invoke save command, even if the file is not dirty, i.e when imports changed, user can hit Ctrl + S/Command + S to trigger a re-compilation easily.
Because of the file on disk is not updated when onWillSaveTextDocument fires, so I also changed to use Document#getText() to get the content, except for reading the main file.
Changed the logic of the command. The command will just save the .less file. I think when invoke the command on a dirty file, it's more reasonable to save the file first. Then the event handler will do the remaining thing.
I'm new to vscode extension development, so if there is anything wrong, please correct me!
This pr contains 3 changes:
Fixed #23. This commit causes
options.sourceMap
to be overwritten, why do you do this? Incorrectly resolved merge conflict?Retarget to vscode 1.6, so I can use the new
onWillSaveTextDocument
instead ofonDidSaveTextDocument
.onWillSaveTextDocument
event will be triggered when auto-save or explicitly invoke save command, even if the file is not dirty, i.e when imports changed, user can hitCtrl
+S
/Command
+S
to trigger a re-compilation easily.Because of the file on disk is not updated when
onWillSaveTextDocument
fires, so I also changed to useDocument#getText()
to get the content, except for reading the main file.Changed the logic of the command. The command will just save the
.less
file. I think when invoke the command on a dirty file, it's more reasonable to save the file first. Then the event handler will do the remaining thing.I'm new to vscode extension development, so if there is anything wrong, please correct me!