-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove workspace option #72490
Merged
Merged
Remove workspace option #72490
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -402,42 +402,15 @@ void DoPermute(int start, int end) | |
} | ||
|
||
private static async Task TestInProcAndRemoteWorkspace( | ||
bool syncWithRemoteServer, params ImmutableArray<(string hintName, SourceText text)>[] values) | ||
params ImmutableArray<(string hintName, SourceText text)>[] values) | ||
{ | ||
// Try every permutation of these values. | ||
foreach (var permutation in Permute(values)) | ||
{ | ||
var gotException = false; | ||
try | ||
{ | ||
await TestInProcAndRemoteWorkspaceWorker(syncWithRemoteServer, permutation); | ||
} | ||
catch (XunitException) | ||
{ | ||
gotException = true; | ||
} | ||
|
||
// If we're syncing to the remove server, we should get no exceptions, since the data should be matched | ||
// between both. If we're not syncing, we should see a failure since the two processes will disagree on | ||
// the contents. | ||
Assert.Equal(syncWithRemoteServer, !gotException); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we had tests actually vvalidating that without this option that our host/oop get out of sync. since hte option is gone and both most be in sync, all the tests validate that. |
||
|
||
[ExportWorkspaceService(typeof(IWorkspaceConfigurationService), ServiceLayer.Test), SharedAttribute, PartNotDiscoverable] | ||
private sealed class NoSyncWorkspaceConfigurationService : IWorkspaceConfigurationService | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public NoSyncWorkspaceConfigurationService() | ||
{ | ||
} | ||
|
||
public WorkspaceConfigurationOptions Options => WorkspaceConfigurationOptions.Default with { RunSourceGeneratorsInSameProcessOnly = true }; | ||
await TestInProcAndRemoteWorkspaceWorker(permutation); | ||
} | ||
|
||
private static async Task TestInProcAndRemoteWorkspaceWorker( | ||
bool syncWithRemoteServer, ImmutableArray<ImmutableArray<(string hintName, SourceText text)>> values) | ||
ImmutableArray<ImmutableArray<(string hintName, SourceText text)>> values) | ||
{ | ||
var throwIfCalled = false; | ||
ImmutableArray<(string hintName, SourceText text)> sourceTexts = default; | ||
|
@@ -450,7 +423,7 @@ private static async Task TestInProcAndRemoteWorkspaceWorker( | |
return sourceTexts; | ||
}); | ||
|
||
using var localWorkspace = CreateWorkspace(syncWithRemoteServer ? [] : [typeof(NoSyncWorkspaceConfigurationService)]); | ||
using var localWorkspace = CreateWorkspace(); | ||
|
||
DocumentId tempDocId; | ||
|
||
|
@@ -541,204 +514,183 @@ private static SourceText CreateStreamText(string content, bool useBOM, bool use | |
} | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree1(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree1() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString())))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree2(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree2() | ||
{ | ||
var sourceText = CreateText(Guid.NewGuid().ToString()); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", sourceText)), | ||
ImmutableArray.Create(("SG.cs", sourceText))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree3(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree3() | ||
{ | ||
var sourceText = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(sourceText))), | ||
ImmutableArray.Create(("SG.cs", CreateText(sourceText)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree4(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree4() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString()))), | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString())))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree5(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree5() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString()))), | ||
ImmutableArray.Create(("NewName.cs", CreateText(Guid.NewGuid().ToString())))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree6(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree6() | ||
{ | ||
var sourceText = CreateText(Guid.NewGuid().ToString()); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", sourceText)), | ||
ImmutableArray.Create(("NewName.cs", sourceText))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree7(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree7() | ||
{ | ||
var sourceText = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(sourceText))), | ||
ImmutableArray.Create(("NewName.cs", CreateText(sourceText)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree8(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree8() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString()))), | ||
ImmutableArray.Create(("NewName.cs", CreateText(Guid.NewGuid().ToString())))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree9(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree9() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText("X", Encoding.ASCII))), | ||
ImmutableArray.Create(("SG.cs", CreateText("X", Encoding.UTF8)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree10(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree10() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText("X", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha1))), | ||
ImmutableArray.Create(("SG.cs", CreateText("X", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha256)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree11(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree11() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString()))), | ||
ImmutableArray<(string, SourceText)>.Empty); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree12(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree12() | ||
{ | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray<(string, SourceText)>.Empty, | ||
ImmutableArray.Create(("SG.cs", CreateText(Guid.NewGuid().ToString())))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree13(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree13() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG.cs", CreateText(contents)), ("SG1.cs", CreateText(contents)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree14(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree14() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG.cs", CreateText(contents)), ("SG1.cs", CreateText("Other")))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree15(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree15() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG1.cs", CreateText(contents)), ("SG.cs", CreateText("Other")))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree16(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree16() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG1.cs", CreateText("Other")), ("SG.cs", CreateText(contents)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree17(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree17() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG1.cs", CreateText("Other")), ("SG.cs", CreateText(contents))), | ||
ImmutableArray<(string, SourceText)>.Empty); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree18(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree18() | ||
{ | ||
var contents = CreateText(Guid.NewGuid().ToString()); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG1.cs", contents), ("SG2.cs", contents))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree19(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree19() | ||
{ | ||
var contents = CreateText(Guid.NewGuid().ToString()); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG1.cs", contents), ("SG2.cs", contents)), | ||
ImmutableArray.Create(("SG2.cs", contents), ("SG1.cs", contents))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree20(bool syncWithRemoteServer) | ||
[Fact] | ||
public async Task InProcAndRemoteWorkspaceAgree20() | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG1.cs", CreateText(contents)), ("SG2.cs", CreateText(contents))), | ||
ImmutableArray.Create(("SG2.cs", CreateText(contents)), ("SG1.cs", CreateText(contents)))); | ||
} | ||
|
||
[Theory, CombinatorialData] | ||
public async Task InProcAndRemoteWorkspaceAgree21( | ||
bool syncWithRemoteServer, bool useBOM1, bool useMemoryStream1, bool useBOM2, bool useMemoryStream2) | ||
bool useBOM1, bool useMemoryStream1, bool useBOM2, bool useMemoryStream2) | ||
{ | ||
var contents = Guid.NewGuid().ToString(); | ||
await TestInProcAndRemoteWorkspace( | ||
syncWithRemoteServer, | ||
ImmutableArray.Create(("SG.cs", CreateStreamText(contents, useBOM: useBOM1, useMemoryStream: useMemoryStream1))), | ||
ImmutableArray.Create(("SG.cs", CreateStreamText(contents, useBOM: useBOM2, useMemoryStream: useMemoryStream2)))); | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view with whitespace off.