Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Updated for ReSharper 10
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJul committed Nov 2, 2015
1 parent 3bca541 commit e1bfb1b
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 83 deletions.
80 changes: 43 additions & 37 deletions GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.csproj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions GammaJul.ReSharper.ForTea/GammaJul.ReSharper.ForTea.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>JLebosquain.ForTea</id>
<version>1.4.1</version>
<version>1.5.0</version>
<title>ForTea</title>
<authors>Julien Lebosquain</authors>
<description>Adds support for editing T4 text templating files (.tt)</description>
<releaseNotes>
Added support for ReSharper 9.2 (#54).
Added support for ReSharper 10.
</releaseNotes>
<projectUrl>https://github.com/MrJul/ForTea/</projectUrl>
<iconUrl>https://raw.github.com/MrJul/ForTea/master/Logo/ForTea%20128x128.png</iconUrl>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<copyright>Copyright &#x00A9; 2012-2015 Julien Lebosquain</copyright>
<tags>T4 Text Templating Template .tt</tags>
<dependencies>
<dependency id="Wave" version="[3.0]" />
<dependency id="Wave" version="[4.0]" />
</dependencies>
</metadata>
<files>
<file src="bin\Release\GammaJul.ReSharper.ForTea.v9.2.dll" target="DotFiles" />
<file src="bin\Release\GammaJul.ReSharper.ForTea.v10.0.dll" target="DotFiles" />
</files>
</package>
2 changes: 1 addition & 1 deletion GammaJul.ReSharper.ForTea/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
[assembly: AssemblyCopyright("Copyright © Julien Lebosquain, 2012-2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyVersion("1.5.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -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<JetHashSet<string>> _cultureCodes;
private readonly Lazy<JetHashSet<string>> _cultureCodes;
private ReadOnlyCollection<string> _intellisenseValues;

[NotNull]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<JetHashSet<string>> _encodings;
private readonly Lazy<JetHashSet<string>> _encodings;
private ReadOnlyCollection<string> _intellisenseValues;

[NotNull]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 3 additions & 8 deletions GammaJul.ReSharper.ForTea/Psi/T4ModuleReferencer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#endregion


using JetBrains.Metadata.Reader.API;
using System;
using System.Linq;
using GammaJul.ReSharper.ForTea.Psi.Directives;
Expand All @@ -38,27 +37,23 @@ 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;

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);
}


/// <summary>
/// Returns true if module is referenced
/// </summary>
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);
}

