From 007bed73a02c42881ef1c64a11b77445c25194b9 Mon Sep 17 00:00:00 2001 From: tmat Date: Fri, 11 Jul 2025 11:23:58 -0700 Subject: [PATCH 1/4] Remove unused properties --- .../ProjectSystemProjectCreationInfo.cs | 2 -- .../ProjectSystem/ProjectSystemProjectFactory.cs | 13 ++++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs index 00c5114d897f1..b1465d59f3e6a 100644 --- a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs +++ b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs @@ -9,9 +9,7 @@ namespace Microsoft.CodeAnalysis.Workspaces.ProjectSystem; internal class ProjectSystemProjectCreationInfo { public string? AssemblyName { get; set; } - public CompilationOptions? CompilationOptions { get; set; } public string? FilePath { get; set; } - public ParseOptions? ParseOptions { get; set; } public string? CompilationOutputAssemblyFilePath { get; set; } public Guid TelemetryId { get; set; } diff --git a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs index 12c3ab9fa3039..b277cfe33c474 100644 --- a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs +++ b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs @@ -110,9 +110,9 @@ public async Task CreateAndAddToWorkspaceAsync(string proj displayName: projectSystemName, language, assemblyName, - creationInfo.CompilationOptions, + compilationOptions: null, creationInfo.FilePath, - creationInfo.ParseOptions); + parseOptions: null); var versionStamp = creationInfo.FilePath != null ? VersionStamp.Create(File.GetLastWriteTimeUtc(creationInfo.FilePath)) @@ -126,14 +126,14 @@ public async Task CreateAndAddToWorkspaceAsync(string proj assemblyName, language, // generatedFilesOutputDirectory to be updated when initializing project from command line: - compilationOutputInfo: new(creationInfo.CompilationOutputAssemblyFilePath, generatedFilesOutputDirectory: null), + compilationOutputInfo: new(assemblyPath: null, generatedFilesOutputDirectory: null), SourceHashAlgorithms.Default, // will be updated when command line is set - outputFilePath: creationInfo.CompilationOutputAssemblyFilePath, + outputFilePath: null, filePath: creationInfo.FilePath, telemetryId: creationInfo.TelemetryId, hasSdkCodeStyleAnalyzers: project.HasSdkCodeStyleAnalyzers), - compilationOptions: creationInfo.CompilationOptions, - parseOptions: creationInfo.ParseOptions); + compilationOptions: null, + parseOptions: null); await ApplyChangeToWorkspaceAsync(w => { @@ -183,7 +183,6 @@ await ApplyChangeToWorkspaceAsync(w => // potentially block up thread pool threads. Doing this in a batch means the global lock will be acquired asynchronously. var disposableBatchScope = await project.CreateBatchScopeAsync(CancellationToken.None).ConfigureAwait(false); await using var _ = disposableBatchScope.ConfigureAwait(false); - project.CompilationOutputAssemblyFilePath = creationInfo.CompilationOutputAssemblyFilePath; return project; } From defaabdefdcc80de74b1b85ca813f7be156134ad Mon Sep 17 00:00:00 2001 From: tmat Date: Fri, 11 Jul 2025 11:38:22 -0700 Subject: [PATCH 2/4] Remove unused --- .../Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs | 2 -- .../Workspace/ProjectSystem/ProjectSystemProjectFactory.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs index b1465d59f3e6a..e429ac11216f2 100644 --- a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs +++ b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs @@ -11,6 +11,4 @@ internal class ProjectSystemProjectCreationInfo public string? AssemblyName { get; set; } public string? FilePath { get; set; } public string? CompilationOutputAssemblyFilePath { get; set; } - - public Guid TelemetryId { get; set; } } diff --git a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs index b277cfe33c474..e54efdc2035cd 100644 --- a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs +++ b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectFactory.cs @@ -130,7 +130,7 @@ public async Task CreateAndAddToWorkspaceAsync(string proj SourceHashAlgorithms.Default, // will be updated when command line is set outputFilePath: null, filePath: creationInfo.FilePath, - telemetryId: creationInfo.TelemetryId, + telemetryId: default, hasSdkCodeStyleAnalyzers: project.HasSdkCodeStyleAnalyzers), compilationOptions: null, parseOptions: null); From 9161ee920c2b3309da6adf253c204105a7f6ec87 Mon Sep 17 00:00:00 2001 From: tmat Date: Fri, 11 Jul 2025 12:28:32 -0700 Subject: [PATCH 3/4] init --- .../Def/ProjectSystem/VisualStudioProjectCreationInfo.cs | 4 ++-- .../ProjectSystem/ProjectSystemProjectCreationInfo.cs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectCreationInfo.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectCreationInfo.cs index 1269df8852ad5..03f4bf8165f74 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectCreationInfo.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectCreationInfo.cs @@ -10,6 +10,6 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem; internal sealed class VisualStudioProjectCreationInfo : ProjectSystemProjectCreationInfo { - public IVsHierarchy? Hierarchy { get; set; } - public Guid ProjectGuid { get; set; } + public IVsHierarchy? Hierarchy { get; init; } + public Guid ProjectGuid { get; init; } } diff --git a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs index e429ac11216f2..31c23ba8bcebe 100644 --- a/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs +++ b/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProjectCreationInfo.cs @@ -2,13 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - namespace Microsoft.CodeAnalysis.Workspaces.ProjectSystem; internal class ProjectSystemProjectCreationInfo { - public string? AssemblyName { get; set; } - public string? FilePath { get; set; } - public string? CompilationOutputAssemblyFilePath { get; set; } + public string? AssemblyName { get; init; } + public string? FilePath { get; init; } + public string? CompilationOutputAssemblyFilePath { get; init; } } From 50de89cd23ebf50b6de245ef9596b9dbed3ad2e3 Mon Sep 17 00:00:00 2001 From: tmat Date: Fri, 11 Jul 2025 12:28:52 -0700 Subject: [PATCH 4/4] Remove test-only code --- .../VisualStudioProjectFactory.cs | 3 -- .../AnalyzerReferenceTests.vb | 17 ++++--- .../DynamicFileTests.vb | 11 ++-- .../FileChangeTests.vb | 16 +++--- ...tadataToProjectReferenceConversionTests.vb | 51 ++++++++++--------- .../PrimaryProjectTests.vb | 7 +-- .../ProjectSystemProjectFactoryTests.vb | 5 +- .../SolutionIdTests.vb | 9 ++-- .../SourceTextContainerTests.vb | 3 +- .../WorkspaceChangedEventTests.vb | 15 +++--- 10 files changed, 70 insertions(+), 67 deletions(-) diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs index 3d0ee67a4ede3..9f511de2409d6 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs @@ -72,9 +72,6 @@ public VisualStudioProjectFactory( }); } - public Task CreateAndAddToWorkspaceAsync(string projectSystemName, string language, CancellationToken cancellationToken) - => CreateAndAddToWorkspaceAsync(projectSystemName, language, new VisualStudioProjectCreationInfo(), cancellationToken); - public async Task CreateAndAddToWorkspaceAsync( string projectSystemName, string language, VisualStudioProjectCreationInfo creationInfo, CancellationToken cancellationToken) { diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/AnalyzerReferenceTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/AnalyzerReferenceTests.vb index b0ea2391243a4..a040b7986518a 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/AnalyzerReferenceTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/AnalyzerReferenceTests.vb @@ -10,6 +10,7 @@ Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Workspaces.AnalyzerRedirecting Imports Microsoft.VisualStudio.LanguageServices.Implementation.Diagnostics +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -21,7 +22,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function RemoveAndReAddInSameBatchWorksCorrectly() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const analyzerPath = "Z:\TestAnalyzer.dll" project.AddAnalyzerReference(analyzerPath) @@ -43,7 +44,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function LoadDiagnosticsRemovedOnAnalyzerReferenceRemoval(removeInBatch As Boolean) As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim analyzerPath = "Z:\TestAnalyzer" + Guid.NewGuid().ToString() + ".dll" project.AddAnalyzerReference(analyzerPath) @@ -63,7 +64,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function LoadDiagnosticsRemovedOnProjectRemoval(removeInBatch As Boolean) As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim analyzerPath = "Z:\TestAnalyzer" + Guid.NewGuid().ToString() + ".dll" project.AddAnalyzerReference(analyzerPath) @@ -82,7 +83,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function LoadDiagnosticsStayIfRemoveAndAddInBatch() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim analyzerPath = "Z:\TestAnalyzer" + Guid.NewGuid().ToString() + ".dll" project.AddAnalyzerReference(analyzerPath) @@ -112,7 +113,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim } Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' add Razor source generator and a couple more other analyzer files: Dim path1 = Path.Combine(TempRoot.Root, "Sdks", "Microsoft.NET.Sdk.Razor", "source-generators", "Microsoft.NET.Sdk.Razor.SourceGenerators.dll") @@ -128,7 +129,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function CodeStyleAnalyzers_CSharp_FromSdk_AreIgnored() As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' Ensure HasSdkCodeStyleAnalyzers is proper. Assert.False(project.HasSdkCodeStyleAnalyzers) @@ -169,7 +170,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function CodeStyleAnalyzers_VisualBasic_FromSdk_AreIgnored() As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.VisualBasic, CancellationToken.None) + "Project", LanguageNames.VisualBasic, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' Ensure HasSdkCodeStyleAnalyzers is proper. Assert.False(project.HasSdkCodeStyleAnalyzers) @@ -209,7 +210,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function RedirectedAnalyzers_CSharp() As Task Using environment = New TestEnvironment(GetType(Redirector)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' Add analyzers project.AddAnalyzerReference(Path.Combine(TempRoot.Root, "Sdks", "Microsoft.NET.Sdk", "analyzers", "Microsoft.CodeAnalysis.NetAnalyzers.dll")) diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/DynamicFileTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/DynamicFileTests.vb index 63058e3504f93..b9543592e6773 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/DynamicFileTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/DynamicFileTests.vb @@ -6,6 +6,7 @@ Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -16,7 +17,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddAndRemoveFileWhenDynamicFileInfoProviderProducesNothing() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const DynamicFileName As String = "DynamicFile.cshtml" @@ -30,7 +31,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddAndRemoveFileWhenDynamicFileInfoProviderProducesSomething() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const DynamicFileName As String = "DynamicFile.cshtml" @@ -52,7 +53,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function DynamicFileNamesAreCaseInsensitive() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project.AddDynamicSourceFile("DynamicFile.cshtml", ImmutableArray(Of String).Empty) @@ -64,7 +65,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddAndRemoveFileAndAddAgain() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const DynamicFileName As String = "DynamicFile.cshtml" @@ -80,7 +81,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddAndRemoveExtensionlessFile() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const DynamicFileName As String = "DynamicFile" diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/FileChangeTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/FileChangeTests.vb index f51fd89f10137..3cc9cee029122 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/FileChangeTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/FileChangeTests.vb @@ -16,13 +16,12 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function FileChangeAfterRemovalInUncommittedBatchIgnored(withDirectoryWatch As Boolean) As Task Using environment = New TestEnvironment() - Dim projectInfo = New VisualStudioProjectCreationInfo - ' If we have a project directory, then we'll also have a watch for the entire directory; ' test both cases - If withDirectoryWatch Then - projectInfo.FilePath = "Z:\Project.csproj" - End If + + Dim projectInfo = New VisualStudioProjectCreationInfo With { + .FilePath = If(withDirectoryWatch, "Z:\Project.csproj", Nothing) + } Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( "project", LanguageNames.CSharp, projectInfo, CancellationToken.None) @@ -40,13 +39,12 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function FileChangeAfterRemoveOfProjectIgnored(withDirectoryWatch As Boolean) As Task Using environment = New TestEnvironment() - Dim projectInfo = New VisualStudioProjectCreationInfo ' If we have a project directory, then we'll also have a watch for the entire directory; ' test both cases - If withDirectoryWatch Then - projectInfo.FilePath = "Z:\Project.csproj" - End If + Dim projectInfo = New VisualStudioProjectCreationInfo With { + .FilePath = If(withDirectoryWatch, "Z:\Project.csproj", Nothing) + } Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( "project", LanguageNames.CSharp, projectInfo, CancellationToken.None) diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/MetadataToProjectReferenceConversionTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/MetadataToProjectReferenceConversionTests.vb index 6200fa2f74160..ff00611c84784 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/MetadataToProjectReferenceConversionTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/MetadataToProjectReferenceConversionTests.vb @@ -6,6 +6,7 @@ Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -18,10 +19,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ProjectReferenceConvertedToMetadataReferenceCanBeRemoved(convertReferenceBackFirst As Boolean, removeInBatch As Boolean) As Task Using environment = New TestEnvironment() Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project1", LanguageNames.CSharp, CancellationToken.None) + "project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project2", LanguageNames.CSharp, CancellationToken.None) + "project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project1.dll" project1.OutputFilePath = ReferencePath @@ -53,10 +54,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ProjectReferenceConvertedToMetadataReferenceCaseInsensitiveCanBeRemoved(convertReferenceBackFirst As Boolean, removeInBatch As Boolean) As Task Using environment = New TestEnvironment() Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project1", LanguageNames.CSharp, CancellationToken.None) + "project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project2", LanguageNames.CSharp, CancellationToken.None) + "project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project1.dll" Const ReferencePathUppercase = "C:\PROJECT1.dll" @@ -89,10 +90,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function TwoProjectsProducingSameOutputPathBehavesCorrectly() As Task Using environment = New TestEnvironment() Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "referencingProject", LanguageNames.CSharp, CancellationToken.None) + "referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project1", LanguageNames.CSharp, CancellationToken.None) + "project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' First: have a single project producing this DLL, and ensure we wired up correctly Const ReferencePath = "C:\project1.dll" @@ -107,7 +108,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim ' Create a second project referencing this same DLL. By rule, we now don't know which project to reference, so we just convert back to ' a file reference because something is screwed up. Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project2", LanguageNames.CSharp, CancellationToken.None) + "project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project2.OutputFilePath = ReferencePath Assert.Empty(getReferencingProject().ProjectReferences) @@ -125,10 +126,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function TwoProjectsProducingSameOutputPathAndIntermediateOutputBehavesCorrectly() As Task Using environment = New TestEnvironment() Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "referencingProject", LanguageNames.CSharp, CancellationToken.None) + "referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project1", LanguageNames.CSharp, CancellationToken.None) + "project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' First: have a single project producing this DLL, and ensure we wired up correctly Const ReferencePath = "C:\project1.dll" @@ -143,7 +144,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim ' Create a second project referencing this same DLL. We'll make this one even more complicated by using the same path for both the ' regular OutputFilePath and the IntermediateOutputFilePath Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project2", LanguageNames.CSharp, CancellationToken.None) + "project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project2.CompilationOutputAssemblyFilePath = ReferencePath project2.OutputFilePath = ReferencePath @@ -166,8 +167,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ProjectBeingAddedWhileOutputPathBeingUpdatedDoesNotRace( iteration As Integer) As Task #Enable Warning IDE0060 ' Remove unused parameter Using environment = New TestEnvironment() - Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, CancellationToken.None) - Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, CancellationToken.None) + Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' First: have a single project producing this DLL, and ensure we wired up correctly Const ReferencePath = "C:\project.dll" @@ -193,8 +194,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingAndRemovingTwoReferencesWithDifferentPropertiesConvertsCorrectly() As Task Using environment = New TestEnvironment() - Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, CancellationToken.None) - Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, CancellationToken.None) + Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project.dll" referencingProject.AddMetadataReference(ReferencePath, New MetadataReferenceProperties(aliases:=ImmutableArray.Create("alias1"))) @@ -224,8 +225,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function MetadataReferenceBeingAddedWhileOutputPathUpdateInInterleavedBatches(closeReferencedProjectBatchFirst As Boolean) As Task Using environment = New TestEnvironment() - Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, CancellationToken.None) - Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, CancellationToken.None) + Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim referencingProjectBatch = referencingProject.CreateBatchScope() Dim referencedProjectBatch = referencedProject.CreateBatchScope() @@ -256,8 +257,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function MetadataReferenceBeingRemovedAndReAddedWhileOutputPathUpdateInInterleavedBatches(closeReferencedProjectBatchFirst As Boolean) As Task Using environment = New TestEnvironment() - Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, CancellationToken.None) - Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, CancellationToken.None) + Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project.dll" referencingProject.AddMetadataReference(ReferencePath, MetadataReferenceProperties.Assembly.WithAliases(ImmutableArray.Create("temporary"))) @@ -290,8 +291,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function RemoveAndReAddReferenceInSingleBatchWhileChangingCase() As Task Using environment = New TestEnvironment() - Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, CancellationToken.None) - Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, CancellationToken.None) + Dim referencingProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencingProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim referencedProject = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("referencedProject", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project.dll" referencingProject.AddMetadataReference(ReferencePath, MetadataReferenceProperties.Assembly) @@ -316,8 +317,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function MetadataReferenceCycleDoesNotCreateProjectReferenceCycleWhenAddingReferencesFirst() As Task Using environment = New TestEnvironment() - Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project1", LanguageNames.CSharp, CancellationToken.None) - Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project2", LanguageNames.CSharp, CancellationToken.None) + Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath1 = "C:\project1.dll" Const ReferencePath2 = "C:\project2.dll" @@ -337,8 +338,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function MetadataReferenceCycleDoesNotCreateProjectReferenceCycleWhenSettingOutputPathsFirst() As Task Using environment = New TestEnvironment() - Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project1", LanguageNames.CSharp, CancellationToken.None) - Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project2", LanguageNames.CSharp, CancellationToken.None) + Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) + Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath1 = "C:\project1.dll" Const ReferencePath2 = "C:\project2.dll" @@ -358,7 +359,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function DoNotCreateProjectReferenceWhenReferencingOwnOutput() As Task Using environment = New TestEnvironment() - Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project", LanguageNames.CSharp, CancellationToken.None) + Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync("project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Const ReferencePath = "C:\project.dll" diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/PrimaryProjectTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/PrimaryProjectTests.vb index a249e6eed2fce..cea9f39c2c8e9 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/PrimaryProjectTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/PrimaryProjectTests.vb @@ -5,6 +5,7 @@ Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -15,7 +16,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ProjectIsPrimaryByDefault() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Assert.True(project.IsPrimary) End Using @@ -25,7 +26,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ChangeProjectIsPrimary() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project.IsPrimary = False Assert.False(project.IsPrimary) @@ -36,7 +37,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ChangeProjectIsPrimaryBack() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project.IsPrimary = False project.IsPrimary = True diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/ProjectSystemProjectFactoryTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/ProjectSystemProjectFactoryTests.vb index 533a439b2776d..9da0aa1a0449b 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/ProjectSystemProjectFactoryTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/ProjectSystemProjectFactoryTests.vb @@ -15,8 +15,9 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function ProjectInstantiatedWithCompilationOutputAssemblyFilePathCanBeChanged() As Task Using environment = New TestEnvironment() - Dim creationInfo = New VisualStudioProjectCreationInfo() - creationInfo.CompilationOutputAssemblyFilePath = "C:\output\project.dll" + Dim creationInfo = New VisualStudioProjectCreationInfo() With { + .CompilationOutputAssemblyFilePath = "C:\output\project.dll" + } Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( "project1", LanguageNames.CSharp, creationInfo, CancellationToken.None) diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SolutionIdTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SolutionIdTests.vb index e135e766bbaba..38c8822b38589 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SolutionIdTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SolutionIdTests.vb @@ -5,6 +5,7 @@ Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -15,13 +16,13 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function RemovingAndAddingProjectCreatesNewSolutionId() As Task Using environment = New TestEnvironment() Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project1", LanguageNames.CSharp, CancellationToken.None) + "Project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim solutionId = environment.Workspace.CurrentSolution.Id project1.RemoveFromWorkspace() Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project2", LanguageNames.CSharp, CancellationToken.None) + "Project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) ' A new ID should have been generated for the new solution Assert.NotEqual(solutionId, environment.Workspace.CurrentSolution.Id) @@ -32,10 +33,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingASecondProjectLeavesSolutionIdUntouched() As Task Using environment = New TestEnvironment() Dim project1 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project1", LanguageNames.CSharp, CancellationToken.None) + "Project1", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim solutionId = environment.Workspace.CurrentSolution.Id Dim project2 = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project2", LanguageNames.CSharp, CancellationToken.None) + "Project2", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Assert.Equal(solutionId, environment.Workspace.CurrentSolution.Id) End Using diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SourceTextContainerTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SourceTextContainerTests.vb index c8dae3c6f5178..a66a7c7139d57 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SourceTextContainerTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/SourceTextContainerTests.vb @@ -6,6 +6,7 @@ Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Microsoft.VisualStudio.Text Imports Roslyn.Test.Utilities @@ -17,7 +18,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddAndRemoveWorks() As Task Using environment = New TestEnvironment(GetType(TestDynamicFileInfoProviderThatProducesNoFiles)) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "project", LanguageNames.CSharp, CancellationToken.None) + "project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim textBufferFactory = environment.ExportProvider.GetExportedValue(Of ITextBufferFactoryService)() Dim sourceTextContainer = textBufferFactory.CreateTextBuffer().AsTextContainer() diff --git a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/WorkspaceChangedEventTests.vb b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/WorkspaceChangedEventTests.vb index 8cd60bda77f7b..aafec3c751c8e 100644 --- a/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/WorkspaceChangedEventTests.vb +++ b/src/VisualStudio/Core/Test/ProjectSystemShim/VisualStudioProjectTests/WorkspaceChangedEventTests.vb @@ -6,6 +6,7 @@ Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text +Imports Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem Imports Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework Imports Roslyn.Test.Utilities @@ -17,7 +18,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingASingleSourceFileRaisesDocumentAdded(addInBatch As Boolean) As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Using If(addInBatch, project.CreateBatchScope(), Nothing) @@ -36,7 +37,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingTwoDocumentsInBatchRaisesProjectChanged() As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Using project.CreateBatchScope() @@ -57,7 +58,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingASingleAdditionalFileInABatchRaisesDocumentAdded(addInBatch As Boolean) As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Using If(addInBatch, project.CreateBatchScope(), Nothing) @@ -77,7 +78,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function AddingASingleMetadataReferenceRaisesProjectChanged(addInBatch As Boolean) As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Using If(addInBatch, project.CreateBatchScope(), Nothing) @@ -96,7 +97,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function StartingAndEndingBatchWithNoChangesDoesNothing() As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Dim startingSolution = environment.Workspace.CurrentSolution @@ -112,7 +113,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Using environment = New TestEnvironment() Dim workspaceChangeEvents = New WorkspaceChangeWatcher(environment) Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) Assert.Equal(WorkspaceChangeKind.SolutionAdded, Assert.Single(Await workspaceChangeEvents.GetNewChangeEventsAsync()).Kind) @@ -126,7 +127,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim Public Async Function RemovingLastProjectCorrectlyClosesFiles() As Task Using environment = New TestEnvironment() Dim project = Await environment.ProjectFactory.CreateAndAddToWorkspaceAsync( - "Project", LanguageNames.CSharp, CancellationToken.None) + "Project", LanguageNames.CSharp, New VisualStudioProjectCreationInfo(), CancellationToken.None) project.AddSourceTextContainer(SourceText.From("// Test").Container, "Z:\Test.cs") Assert.Single(environment.Workspace.GetOpenDocumentIds())