mrcrowl / vscode-easy-less

Easy LESS extension for Visual Studio Code
MIT License
67 stars 23 forks source link

Fixed #23; Retarget to vscode 1.6; better command logic #25

Closed yume-chan closed 7 years ago

yume-chan commented 7 years ago

This pr contains 3 changes:

  1. Fixed #23. This commit causes options.sourceMap to be overwritten, why do you do this? Incorrectly resolved merge conflict?

  2. 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.

  3. 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!

mrcrowl commented 7 years ago

@CnSimonChan Thanks for the great work. Sorry for the delay in getting to this. Looks good. Merging.