Skip to content
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

Allow more of Razor to use Roslyn Lsp types #74597

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static class PullDiagnosticCategories
/// <summary>
/// Edit and Continue diagnostics. Can be for Document or Workspace pull requests.
/// </summary>
public static readonly string EditAndContinue = VSInternalDiagnosticKind.EditAndContiue.Value;
public static readonly string EditAndContinue = VSInternalDiagnosticKind.EditAndContinue.Value;

// Workspace categories

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,22 @@
<!-- Full IVT is through ExternalAccess for functionality -->
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.Razor" />
<!-- Restricted IVT is direct for protocol types only -->
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.LanguageServer" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.LanguageServer" Namespace="Roslyn.Text.Adornments" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Razor.Workspaces" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Razor.Workspaces" Namespace="Roslyn.Text.Adornments" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.Razor" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.Razor" Namespace="Roslyn.Text.Adornments" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Razor" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<!-- Restricted IVT for protocol types for Razor tests -->
<RestrictedInternalsVisibleTo Include="rzls" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<!-- Restricted IVT for protocol types for Razor tests and other non shipping code -->
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.Microbenchmarks" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.LanguageServer.Test" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.LanguageServer.Test" Namespace="Roslyn.Text.Adornments" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.AspNetCore.Razor.Test.Common.Tooling" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.VisualStudio.Razor.IntegrationTests" Namespace="Roslyn.Text.Adornments" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Razor.Workspaces.Test" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.Razor.Test" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<RestrictedInternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Razor.Test" Namespace="Roslyn.LanguageServer.Protocol" Partner="Razor" Key="$(RazorKey)" />
<!-- Full IVT is through ExternalAccess for functionality -->
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.Xaml" />
Expand Down Expand Up @@ -89,6 +101,7 @@
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Features.DiagnosticsTests.Utilities" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Features.Test.Utilities" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.LanguageServer.Protocol.Test.Utilities" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ internal readonly record struct VSInternalDiagnosticKind(string Value) : IString
/// <summary>
/// Edit and Continue diagnostic kind.
/// </summary>
public static readonly VSInternalDiagnosticKind EditAndContiue = new("enc");
public static readonly VSInternalDiagnosticKind EditAndContinue = new("enc");

/// <summary>
/// Syntax diagnostic kind.
/// </summary>
public static readonly VSInternalDiagnosticKind Syntax = new("syntax");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@

namespace Roslyn.LanguageServer.Protocol
{
using System;
using System.Text.Json.Serialization;

/// <summary>
/// LSP Params for textDocument/mapCode calls.
/// </summary>
internal class VSInternalMapCodeParams
{
/// <summary>
/// Internal correlation GUID, used to correlate map code messages from Copilot
/// with LSP Client actions. Used for telemetry.
/// </summary>
[JsonPropertyName("_vs_map_code_correlation_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Guid? MapCodeCorrelationId
{
get;
set;
}

/// <summary>
/// Set of code blocks, associated with documents and regions, to map.
/// </summary>
Expand Down
Loading