bennor / AutoT4

A zero-configuration extension for Visual Studio 2012+ which automatically runs your T4 templates at build time.
MIT License
11 stars 14 forks source link

Close template window if it wasn't open before the run #18

Closed huysentruitw closed 7 years ago

huysentruitw commented 7 years ago

This solves the annoyance of having all .tt files open after each build. Template files that were previously closed will get closed again in the editor.

bennor commented 7 years ago

What version of VS are you using? I haven't had this reported before. Although looking at this code, it seems it's a fallback for some error case I just can't remember. Should usually be able to run with RunCustomTool().

I'll merge it after you clean up the formatting 👍

huysentruitw commented 7 years ago

I've tested this with VS2015, will update indentation right away.

huysentruitw commented 7 years ago

Oh, btw, a part of our .tt files are solution items and not project items, maybe that was the error/edge case you can't remember :)

bennor commented 7 years ago

I think you're right on the fact that they're solution items - that would explain there being no project item for them.

bennor commented 7 years ago

Thanks mate. I have one other bug to look into, and that could take a while, so I'll aim to have this released by early next week

huysentruitw commented 7 years ago

Hi Bennor, checked it today, but the AutoT4 package in the VisualStudio gallery is still the version before this fix. Is it possible to get it released or are you still waiting for that other bug-fix?

bennor commented 7 years ago

Sorry. I hit a roadblock with the other change and while I was waiting on a response to my question in the VS extensions Gitter, I forgot about this. Will get it released over the Easter break -- the other fix can wait (it may not be possible anyway).

huysentruitw commented 7 years ago

No problem, just wanted to send you some reminder ;) Thanks for considering the release. The strange thing is, if I install the own-built extension, then the tabs are closed again, but after some time (maybe VS restart) the issue comes back as if VS has overridden the extension with the version from the gallery and I need to reinstall the own-built version. Is this something you're aware of?

bennor commented 7 years ago

Not something I'm aware of, but it sort of makes sense.

I've updated the version in the gallery now anyway, so you should be good to use that now. Thanks again for the PR! 😄