Skip to content

Commit

Permalink
- Extract Editor namespace into a new T4Toolbox.VisualStudio.Editor a…
Browse files Browse the repository at this point in the history
…ssembly.

- Change Visual Studio assembly references to specify v14.0 explicitly and avoid version conflicts
  • Loading branch information
olegsych committed Jun 15, 2015
1 parent d1c6457 commit 7b06d56
Show file tree
Hide file tree
Showing 57 changed files with 408 additions and 178 deletions.
2 changes: 2 additions & 0 deletions CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
[assembly: InternalsVisibleTo("T4Toolbox.TemplateAnalysis.Tests" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.Tests" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.VisualStudio" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.VisualStudio.Editor" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.VisualStudio.Editor.Tests" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.VisualStudio.IntegrationTests" + T4Toolbox.AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("T4Toolbox.VisualStudio.Tests" + T4Toolbox.AssemblyInfo.PublicKey)]

Expand Down
67 changes: 42 additions & 25 deletions T4Toolbox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{0658B25D
build\Module.psm1 = build\Module.psm1
build\Module.tests.ps1 = build\Module.tests.ps1
EndProjectSection
ProjectSection(FolderStartupServices) = postProject
{82A7F48D-3B50-4B1E-B82E-3ADA8210C358} = {82A7F48D-3B50-4B1E-B82E-3ADA8210C358}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "T4Toolbox.VisualStudio.Editor", "src\T4Toolbox.VisualStudio.Editor\T4Toolbox.VisualStudio.Editor.csproj", "{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "T4Toolbox.VisualStudio.Editor.Tests", "test\T4Toolbox.VisualStudio.Editor.Tests\T4Toolbox.VisualStudio.Editor.Tests.csproj", "{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -66,26 +73,18 @@ Global
{682E771A-76F7-4972-BBDC-1250B67F399B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{682E771A-76F7-4972-BBDC-1250B67F399B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{682E771A-76F7-4972-BBDC-1250B67F399B}.Release|Any CPU.Build.0 = Release|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Release|Any CPU.Build.0 = Release|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Release|Any CPU.Build.0 = Release|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Release|Any CPU.Build.0 = Release|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Release|Any CPU.Build.0 = Release|Any CPU
{E0282961-2D83-48CC-B4D4-8257449CF8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0282961-2D83-48CC-B4D4-8257449CF8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0282961-2D83-48CC-B4D4-8257449CF8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0282961-2D83-48CC-B4D4-8257449CF8F7}.Release|Any CPU.Build.0 = Release|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Release|Any CPU.Build.0 = Release|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E1E9161-CBE4-4538-928C-539AA5E70153}.Release|Any CPU.Build.0 = Release|Any CPU
{EA04B345-97BE-4A49-9C9C-3EBD4F5D2250}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA04B345-97BE-4A49-9C9C-3EBD4F5D2250}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA04B345-97BE-4A49-9C9C-3EBD4F5D2250}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -94,28 +93,46 @@ Global
{8E492B04-AF03-4A88-9A5D-D34D2386A4E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E492B04-AF03-4A88-9A5D-D34D2386A4E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E492B04-AF03-4A88-9A5D-D34D2386A4E5}.Release|Any CPU.Build.0 = Release|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}.Release|Any CPU.Build.0 = Release|Any CPU
{A5EF918A-982F-4357-8CF8-D01E7D98FD80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5EF918A-982F-4357-8CF8-D01E7D98FD80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5EF918A-982F-4357-8CF8-D01E7D98FD80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5EF918A-982F-4357-8CF8-D01E7D98FD80}.Release|Any CPU.Build.0 = Release|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE}.Release|Any CPU.Build.0 = Release|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{846B29AB-AAA2-4080-B4B4-A440948CC61A}.Release|Any CPU.Build.0 = Release|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CBACA4C-728A-4818-839C-E22C24677AFA}.Release|Any CPU.Build.0 = Release|Any CPU
{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}.Release|Any CPU.Build.0 = Release|Any CPU
{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{682E771A-76F7-4972-BBDC-1250B67F399B} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{1E1E9161-CBE4-4538-928C-539AA5E70153} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{846B29AB-AAA2-4080-B4B4-A440948CC61A} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{7CBACA4C-728A-4818-839C-E22C24677AFA} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{E0282961-2D83-48CC-B4D4-8257449CF8F7} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{1E1E9161-CBE4-4538-928C-539AA5E70153} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{EA04B345-97BE-4A49-9C9C-3EBD4F5D2250} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{8E492B04-AF03-4A88-9A5D-D34D2386A4E5} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{A5EF918A-982F-4357-8CF8-D01E7D98FD80} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{2A05BF5E-B2B2-4222-91A3-BB86AE8A94CE} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{846B29AB-AAA2-4080-B4B4-A440948CC61A} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{7CBACA4C-728A-4818-839C-E22C24677AFA} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E} = {3594248C-C8A9-4EAB-8E63-0914300D4ECE}
{E8BB5F81-8B2B-4DD4-BAAF-A22C26183F41} = {994DFDA5-97F7-4688-A2FA-6D8E7AB2BC18}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Text.Data" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
Expand Down
21 changes: 21 additions & 0 deletions src/T4Toolbox.VisualStudio.Editor/ITemplateEditorOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// <copyright file="ITemplateEditorOptions.cs" company="Oleg Sych">
// Copyright © Oleg Sych. All Rights Reserved.
// </copyright>

