diff --git a/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.csproj b/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.csproj index d89df6e..31d2001 100644 --- a/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.csproj +++ b/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.csproj @@ -3,7 +3,9 @@ {63F25238-06BA-4861-95A2-DA35A1D18B65} - GammaJul.ReSharper.ForTea.v9.2 + GammaJul.ReSharper.ForTea.v10.0 + + @@ -45,8 +47,8 @@ ..\packages\JetBrains.Unix.Utils.20150702.4\lib\net40\JbUnixUtils.dll True - - ..\packages\JetBrains.Annotations.9.2.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.10.0.0\lib\net20\JetBrains.Annotations.dll True @@ -82,6 +84,10 @@ ..\packages\Windows7APICodePack.JetBrains.Stripped.1.1.20150225.0\lib\Net\Microsoft.WindowsAPICodePack.Shell.dll True + + ..\packages\JetBrains.Mono.Posix.0.1\lib\net40\Mono.Posix.dll + True + False ..\packages\Newtonsoft35.Json.7.0.1\lib\net35\Newtonsoft.Json.dll @@ -294,41 +300,41 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.nuspec b/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.nuspec index ed7a7ea..ec307e6 100644 --- a/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.nuspec +++ b/GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.nuspec @@ -2,12 +2,12 @@ JLebosquain.ForTea - 1.4.1 + 1.5.0 ForTea Julien Lebosquain Adds support for editing T4 text templating files (.tt) - Added support for ReSharper 9.2 (#54). + Added support for ReSharper 10. https://github.com/MrJul/ForTea/ https://raw.github.com/MrJul/ForTea/master/Logo/ForTea%20128x128.png @@ -15,10 +15,10 @@ Copyright © 2012-2015 Julien Lebosquain T4 Text Templating Template .tt - + - + diff --git a/GammaJul.ReSharper.ForTea/Properties/AssemblyInfo.cs b/GammaJul.ReSharper.ForTea/Properties/AssemblyInfo.cs index 84ff727..3b61f8a 100644 --- a/GammaJul.ReSharper.ForTea/Properties/AssemblyInfo.cs +++ b/GammaJul.ReSharper.ForTea/Properties/AssemblyInfo.cs @@ -24,4 +24,4 @@ [assembly: AssemblyCopyright("Copyright © Julien Lebosquain, 2012-2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.4.1.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.5.0.0")] \ No newline at end of file diff --git a/GammaJul.ReSharper.ForTea/Psi/Directives/CultureDirectiveAttributeInfo.cs b/GammaJul.ReSharper.ForTea/Psi/Directives/CultureDirectiveAttributeInfo.cs index d76adaf..88d9e54 100644 --- a/GammaJul.ReSharper.ForTea/Psi/Directives/CultureDirectiveAttributeInfo.cs +++ b/GammaJul.ReSharper.ForTea/Psi/Directives/CultureDirectiveAttributeInfo.cs @@ -19,12 +19,12 @@ using System.Globalization; using System.Linq; using JetBrains.Annotations; -using JetBrains.Util.Lazy; +using JetBrains.Util; namespace GammaJul.ReSharper.ForTea.Psi.Directives { public class CultureDirectiveAttributeInfo : DirectiveAttributeInfo { - private readonly JetBrains.Util.Lazy.Lazy> _cultureCodes; + private readonly Lazy> _cultureCodes; private ReadOnlyCollection _intellisenseValues; [NotNull] diff --git a/GammaJul.ReSharper.ForTea/Psi/Directives/EncodingDirectiveAttributeInfo.cs b/GammaJul.ReSharper.ForTea/Psi/Directives/EncodingDirectiveAttributeInfo.cs index 8c4e972..be49932 100644 --- a/GammaJul.ReSharper.ForTea/Psi/Directives/EncodingDirectiveAttributeInfo.cs +++ b/GammaJul.ReSharper.ForTea/Psi/Directives/EncodingDirectiveAttributeInfo.cs @@ -19,13 +19,13 @@ using System.Linq; using System.Text; using JetBrains.Annotations; -using JetBrains.Util.Lazy; +using JetBrains.Util; namespace GammaJul.ReSharper.ForTea.Psi.Directives { public class EncodingDirectiveAttributeInfo : DirectiveAttributeInfo { - private readonly JetBrains.Util.Lazy.Lazy> _encodings; + private readonly Lazy> _encodings; private ReadOnlyCollection _intellisenseValues; [NotNull] diff --git a/GammaJul.ReSharper.ForTea/Psi/T4CSharpCustomModificationHandler.cs b/GammaJul.ReSharper.ForTea/Psi/T4CSharpCustomModificationHandler.cs index 3042acb..d6fc2ad 100644 --- a/GammaJul.ReSharper.ForTea/Psi/T4CSharpCustomModificationHandler.cs +++ b/GammaJul.ReSharper.ForTea/Psi/T4CSharpCustomModificationHandler.cs @@ -27,6 +27,7 @@ using JetBrains.ReSharper.Psi; using JetBrains.ReSharper.Psi.CSharp; using JetBrains.ReSharper.Psi.CSharp.CodeStyle; +using JetBrains.ReSharper.Psi.CSharp.CodeStyle.Settings; using JetBrains.ReSharper.Psi.CSharp.Impl.CustomHandlers; using JetBrains.ReSharper.Psi.CSharp.Parsing; using JetBrains.ReSharper.Psi.CSharp.Tree; diff --git a/GammaJul.ReSharper.ForTea/Psi/T4ModuleReferencer.cs b/GammaJul.ReSharper.ForTea/Psi/T4ModuleReferencer.cs index ab1facf..02b1d6e 100644 --- a/GammaJul.ReSharper.ForTea/Psi/T4ModuleReferencer.cs +++ b/GammaJul.ReSharper.ForTea/Psi/T4ModuleReferencer.cs @@ -15,7 +15,6 @@ #endregion -using JetBrains.Metadata.Reader.API; using System; using System.Linq; using GammaJul.ReSharper.ForTea.Psi.Directives; @@ -38,7 +37,7 @@ public class T4ModuleReferencer : IModuleReferencer { private readonly T4Environment _environment; private readonly DirectiveInfoManager _directiveInfoManager; - private bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference) { + public bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference) { var t4PsiModule = module as T4PsiModule; if (t4PsiModule == null || !t4PsiModule.IsValid() || moduleToReference == null) return false; @@ -46,11 +45,7 @@ private bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference) var assembly = moduleToReference.ContainingProjectModule as IAssembly; return assembly != null && assembly.PlatformID != null && assembly.PlatformID.Identifier == _environment.PlatformID.Identifier; } - - public bool CanReferenceModule(IPsiModule module, IPsiModule moduleToReference, IModuleReferenceResolveContext context) { - return CanReferenceModule(module, moduleToReference); - } - + /// /// Returns true if module is referenced /// @@ -58,7 +53,7 @@ public bool ReferenceModule(IPsiModule module, IPsiModule moduleToReference) { return ReferenceModuleImpl(module, moduleToReference, null); } - public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToReference, IModuleReferenceResolveContext resolveContext) { + public bool ReferenceModuleWithType(IPsiModule module, ITypeElement typeToReference) { return ReferenceModuleImpl(module, typeToReference.Module, typeToReference.GetContainingNamespace().QualifiedName); } diff --git a/GammaJul.ReSharper.ForTea/Psi/T4SecondaryLexingProcess.cs b/GammaJul.ReSharper.ForTea/Psi/T4SecondaryLexingProcess.cs index 31e1da0..29d5359 100644 --- a/GammaJul.ReSharper.ForTea/Psi/T4SecondaryLexingProcess.cs +++ b/GammaJul.ReSharper.ForTea/Psi/T4SecondaryLexingProcess.cs @@ -41,7 +41,8 @@ public ILexer TryCreateCodeBehindLexer(ILexer baseLexer) { if (baseLexer.TokenType == T4TokenNodeTypes.Code) { LanguageService service = _codeBehindLanguage.LanguageService(); if (service != null) { - var buffer = new ProjectedBuffer(_mixedLexer.Buffer, + var buffer = ProjectedBuffer.Create( + _mixedLexer.Buffer, new TextRange(_mixedLexer.PrimaryLexer.TokenStart, _mixedLexer.PrimaryLexer.AdvanceWhile(T4TokenNodeTypes.Code))); ILexer lexer = service.GetPrimaryLexerFactory().CreateLexer(buffer); lexer.Start(); diff --git a/GammaJul.ReSharper.ForTea/SupportedReSharperVersion.cs b/GammaJul.ReSharper.ForTea/SupportedReSharperVersion.cs index 2ba5cee..6268355 100644 --- a/GammaJul.ReSharper.ForTea/SupportedReSharperVersion.cs +++ b/GammaJul.ReSharper.ForTea/SupportedReSharperVersion.cs @@ -17,7 +17,7 @@ namespace GammaJul.ReSharper.ForTea { internal static class SupportedReSharperVersion { - internal const string Value = "9.2"; + internal const string Value = "10.0"; } diff --git a/GammaJul.ReSharper.ForTea/T4Environment.cs b/GammaJul.ReSharper.ForTea/T4Environment.cs index 6a5d4ff..597c947 100644 --- a/GammaJul.ReSharper.ForTea/T4Environment.cs +++ b/GammaJul.ReSharper.ForTea/T4Environment.cs @@ -16,7 +16,6 @@ using Microsoft.VisualStudio.TextTemplating.VSHost; -using JetBrains.Util.Lazy; using System; using System.Collections.Generic; using JetBrains.Annotations; @@ -37,7 +36,7 @@ namespace GammaJul.ReSharper.ForTea { public class T4Environment { [NotNull] private readonly IVsEnvironmentInformation _vsEnvironmentInformation; - [NotNull] private readonly JetBrains.Util.Lazy.Lazy> _components; + [NotNull] private readonly Lazy> _components; [NotNull] private readonly string[] _textTemplatingAssemblyNames; [CanBeNull] private readonly PlatformID _platformID; [CanBeNull] private IList _includePaths; @@ -128,7 +127,7 @@ private IList ReadIncludePaths() { public T4Environment([NotNull] IVsEnvironmentInformation vsEnvironmentInformation, [NotNull] RawVsServiceProvider rawVsServiceProvider) { _vsEnvironmentInformation = vsEnvironmentInformation; - _components = Lazy.Of(() => new Optional(rawVsServiceProvider.Value.GetService())); + _components = Lazy.Of(() => new Optional(rawVsServiceProvider.Value.GetService()), true); int vsMajorVersion = vsEnvironmentInformation.VsVersion2.Major; switch (vsMajorVersion) { diff --git a/GammaJul.ReSharper.ForTea/packages.config b/GammaJul.ReSharper.ForTea/packages.config index 36da558..3750f88 100644 --- a/GammaJul.ReSharper.ForTea/packages.config +++ b/GammaJul.ReSharper.ForTea/packages.config @@ -3,32 +3,34 @@ - + - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + @@ -38,11 +40,13 @@ + + - + diff --git a/README.md b/README.md index 9c1adf3..9b2035e 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ What's ForTea? -------------- -ForTea is a a plugin for [JetBrains ReSharper](http://www.jetbrains.com/resharper/) 9.2 that adds support for editing T4 (.tt) files. +ForTea is a a plugin for [JetBrains ReSharper](http://www.jetbrains.com/resharper/) that adds support for editing T4 (.tt) files. This project corresponds to the issue [RSRP-191807](http://youtrack.jetbrains.com/issue/RSRP-191807) in JetBrains bug tracker. -Latest version is 1.4.1 (2015-09-16), please see the [Releases](https://github.com/MrJul/ForTea/releases). +Latest version is 1.5.0 (2015-11-02), please see the [Releases](https://github.com/MrJul/ForTea/releases). Don't hesitate to [open an issue](https://github.com/MrJul/ForTea/issues) if you encounter any problem. Installation ------------ -Visual Studio 2010, 2012, 2013 and 2015 Preview are supported. -ReSharper 9.2 must be installed. +Visual Studio 2010, 2012, 2013 and 2015 are supported. +ReSharper 10.0 must be installed (older releases are still available for ReSharper 9.2, 9.1, 9.0 and 8.2). To install ForTea, use Extension Manager from the ReSharper menu.