Expand Down
3 changes: 2 additions & 1 deletion GammaJul.ReSharper.ForTea/Psi/T4SecondaryLexingProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion GammaJul.ReSharper.ForTea/SupportedReSharperVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace GammaJul.ReSharper.ForTea {

internal static class SupportedReSharperVersion {

internal const string Value = "9.2";
internal const string Value = "10.0";

}

Expand Down
5 changes: 2 additions & 3 deletions GammaJul.ReSharper.ForTea/T4Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


using Microsoft.VisualStudio.TextTemplating.VSHost;
using JetBrains.Util.Lazy;
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
Expand All @@ -37,7 +36,7 @@ namespace GammaJul.ReSharper.ForTea {
public class T4Environment {

[NotNull] private readonly IVsEnvironmentInformation _vsEnvironmentInformation;
[NotNull] private readonly JetBrains.Util.Lazy.Lazy<Optional<ITextTemplatingComponents>> _components;
[NotNull] private readonly Lazy<Optional<ITextTemplatingComponents>> _components;
[NotNull] private readonly string[] _textTemplatingAssemblyNames;
[CanBeNull] private readonly PlatformID _platformID;
[CanBeNull] private IList<FileSystemPath> _includePaths;
Expand Down Expand Up @@ -128,7 +127,7 @@ private IList<FileSystemPath> ReadIncludePaths() {
public T4Environment([NotNull] IVsEnvironmentInformation vsEnvironmentInformation, [NotNull] RawVsServiceProvider rawVsServiceProvider) {
_vsEnvironmentInformation = vsEnvironmentInformation;

_components = Lazy.Of(() => new Optional<ITextTemplatingComponents>(rawVsServiceProvider.Value.GetService<STextTemplating, ITextTemplatingComponents>()));
_components = Lazy.Of(() => new Optional<ITextTemplatingComponents>(rawVsServiceProvider.Value.GetService<STextTemplating, ITextTemplatingComponents>()), true);

int vsMajorVersion = vsEnvironmentInformation.VsVersion2.Major;
switch (vsMajorVersion) {
Expand Down
44 changes: 24 additions & 20 deletions GammaJul.ReSharper.ForTea/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@
<package id="Antlr2.Runtime" version="2.7.7.02" targetFramework="net4" />
<package id="Antlr2.Tools" version="2.7.6.4" targetFramework="net4" />
<package id="DotNetZip.Reduced" version="1.9.1.8" targetFramework="net4" />
<package id="JetBrains.Annotations" version="9.2.0" targetFramework="net4" />
<package id="JetBrains.Annotations" version="10.0.0" targetFramework="net4" />
<package id="JetBrains.Build.Platform.Tasks.ThemedIconsPacker" version="2.0.20150812.0" targetFramework="net4" developmentDependency="true" />
<package id="JetBrains.ExternalAnnotations" version="9.2.1" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Ide" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Shell" version="103.0.20150818.190334" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Text" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Platform.Installer" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Platform.Interop.dotMemoryUnit.Interop" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.ExternalAnnotations" version="10.0.15" targetFramework="net4" />
<package id="JetBrains.Mono.Posix" version="0.1" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Ide" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Shell" version="104.0.20151101.164331" targetFramework="net4" />
<package id="JetBrains.Platform.Core.Text" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.Installer" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.Interop.dotMemoryUnit.Interop" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.DevExpress" version="2.0.20150224.0" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.Microsoft.Deployment.Compression.Cab" version="2.0.20140304.0" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.Microsoft.Deployment.WindowsInstaller" version="2.0.20140821.0" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.System.Windows.Interactivity" version="2.0.20140318.0" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.VisualStudio.AnyVs.ShellInterop.PrivateBuild" version="2.0.20140304.0" targetFramework="net4" />
<package id="JetBrains.Platform.Lib.WpfContrib" version="2.0.20150225.0" targetFramework="net4" />
<package id="JetBrains.Platform.Symbols" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Platform.Tests.Framework" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Platform.VisualStudio" version="103.0.20150818.200225" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Core" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Cpp.src" version="103.0.20150819.153342" targetFramework="net4" />
<package id="JetBrains.Psi.Features.SolutionBuilder" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.src" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Tasks" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.test.Framework" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.UnitTesting" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.Psi.Features.VisualStudio" version="103.0.20150819.145114" targetFramework="net4" />
<package id="JetBrains.ReSharper.SDK" version="9.2.20150819.163916" targetFramework="net4" developmentDependency="true" />
<package id="JetBrains.Platform.Symbols" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.Tests.Framework" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Platform.VisualStudio" version="104.0.20151101.164845" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Core" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Cpp.src" version="104.0.20151101.190744" targetFramework="net4" />
<package id="JetBrains.Psi.Features.SolutionBuilder" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.src" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.Tasks" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.test.Framework" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.UnitTesting" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.Psi.Features.VisualStudio" version="104.0.20151101.185700" targetFramework="net4" />
<package id="JetBrains.ReSharper.SDK" version="10.0.20151101.194233" targetFramework="net4" developmentDependency="true" />
<package id="JetBrains.ReSharper.SDK.Internal" version="104.0.20151101.194233" targetFramework="net4" />
<package id="JetBrains.Unix.Utils" version="20150702.4" targetFramework="net4" />
<package id="Microsoft.VC100.CRT.JetBrains" version="10.00.40219.2" targetFramework="net4" />
<package id="Microsoft.VC120.CRT.JetBrains" version="12.0.21005.2" targetFramework="net4" />
Expand All @@ -38,11 +40,13 @@
<package id="NuGet.Core" version="2.8.6" targetFramework="net4" />
<package id="NUnit" version="2.6.4" targetFramework="net4" />
<package id="NUnit.Core" version="2.6.4" targetFramework="net4" />
<package id="NUnit.ReSharperRunner2" version="2.6.408" targetFramework="net4" />
<package id="NUnit.ReSharperRunner3" version="3.0.11" targetFramework="net4" />
<package id="NVelocity" version="1.0.3" targetFramework="net4" />
<package id="SharpZipLib.JetBrains.Stripped" version="0.86.20150204.1" targetFramework="net4" />
<package id="Sprache.JetBrains" version="2.0.0.44" targetFramework="net4" />
<package id="Vestris.ResourceLib.JetBrains" version="1.4.20150303.0" targetFramework="net4" />
<package id="Wave" version="3.0.0.0" targetFramework="net4" />
<package id="Wave" version="4.0.0.0" targetFramework="net4" />
<package id="WinDbg.SymStore" version="8.1.20130822.1833" targetFramework="net4" developmentDependency="true" />
<package id="Windows7APICodePack.JetBrains.Stripped" version="1.1.20150225.0" targetFramework="net4" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net4" />
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down

0 comments on commit e1bfb1b

Please sign in to comment.