diff --git a/docs/pages/changelog.html b/docs/pages/changelog.html index f1faa5a5..f64450b9 100644 --- a/docs/pages/changelog.html +++ b/docs/pages/changelog.html @@ -61,6 +61,15 @@

Change log

+

Typewriter 1.17

+

Option to not add generated files to the current project.

+ +

1.17.0

+ +

Typewriter 1.16

Support for generating ValueTuples.

diff --git a/src/Typewriter/Generation/Template.cs b/src/Typewriter/Generation/Template.cs index 9b4e51de..7b25b8b8 100644 --- a/src/Typewriter/Generation/Template.cs +++ b/src/Typewriter/Generation/Template.cs @@ -158,12 +158,12 @@ protected virtual void SaveFile(File file, string output, ref bool success) var hasChanged = HasChanged(outputPath, output); - if (!ExtensionPackage.Instance.Options.AddGeneratedFilesToProject) + if (ExtensionPackage.Instance.Options.AddGeneratedFilesToProject == false) { if (hasChanged) { WriteFile(outputPath, output); - Log.Info($"Output file {outputPath} had been wrote."); + Log.Debug($"Output file '{outputPath}' saved."); } return; } @@ -172,7 +172,19 @@ protected virtual void SaveFile(File file, string output, ref bool success) { CheckOutFileFromSourceControl(outputPath); WriteFile(outputPath, output); - item = FindProjectItem(outputPath) ?? _projectItem.ProjectItems.AddFromFile(outputPath); + item = FindProjectItem(outputPath); + + if (item == null) + { + try + { + item = _projectItem.ProjectItems.AddFromFile(outputPath); + } + catch (Exception exception) + { + Log.Error($"Unable to add '{outputPath}' to project. {exception.Message}"); + } + } } else { diff --git a/src/Typewriter/Properties/SharedAssemblyInfo.cs b/src/Typewriter/Properties/SharedAssemblyInfo.cs index e991b8df..285a94f2 100644 --- a/src/Typewriter/Properties/SharedAssemblyInfo.cs +++ b/src/Typewriter/Properties/SharedAssemblyInfo.cs @@ -12,4 +12,4 @@ [assembly: NeutralResourcesLanguage("en-US")] -[assembly: AssemblyVersion("1.16.0.*")] \ No newline at end of file +[assembly: AssemblyVersion("1.17.0.*")] \ No newline at end of file diff --git a/src/Typewriter/VisualStudio/ExtensionPackage.cs b/src/Typewriter/VisualStudio/ExtensionPackage.cs index 55afaa5e..2dee092e 100644 --- a/src/Typewriter/VisualStudio/ExtensionPackage.cs +++ b/src/Typewriter/VisualStudio/ExtensionPackage.cs @@ -20,7 +20,7 @@ namespace Typewriter.VisualStudio [Guid(Constants.ExtensionPackageId)] [PackageRegistration(UseManagedResourcesOnly = true)] [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)] - [InstalledProductRegistration("#110", "#112", "1.16.0", IconResourceID = 401)] + [InstalledProductRegistration("#110", "#112", "1.17.0", IconResourceID = 401)] [ProvideLanguageService(typeof(LanguageService), Constants.LanguageName, 100, DefaultToInsertSpaces = true)] [ProvideLanguageExtension(typeof(LanguageService), Constants.TemplateExtension)] [ProvideMenuResource("Menus.ctmenu", 1)] diff --git a/src/Typewriter/source.extension.vsixmanifest b/src/Typewriter/source.extension.vsixmanifest index 2ef0b5e5..08562cd8 100644 --- a/src/Typewriter/source.extension.vsixmanifest +++ b/src/Typewriter/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Typewriter Typewriter generates TypeScript files from c# code files using TypeScript Templates. This allows you to create fully typed TypeScript representations of server side API that automatically updates when you make changes to your c# code. http://frhagn.github.io/Typewriter/