Run TypeScript Compile after changing version control files

I installed TypeScript tools for Visual Studio 2015 and the compiler gets angry quickly (compared to my old Gulp process). I compile with saving the settings in the tsconfig file and everything works fine!

However, if I undo the change from the original control, it does not seem to cause compilation, as Ctrl + S does. Is there a way to force VS to run the file while saving the file that was modified using the source control?

+6
source share
1 answer

Please note that there are 3 different ways to β€œundo the change” in the source control: See β€œ Undo the changes ”

  • Discard uncommitted changes to the file, returning the file to the version in the last commit.
  • Reset your local branch to the previous commit.
  • Discard changes that have been transferred to the remote branch and shared with others.

There is no git hook for post-reset action .
(Despite the fact that Visual Studio 2017 did indeed introduce client support for git )

This leaves you with some kind of service host , but they are on the server side (for the Upstream Visual Studio Online project)

Which might work if your reset / undo affects the active document.
In this case, you can use DocumentEvents to start compiling typescript.
This is not a complete solution, but a starting point.

0
source

Source: https://habr.com/ru/post/1015596/


All Articles