Welcome to mirror list, hosted at ThFree Co, Russian Federation.

XmlText.cs « ILLink.RoslynAnalyzer.Tests « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 61d82465c2a0b8c0fa719bbe067d02855e92912c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

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

namespace ILLink.RoslynAnalyzer.Tests
{
	sealed class XmlText : AdditionalText
	{
		public override string Path { get; }

		readonly Stream Doc;
		public XmlText (string path, Stream data)
		{
			Path = path;
			Doc = data;
		}

		public override SourceText? GetText (CancellationToken token = default)
		{
			return SourceText.From (Doc);
		}
	}
}