-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provisional work to support sln level config files
- Loading branch information
Showing
4 changed files
with
351 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
Oops, something went wrong.