From b79f0f9f1435287037ddcac221224c071cfd5733 Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Thu, 30 Nov 2023 17:05:31 -0800 Subject: [PATCH] #nullable enable IWorkspaceProjectContext --- .../VS/IFSharpWorkspaceProjectContextFactory.cs | 4 ++-- .../Def/ProjectSystem/CPS/IWorkspaceProjectContext.cs | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Tools/ExternalAccess/FSharp/VS/IFSharpWorkspaceProjectContextFactory.cs b/src/Tools/ExternalAccess/FSharp/VS/IFSharpWorkspaceProjectContextFactory.cs index f7042f933c403..67c5294f273c8 100644 --- a/src/Tools/ExternalAccess/FSharp/VS/IFSharpWorkspaceProjectContextFactory.cs +++ b/src/Tools/ExternalAccess/FSharp/VS/IFSharpWorkspaceProjectContextFactory.cs @@ -126,7 +126,7 @@ public string DisplayName public string BinOutputPath { - get => _vsProjectContext.BinOutputPath; + get => _vsProjectContext.BinOutputPath!; set => _vsProjectContext.BinOutputPath = value; } @@ -134,7 +134,7 @@ public ProjectId Id => _vsProjectContext.Id; public string FilePath - => _vsProjectContext.ProjectFilePath; + => _vsProjectContext.ProjectFilePath!; public int ProjectReferenceCount => _projectReferences.Count; diff --git a/src/VisualStudio/Core/Def/ProjectSystem/CPS/IWorkspaceProjectContext.cs b/src/VisualStudio/Core/Def/ProjectSystem/CPS/IWorkspaceProjectContext.cs index 83e92eb485a32..401225c41b2b9 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/CPS/IWorkspaceProjectContext.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/CPS/IWorkspaceProjectContext.cs @@ -2,14 +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. -#nullable disable - using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem; namespace Microsoft.VisualStudio.LanguageServices.ProjectSystem { @@ -23,10 +20,10 @@ internal interface IWorkspaceProjectContext : IDisposable { // Project properties. string DisplayName { get; set; } - string ProjectFilePath { get; set; } + string? ProjectFilePath { get; set; } Guid Guid { get; set; } bool LastDesignTimeBuildSucceeded { get; set; } - string BinOutputPath { get; set; } + string? BinOutputPath { get; set; } /// /// When this project is one of a multi-targeting group of projects, this value indicates whether or not this @@ -55,11 +52,11 @@ internal interface IWorkspaceProjectContext : IDisposable void RemoveAnalyzerReference(string referencePath); // Files. - void AddSourceFile(string filePath, bool isInCurrentContext = true, IEnumerable folderNames = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular); + void AddSourceFile(string filePath, bool isInCurrentContext = true, IEnumerable? folderNames = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular); void RemoveSourceFile(string filePath); void AddAdditionalFile(string filePath, bool isInCurrentContext = true); void RemoveAdditionalFile(string filePath); - void AddDynamicFile(string filePath, IEnumerable folderNames = null); + void AddDynamicFile(string filePath, IEnumerable? folderNames = null); void RemoveDynamicFile(string filePath); ///