namespace T4Toolbox.VisualStudio.Editor
{
internal interface ITemplateEditorOptions
{
bool CompletionListsEnabled { get; }

bool ErrorReportingEnabled { get; }

bool ErrorUnderliningEnabled { get; }

bool QuickInfoTooltipsEnabled { get; }

bool SyntaxColorizationEnabled { get; }

bool TemplateOutliningEnabled { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\T4Toolbox.Common.props" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<ProjectGuid>{FDE953D3-AD27-4398-8EF4-293C0CEBDC3E}</ProjectGuid>
<OutputType>Library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Editor, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Language.Intellisense, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.Logic, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\T4Toolbox.TemplateAnalysis\T4Toolbox.TemplateAnalysis.csproj">
<Project>{65bf3fa7-6b2b-47dd-8fc1-bb25754f12d3}</Project>
<Name>T4Toolbox.TemplateAnalysis</Name>
</ProjectReference>
<ProjectReference Include="..\T4Toolbox\T4Toolbox.csproj">
<Project>{682e771a-76f7-4972-bbdc-1250b67f399b}</Project>
<Name>T4Toolbox</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="$(SolutionDir)\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="ClassificationFormatDefinitions.cs" />
<Compile Include="ClassificationTypeDefinitions.cs" />
<Compile Include="ClassificationTypeName.cs" />
<Compile Include="ITemplateEditorOptions.cs" />
<Compile Include="TemplateAnalysis.cs" />
<Compile Include="TemplateAnalyzer.cs" />
<Compile Include="TemplateClassificationTagger.cs" />
<Compile Include="TemplateClassificationTaggerProvider.cs" />
<Compile Include="TemplateCompletionBuilder.cs" />
<Compile Include="TemplateCompletionHandler.cs" />
<Compile Include="TemplateCompletionHandlerProvider.cs" />
<Compile Include="TemplateCompletionSource.cs" />
<Compile Include="TemplateCompletionSourceProvider.cs" />
<Compile Include="TemplateContentType.cs" />
<Compile Include="TemplateErrorReporter.cs" />
<Compile Include="TemplateErrorReporterProvider.cs" />
<Compile Include="TemplateErrorTagger.cs" />
<Compile Include="TemplateErrorTaggerProvider.cs" />
<Compile Include="TemplateOutliningTagger.cs" />
<Compile Include="TemplateOutliningTaggerProvider.cs" />
<Compile Include="TemplateQuickInfoSource.cs" />
<Compile Include="TemplateQuickInfoSourceProvider.cs" />
<Compile Include="TemplateTagger.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ namespace T4Toolbox.VisualStudio.Editor
[Export(typeof(ITaggerProvider)), TagType(typeof(ClassificationTag)), ContentType(TemplateContentType.Name)]
internal sealed class TemplateClassificationTaggerProvider : ITaggerProvider
{
private readonly ITemplateEditorOptions options;

[ImportingConstructor]
public TemplateClassificationTaggerProvider(ITemplateEditorOptions options)
{
// TODO: throw ArgumentNullException
this.options = options;
}

// TODO: make private field, initialized by constructor
[Import]
internal IClassificationTypeRegistryService ClassificationRegistry { private get; set; }

public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
if (T4ToolboxOptions.Instance.SyntaxColorizationEnabled)
if (this.options.SyntaxColorizationEnabled)
{
return buffer.Properties.GetOrCreateSingletonProperty(() => new TemplateClassificationTagger(buffer, this.ClassificationRegistry)) as ITagger<T>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,26 @@ namespace T4Toolbox.VisualStudio.Editor
[Export(typeof(IVsTextViewCreationListener)), ContentType(TemplateContentType.Name), TextViewRole(PredefinedTextViewRoles.Editable)]
internal sealed class TemplateCompletionHandlerProvider : IVsTextViewCreationListener
{
// TODO: make private fields initialized by constructor
[Import]internal IVsEditorAdaptersFactoryService AdapterFactory;
[Import]internal SVsServiceProvider ServiceProvider;
[Import]internal ICompletionBroker CompletionBroker;

private readonly ITemplateEditorOptions options;

[ImportingConstructor]
public TemplateCompletionHandlerProvider(ITemplateEditorOptions options)
{
// TODO: throw ArgumentNullException
this.options = options;
}

public void VsTextViewCreated(IVsTextView viewAdapter)
{
Debug.Assert(this.AdapterFactory != null, "AdapterFactory");
Debug.Assert(viewAdapter != null, "viewAdapter");

if (!T4ToolboxOptions.Instance.CompletionListsEnabled)
if (!this.options.CompletionListsEnabled)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace T4Toolbox.VisualStudio.Editor
using System.Linq;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using T4Toolbox.TemplateAnalysis;

internal sealed class TemplateCompletionSource : ICompletionSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ namespace T4Toolbox.VisualStudio.Editor
[Export(typeof(ITaggerProvider)), TagType(typeof(ErrorTag)), ContentType(TemplateContentType.Name)]
internal sealed class TemplateErrorReporterProvider : ITaggerProvider
{
private readonly ITemplateEditorOptions options;

// TODO: change to private fields
[Import]
private SVsServiceProvider serviceProvider = null;

[Import]
private ITextDocumentFactoryService documentFactory = null;

[ImportingConstructor]
public TemplateErrorReporterProvider(ITemplateEditorOptions options)
{
// TODO: throw ArgumentNullException
this.options = options;
}

public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag
{
if (T4ToolboxOptions.Instance.ErrorReportingEnabled)
if (this.options.ErrorReportingEnabled)
{
TemplateErrorReporter.GetOrCreate(buffer, this.serviceProvider, this.documentFactory);
}
Expand Down
Loading

0 comments on commit 7b06d56

Please sign in to comment.