Skip to content

Commit

Permalink
provisional work to support sln level config files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlacey committed Dec 2, 2024
1 parent a1938ac commit 749f2cf
Show file tree
Hide file tree
Showing 4 changed files with 351 additions and 276 deletions.
2 changes: 1 addition & 1 deletion src/WarnAboutTODOs.Vsix/source.extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal sealed partial class Vsix
public const string Name = "Warn About TODOs";
public const string Description = @"Displays warnings for TODO notes in comments";
public const string Language = "en-US";
public const string Version = "1.7.3";
public const string Version = "1.7.3.0";
public const string Author = "Matt Lacey";
public const string Tags = "";
}
Expand Down
2 changes: 1 addition & 1 deletion src/WarnAboutTODOs.Vsix/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="WarnAboutTODOs.c50458a5-b99a-484f-be10-f1a8714c1453" Version="1.7.3" Language="en-US" Publisher="Matt Lacey"/>
<Identity Id="WarnAboutTODOs.c50458a5-b99a-484f-be10-f1a8714c1453" Version="1.7.3.0" Language="en-US" Publisher="Matt Lacey"/>
<DisplayName>Warn About TODOs</DisplayName>
<Description xml:space="preserve">Displays warnings for TODO notes in comments</Description>
<MoreInfo>https://github.com/mrlacey/WarnAboutTodos</MoreInfo>
Expand Down
31 changes: 31 additions & 0 deletions src/WarnAboutTODOs/SolutionConfigFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// <copyright file="UserConfigFile.cs" company="Matt Lacey Ltd.">
// Copyright (c) Matt Lacey Ltd. All rights reserved.
// </copyright>

using System.IO;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;

namespace WarnAboutTODOs
{
internal class SolutionConfigFile : AdditionalText
{
private SolutionConfigFile(string path)
{
this.Path = path;
}

public override string Path { get; }

public static SolutionConfigFile FromFilePath(string configFileName)
{
return File.Exists(configFileName) ? new SolutionConfigFile(configFileName) : null;
}

public override SourceText GetText(CancellationToken cancellationToken = default(CancellationToken))
{
return SourceText.From(File.ReadAllText(this.Path));
}
}
}
Loading

0 comments on commit 749f2cf

Please sign in to comment.