Skip to content

Commit a16e4d2

Browse files
authored
Merge pull request #36249 from dibarbet/only_lsp_merge
Add only LSP server projects without liveshare dependencies.
2 parents c42daa2 + 4d79a2e commit a16e4d2

File tree

73 files changed

+3814
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3814
-2
lines changed

Roslyn.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
396396
EndProject
397397
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Toolset.Package", "src\NuGet\Microsoft.Net.Compilers.Toolset\Microsoft.Net.Compilers.Toolset.Package.csproj", "{A74C7D2E-92FA-490A-B80A-28BEF56B56FC}"
398398
EndProject
399+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.LanguageServer.Protocol", "src\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj", "{686BF57E-A6FF-467B-AAB3-44DE916A9772}"
400+
EndProject
401+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests", "src\Features\LanguageServer\ProtocolUnitTests\Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests.csproj", "{1DDE89EE-5819-441F-A060-2FF4A986F372}"
402+
EndProject
399403
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Debugger", "src\Tools\ExternalAccess\Debugger\Microsoft.CodeAnalysis.ExternalAccess.Debugger.csproj", "{655A5B07-39B8-48CD-8590-8AC0C2B708D8}"
400404
EndProject
401405
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.UnitTesting", "src\Tools\ExternalAccess\UnitTesting\Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.csproj", "{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}"
@@ -1067,6 +1071,14 @@ Global
10671071
{A74C7D2E-92FA-490A-B80A-28BEF56B56FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
10681072
{A74C7D2E-92FA-490A-B80A-28BEF56B56FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
10691073
{A74C7D2E-92FA-490A-B80A-28BEF56B56FC}.Release|Any CPU.Build.0 = Release|Any CPU
1074+
{686BF57E-A6FF-467B-AAB3-44DE916A9772}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1075+
{686BF57E-A6FF-467B-AAB3-44DE916A9772}.Debug|Any CPU.Build.0 = Debug|Any CPU
1076+
{686BF57E-A6FF-467B-AAB3-44DE916A9772}.Release|Any CPU.ActiveCfg = Release|Any CPU
1077+
{686BF57E-A6FF-467B-AAB3-44DE916A9772}.Release|Any CPU.Build.0 = Release|Any CPU
1078+
{1DDE89EE-5819-441F-A060-2FF4A986F372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1079+
{1DDE89EE-5819-441F-A060-2FF4A986F372}.Debug|Any CPU.Build.0 = Debug|Any CPU
1080+
{1DDE89EE-5819-441F-A060-2FF4A986F372}.Release|Any CPU.ActiveCfg = Release|Any CPU
1081+
{1DDE89EE-5819-441F-A060-2FF4A986F372}.Release|Any CPU.Build.0 = Release|Any CPU
10701082
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
10711083
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
10721084
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1296,6 +1308,8 @@ Global
12961308
{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC} = {8977A560-45C2-4EC2-A849-97335B382C74}
12971309
{1638FB04-0298-4341-B5E0-8A13B4823C81} = {8977A560-45C2-4EC2-A849-97335B382C74}
12981310
{A74C7D2E-92FA-490A-B80A-28BEF56B56FC} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
1311+
{686BF57E-A6FF-467B-AAB3-44DE916A9772} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
1312+
{1DDE89EE-5819-441F-A060-2FF4A986F372} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
12991313
{655A5B07-39B8-48CD-8590-8AC0C2B708D8} = {8977A560-45C2-4EC2-A849-97335B382C74}
13001314
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3} = {8977A560-45C2-4EC2-A849-97335B382C74}
13011315
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF} = {8977A560-45C2-4EC2-A849-97335B382C74}

eng/Versions.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
33
<Project>
44
<!--
@@ -111,6 +111,8 @@
111111
<MicrosoftVisualStudioLanguageIntellisenseVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioLanguageIntellisenseVersion>
112112
<MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>16.0.467</MicrosoftVisualStudioLanguageNavigateToInterfacesVersion>
113113
<MicrosoftVisualStudioLanguageStandardClassificationVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioLanguageStandardClassificationVersion>
114+
<MicrosoftVisualStudioLanguageServerProtocolVersion>16.2.1078</MicrosoftVisualStudioLanguageServerProtocolVersion>
115+
<MicrosoftVisualStudioLanguageServerProtocolExtensionsVersion>16.2.1078</MicrosoftVisualStudioLanguageServerProtocolExtensionsVersion>
114116
<MicrosoftVisualStudioOLEInteropVersion>7.10.6071</MicrosoftVisualStudioOLEInteropVersion>
115117
<MicrosoftVisualStudioPlatformVSEditorVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioPlatformVSEditorVersion>
116118
<MicrosoftVisualStudioProgressionCodeSchemaVersion>15.8.27812-alpha</MicrosoftVisualStudioProgressionCodeSchemaVersion>
@@ -309,6 +311,7 @@
309311
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
310312
https://dotnet.myget.org/F/dotnet-corefxtestdata/api/v3/index.json;
311313
https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json;
314+
https://dotnet.myget.org/F/experimental-vs-packages/api/v3/index.json;
312315
https://dotnet.myget.org/F/symreader/api/v3/index.json;
313316
https://dotnet.myget.org/F/symreader-portable/api/v3/index.json;
314317
https://dotnet.myget.org/F/symreader-converter/api/v3/index.json;

src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<ProjectReference Include="..\..\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj" />
1414
<ProjectReference Include="..\..\Compilers\Test\Utilities\CSharp\Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj" />
1515
<ProjectReference Include="..\..\EditorFeatures\CSharp.Wpf\Microsoft.CodeAnalysis.CSharp.EditorFeatures.Wpf.csproj" />
16+
<ProjectReference Include="..\..\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" />
1617
<ProjectReference Include="..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
1718
<ProjectReference Include="..\..\Test\Utilities\Portable\Roslyn.Test.Utilities.csproj" />
1819
<ProjectReference Include="..\..\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />

src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<ProjectReference Include="..\..\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj" />
1313
<ProjectReference Include="..\..\Compilers\Test\Utilities\CSharp\Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj" />
1414
<ProjectReference Include="..\..\EditorFeatures\CSharp.Wpf\Microsoft.CodeAnalysis.CSharp.EditorFeatures.Wpf.csproj" />
15+
<ProjectReference Include="..\..\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" />
1516
<ProjectReference Include="..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
1617
<ProjectReference Include="..\..\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />
1718
<ProjectReference Include="..\..\Features\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.Features.csproj" />

src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<ItemGroup>
4040
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.EditorFeatures" />
4141
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.EditorFeatures.Wpf" />
42+
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" />
43+
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests" />
4244
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.Debugger" />
4345
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.EditorFeatures" />
4446
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices" />

src/EditorFeatures/Test/Microsoft.CodeAnalysis.EditorFeatures.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<ProjectReference Include="..\..\Compilers\Test\Utilities\CSharp\Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj" />
1414
<ProjectReference Include="..\..\EditorFeatures\CSharp.Wpf\Microsoft.CodeAnalysis.CSharp.EditorFeatures.Wpf.csproj" />
1515
<ProjectReference Include="..\..\Compilers\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.vbproj" />
16+
<ProjectReference Include="..\..\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" />
1617
<ProjectReference Include="..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" />
1718
<ProjectReference Include="..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
1819
<ProjectReference Include="..\..\Test\Utilities\Portable\Roslyn.Test.Utilities.csproj" />

src/EditorFeatures/Test2/Microsoft.CodeAnalysis.EditorFeatures2.UnitTests.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
1212
<ProjectReference Include="..\..\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj" />
1313
<ProjectReference Include="..\..\Compilers\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.vbproj" />
14+
<ProjectReference Include="..\..\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" />
1415
<ProjectReference Include="..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" />
1516
<ProjectReference Include="..\..\Test\Utilities\Portable\Roslyn.Test.Utilities.csproj" />
1617
<ProjectReference Include="..\..\VisualStudio\VisualBasic\Impl\Microsoft.VisualStudio.LanguageServices.VisualBasic.vbproj" />
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2+
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Collections.Immutable;
6+
using System.Linq;
7+
using System.Text.RegularExpressions;
8+
using Microsoft.CodeAnalysis;
9+
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
10+
using Microsoft.CodeAnalysis.Editor.UnitTests;
11+
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
12+
using Microsoft.CodeAnalysis.LanguageServer;
13+
using Microsoft.CodeAnalysis.LanguageServer.CustomProtocol;
14+
using Microsoft.CodeAnalysis.LanguageServer.Handler;
15+
using Microsoft.CodeAnalysis.Test.Utilities;
16+
using Microsoft.CodeAnalysis.Text;
17+
using Microsoft.VisualStudio.Composition;
18+
using Microsoft.VisualStudio.Text.Adornments;
19+
using Newtonsoft.Json;
20+
using Roslyn.Utilities;
21+
using Xunit;
22+
using LSP = Microsoft.VisualStudio.LanguageServer.Protocol;
23+
24+
namespace Roslyn.Test.Utilities
25+
{
26+
[UseExportProvider]
27+
public abstract class AbstractLanguageServerProtocolTests
28+
{
29+
protected virtual ExportProvider GetExportProvider()
30+
{
31+
var requestHelperTypes = DesktopTestHelpers.GetAllTypesImplementingGivenInterface(
32+
typeof(IRequestHandler).Assembly, typeof(IRequestHandler));
33+
var exportProviderFactory = ExportProviderCache.GetOrCreateExportProviderFactory(
34+
TestExportProvider.EntireAssemblyCatalogWithCSharpAndVisualBasic
35+
.WithPart(typeof(LanguageServerProtocol))
36+
.WithParts(requestHelperTypes));
37+
return exportProviderFactory.CreateExportProvider();
38+
}
39+
40+
/// <summary>
41+
/// Asserts two objects are equivalent by converting to JSON and ignoring whitespace.
42+
/// </summary>
43+
/// <typeparam name="T">the JSON object type.</typeparam>
44+
/// <param name="expected">the expected object to be converted to JSON.</param>
45+
/// <param name="actual">the actual object to be converted to JSON.</param>
46+
protected static void AssertJsonEquals<T>(T expected, T actual)
47+
{
48+
var expectedStr = JsonConvert.SerializeObject(expected);
49+
var actualStr = JsonConvert.SerializeObject(actual);
50+
AssertEqualIgnoringWhitespace(expectedStr, actualStr);
51+
}
52+
53+
protected static void AssertEqualIgnoringWhitespace(string expected, string actual)
54+
{
55+
var expectedWithoutWhitespace = Regex.Replace(expected, @"\s+", string.Empty);
56+
var actualWithoutWhitespace = Regex.Replace(actual, @"\s+", string.Empty);
57+
Assert.Equal(expectedWithoutWhitespace, actualWithoutWhitespace);
58+
}
59+
60+
/// <summary>
61+
/// Assert that two location lists are equivalent.
62+
/// Locations are not always returned in a consistent order so they must be sorted.
63+
/// </summary>
64+
protected static void AssertLocationsEqual(IEnumerable<LSP.Location> expectedLocations, IEnumerable<LSP.Location> actualLocations)
65+
{
66+
var orderedActualLocations = actualLocations.OrderBy(CompareLocations);
67+
var orderedExpectedLocations = expectedLocations.OrderBy(CompareLocations);
68+
69+
AssertJsonEquals(orderedExpectedLocations, orderedActualLocations);
70+
71+
static int CompareLocations(LSP.Location l1, LSP.Location l2)
72+
{
73+
var compareDocument = l1.Uri.OriginalString.CompareTo(l2.Uri.OriginalString);
74+
var compareRange = CompareRange(l1.Range, l2.Range);
75+
return compareDocument != 0 ? compareDocument : compareRange;
76+
}
77+
}
78+
79+
protected static int CompareRange(LSP.Range r1, LSP.Range r2)
80+
{
81+
var compareLine = r1.Start.Line.CompareTo(r2.Start.Line);
82+
var compareChar = r1.Start.Character.CompareTo(r2.Start.Character);
83+
return compareLine != 0 ? compareLine : compareChar;
84+
}
85+
86+
protected static string ApplyTextEdits(LSP.TextEdit[] edits, SourceText originalMarkup)
87+
{
88+
var text = originalMarkup;
89+
foreach (var edit in edits)
90+
{
91+
var lines = text.Lines;
92+
var startPosition = ProtocolConversions.PositionToLinePosition(edit.Range.Start);
93+
var endPosition = ProtocolConversions.PositionToLinePosition(edit.Range.End);
94+
var textSpan = lines.GetTextSpan(new LinePositionSpan(startPosition, endPosition));
95+
text = text.Replace(textSpan, edit.NewText);
96+
}
97+
98+
return text.ToString();
99+
}
100+
101+
protected static LSP.SymbolInformation CreateSymbolInformation(LSP.SymbolKind kind, string name, LSP.Location location, string containerName = null)
102+
=> new LSP.SymbolInformation()
103+
{
104+
Kind = kind,
105+
Name = name,
106+
Location = location,
107+
ContainerName = containerName
108+
};
109+
110+
protected static LSP.TextDocumentIdentifier CreateTextDocumentIdentifier(Uri uri)
111+
=> new LSP.TextDocumentIdentifier()
112+
{
113+
Uri = uri
114+
};
115+
116+
protected static LSP.TextDocumentPositionParams CreateTextDocumentPositionParams(LSP.Location caret)
117+
=> new LSP.TextDocumentPositionParams()
118+
{
119+
TextDocument = CreateTextDocumentIdentifier(caret.Uri),
120+
Position = caret.Range.Start
121+
};
122+
123+
protected static LSP.MarkupContent CreateMarkupContent(LSP.MarkupKind kind, string value)
124+
=> new LSP.MarkupContent()
125+
{
126+
Kind = kind,
127+
Value = value
128+
};
129+
130+
protected static LSP.CompletionParams CreateCompletionParams(LSP.Location caret)
131+
=> new LSP.CompletionParams()
132+
{
133+
TextDocument = CreateTextDocumentIdentifier(caret.Uri),
134+
Position = caret.Range.Start,
135+
Context = new LSP.CompletionContext()
136+
{
137+
// TODO - completion should respect context.
138+
}
139+
};
140+
141+
protected static LSP.VSCompletionItem CreateCompletionItem(string text, LSP.CompletionItemKind kind, string[] tags, LSP.CompletionParams requestParameters)
142+
=> new LSP.VSCompletionItem()
143+
{
144+
FilterText = text,
145+
InsertText = text,
146+
Label = text,
147+
SortText = text,
148+
InsertTextFormat = LSP.InsertTextFormat.Plaintext,
149+
Kind = kind,
150+
Data = new CompletionResolveData()
151+
{
152+
DisplayText = text,
153+
CompletionParams = requestParameters
154+
},
155+
Icon = tags != null ? new ImageElement(tags.ToImmutableArray().GetFirstGlyph().GetImageId()) : null
156+
};
157+
158+
private protected static RunCodeActionParams CreateRunCodeActionParams(string codeActionTitle, LSP.Location location)
159+
=> new RunCodeActionParams()
160+
{
161+
CodeActionParams = new LSP.CodeActionParams()
162+
{
163+
TextDocument = CreateTextDocumentIdentifier(location.Uri),
164+
Range = location.Range,
165+
Context = new LSP.CodeActionContext()
166+
},
167+
Title = codeActionTitle
168+
};
169+
170+
/// <summary>
171+
/// Creates a solution with a document.
172+
/// </summary>
173+
/// <returns>the solution and the annotated ranges in the document.</returns>
174+
protected (Solution solution, Dictionary<string, IList<LSP.Location>> locations) CreateTestSolution(string markup)
175+
=> CreateTestSolution(new string[] { markup });
176+
177+
/// <summary>
178+
/// Create a solution with multiple documents.
179+
/// </summary>
180+
/// <returns>
181+
/// the solution with the documents plus a list for each document of all annotated ranges in the document.
182+
/// </returns>
183+
protected (Solution solution, Dictionary<string, IList<LSP.Location>> locations) CreateTestSolution(string[] markups)
184+
{
185+
using var workspace = TestWorkspace.CreateCSharp(markups, exportProvider: GetExportProvider());
186+
var solution = workspace.CurrentSolution;
187+
var locations = new Dictionary<string, IList<LSP.Location>>();
188+
189+
foreach (var document in workspace.Documents)
190+
{
191+
var text = document.TextBuffer.AsTextContainer().CurrentText;
192+
foreach (var kvp in document.AnnotatedSpans)
193+
{
194+
locations.GetOrAdd(kvp.Key, CreateLocation)
195+
.AddRange(kvp.Value.Select(s => ProtocolConversions.TextSpanToLocation(s, text, new Uri(GetDocumentFilePathFromName(document.Name)))));
196+
}
197+
198+
// Pass in the text without markup.
199+
workspace.ChangeSolution(ChangeDocumentFilePathToValidURI(workspace.CurrentSolution, document, text));
200+
}
201+
202+
return (workspace.CurrentSolution, locations);
203+
204+
// local functions
205+
static List<LSP.Location> CreateLocation(string s) => new List<LSP.Location>();
206+
}
207+
208+
// Private protected because LanguageServerProtocol is internal
209+
private protected static LanguageServerProtocol GetLanguageServer(Solution solution)
210+
{
211+
var workspace = (TestWorkspace)solution.Workspace;
212+
return workspace.ExportProvider.GetExportedValue<LanguageServerProtocol>();
213+
}
214+
215+
private static string GetDocumentFilePathFromName(string documentName)
216+
=> "C:\\" + documentName;
217+
218+
/// <summary>
219+
/// Changes the document file path.
220+
/// Adds/Removes the document instead of updating file path due to
221+
/// https://github.com/dotnet/roslyn/issues/34837
222+
/// </summary>
223+
private static Solution ChangeDocumentFilePathToValidURI(Solution originalSolution, TestHostDocument originalDocument, SourceText text)
224+
{
225+
var documentName = originalDocument.Name;
226+
var documentPath = GetDocumentFilePathFromName(documentName);
227+
228+
var solution = originalSolution.RemoveDocument(originalDocument.Id);
229+
230+
var newDocumentId = DocumentId.CreateNewId(originalDocument.Project.Id);
231+
return solution.AddDocument(newDocumentId, documentName, text, filePath: documentPath);
232+
}
233+
}
234+
}

0 commit comments

Comments
 (0)