From d7b8c2451d2f13b92054c8587d5509b060597515 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:30:01 +1000 Subject: [PATCH 1/3] Allow more of Razor to use Roslyn Lsp types --- ...ft.CodeAnalysis.LanguageServer.Protocol.csproj | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj b/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj index 73945f4ec700e..1b359cf6c239c 100644 --- a/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj +++ b/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj @@ -37,10 +37,22 @@ + + + + - + + + + + + + + + @@ -89,6 +101,7 @@ + From 0f0ae058d600a44f754c5ce3192bd387ba3c77d2 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:30:20 +1000 Subject: [PATCH 2/3] Add missing Lsp types/properties/defaults --- .../Diagnostics/VSInternalDiagnosticKind.cs | 6 +++--- .../Protocol/Internal/VSInternalMapCodeParams.cs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs b/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs index 3ac8099a356ec..7325280f38ba3 100644 --- a/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs +++ b/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -20,8 +20,8 @@ internal readonly record struct VSInternalDiagnosticKind(string Value) : IString public static readonly VSInternalDiagnosticKind Task = new("task"); /// - /// Edit and Continue diagnostic kind. + /// Syntax diagnostic kind. /// - public static readonly VSInternalDiagnosticKind EditAndContiue = new("enc"); + public static readonly VSInternalDiagnosticKind Syntax = new("syntax"); } } diff --git a/src/LanguageServer/Protocol/Protocol/Internal/VSInternalMapCodeParams.cs b/src/LanguageServer/Protocol/Protocol/Internal/VSInternalMapCodeParams.cs index e1460443c6612..4cf49e5466f12 100644 --- a/src/LanguageServer/Protocol/Protocol/Internal/VSInternalMapCodeParams.cs +++ b/src/LanguageServer/Protocol/Protocol/Internal/VSInternalMapCodeParams.cs @@ -4,6 +4,7 @@ namespace Roslyn.LanguageServer.Protocol { + using System; using System.Text.Json.Serialization; /// @@ -11,6 +12,18 @@ namespace Roslyn.LanguageServer.Protocol /// internal class VSInternalMapCodeParams { + /// + /// Internal correlation GUID, used to correlate map code messages from Copilot + /// with LSP Client actions. Used for telemetry. + /// + [JsonPropertyName("_vs_map_code_correlation_id")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Guid? MapCodeCorrelationId + { + get; + set; + } + /// /// Set of code blocks, associated with documents and regions, to map. /// From 485288668346cc8a0887936ed10011bbb9036f20 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:31:19 +1000 Subject: [PATCH 3/3] Fix some typos --- .../Handler/Diagnostics/PullDiagnosticCategories.cs | 2 +- .../Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj | 2 +- .../Internal/Diagnostics/VSInternalDiagnosticKind.cs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/LanguageServer/Protocol/Handler/Diagnostics/PullDiagnosticCategories.cs b/src/LanguageServer/Protocol/Handler/Diagnostics/PullDiagnosticCategories.cs index ca79789913f81..39ec24da85143 100644 --- a/src/LanguageServer/Protocol/Handler/Diagnostics/PullDiagnosticCategories.cs +++ b/src/LanguageServer/Protocol/Handler/Diagnostics/PullDiagnosticCategories.cs @@ -16,7 +16,7 @@ internal static class PullDiagnosticCategories /// /// Edit and Continue diagnostics. Can be for Document or Workspace pull requests. /// - public static readonly string EditAndContinue = VSInternalDiagnosticKind.EditAndContiue.Value; + public static readonly string EditAndContinue = VSInternalDiagnosticKind.EditAndContinue.Value; // Workspace categories diff --git a/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj b/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj index 1b359cf6c239c..b08de10b4c3d1 100644 --- a/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj +++ b/src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj @@ -45,7 +45,7 @@ - + diff --git a/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs b/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs index 7325280f38ba3..1956ef22d949c 100644 --- a/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs +++ b/src/LanguageServer/Protocol/Protocol/Internal/Diagnostics/VSInternalDiagnosticKind.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -19,6 +19,11 @@ internal readonly record struct VSInternalDiagnosticKind(string Value) : IString /// public static readonly VSInternalDiagnosticKind Task = new("task"); + /// + /// Edit and Continue diagnostic kind. + /// + public static readonly VSInternalDiagnosticKind EditAndContinue = new("enc"); + /// /// Syntax diagnostic kind. ///