From 95c37afc6eec583fa299af8836c06eb0b130908d Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 11:26:21 +1000 Subject: [PATCH 001/223] Rename VsLsp files to just Lsp I'm assuming the Vs versions of these are more complete than the Roslyn ones --- ...spExtensions_LinePosition.cs => LspExtensions_LinePosition.cs} | 0 ...ions_LinePositionSpan.cs => LspExtensions_LinePositionSpan.cs} | 0 .../{VsLspExtensions_Position.cs => LspExtensions_Position.cs} | 0 .../{VsLspExtensions_Range.cs => LspExtensions_Range.cs} | 0 ...nsions_RazorSyntaxTree.cs => LspExtensions_RazorSyntaxTree.cs} | 0 ...{VsLspExtensions_SourceText.cs => LspExtensions_SourceText.cs} | 0 .../{VsLspExtensions_SumTypes.cs => LspExtensions_SumTypes.cs} | 0 ...{VsLspExtensions_SyntaxNode.cs => LspExtensions_SyntaxNode.cs} | 0 ...{VsLspExtensions_TextChange.cs => LspExtensions_TextChange.cs} | 0 ...umentIdentifier.cs => LspExtensions_TextDocumentIdentifier.cs} | 0 ...abilities.cs => LspExtensions_VSInternalClientCapabilities.cs} | 0 ...ions_VSProjectContext.cs => LspExtensions_VSProjectContext.cs} | 0 ...Extensions_WorkspaceEdit.cs => LspExtensions_WorkspaceEdit.cs} | 0 .../Extensions/{VsLspFactory.cs => LspFactory.cs} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_LinePosition.cs => LspExtensions_LinePosition.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_LinePositionSpan.cs => LspExtensions_LinePositionSpan.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_Position.cs => LspExtensions_Position.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_Range.cs => LspExtensions_Range.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_RazorSyntaxTree.cs => LspExtensions_RazorSyntaxTree.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_SourceText.cs => LspExtensions_SourceText.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_SumTypes.cs => LspExtensions_SumTypes.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_SyntaxNode.cs => LspExtensions_SyntaxNode.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_TextChange.cs => LspExtensions_TextChange.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_TextDocumentIdentifier.cs => LspExtensions_TextDocumentIdentifier.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_VSInternalClientCapabilities.cs => LspExtensions_VSInternalClientCapabilities.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_VSProjectContext.cs => LspExtensions_VSProjectContext.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspExtensions_WorkspaceEdit.cs => LspExtensions_WorkspaceEdit.cs} (100%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/{VsLspFactory.cs => LspFactory.cs} (100%) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_LinePosition.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_LinePosition.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_LinePositionSpan.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_LinePositionSpan.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Position.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Position.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Range.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Range.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_RazorSyntaxTree.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_RazorSyntaxTree.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SourceText.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SumTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SumTypes.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SyntaxNode.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_SyntaxNode.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_TextChange.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_TextChange.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_TextDocumentIdentifier.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_TextDocumentIdentifier.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_VSInternalClientCapabilities.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_VSInternalClientCapabilities.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_VSProjectContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_VSProjectContext.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_WorkspaceEdit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_WorkspaceEdit.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs From a9ab06782e4d3a39dcff719ff1e8f2b620667e29 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 11:26:28 +1000 Subject: [PATCH 002/223] Remote RoslynLsp files --- .../RoslynLspExtensions_LinePosition.cs | 12 -- .../RoslynLspExtensions_LinePositionSpan.cs | 12 -- .../RoslynLspExtensions_Position.cs | 15 -- .../Extensions/RoslynLspExtensions_Range.cs | 15 -- .../Extensions/RoslynLspFactory.cs | 191 ------------------ 5 files changed, 245 deletions(-) delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePosition.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePositionSpan.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Position.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Range.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePosition.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePosition.cs deleted file mode 100644 index 7401bd5ca1f..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePosition.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using Microsoft.CodeAnalysis.Text; - -namespace Roslyn.LanguageServer.Protocol; - -internal static partial class RoslynLspExtensions -{ - public static Position ToPosition(this LinePosition linePosition) - => RoslynLspFactory.CreatePosition(linePosition.Line, linePosition.Character); -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePositionSpan.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePositionSpan.cs deleted file mode 100644 index 2819933b95f..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_LinePositionSpan.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using Microsoft.CodeAnalysis.Text; - -namespace Roslyn.LanguageServer.Protocol; - -internal static partial class RoslynLspExtensions -{ - public static Range ToRange(this LinePositionSpan linePositionSpan) - => RoslynLspFactory.CreateRange(linePositionSpan); -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Position.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Position.cs deleted file mode 100644 index e4cd3c1ac93..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Position.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using Microsoft.CodeAnalysis.Text; - -namespace Roslyn.LanguageServer.Protocol; - -internal static partial class RoslynLspExtensions -{ - public static LinePosition ToLinePosition(this Position position) - => new(position.Line, position.Character); - - public static string ToDisplayString(this Position position) - => $"({position.Line}, {position.Character})"; -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Range.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Range.cs deleted file mode 100644 index af7e54346c8..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Range.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using Microsoft.CodeAnalysis.Text; - -namespace Roslyn.LanguageServer.Protocol; - -internal static partial class RoslynLspExtensions -{ - public static LinePositionSpan ToLinePositionSpan(this Range range) - => new(range.Start.ToLinePosition(), range.End.ToLinePosition()); - - public static string ToDisplayString(this Range range) - => $"{range.Start.ToDisplayString()}-{range.End.ToDisplayString()}"; -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs deleted file mode 100644 index 841ea8c1ed4..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Diagnostics; -using Microsoft.CodeAnalysis.Text; - -namespace Roslyn.LanguageServer.Protocol; - -internal static class RoslynLspFactory -{ - private static readonly Position s_defaultPosition = new(0, 0); - - private static readonly Range s_defaultRange = new() - { - Start = s_defaultPosition, - End = s_defaultPosition - }; - - private static readonly Position s_undefinedPosition = new(-1, -1); - - private static readonly Range s_undefinedRange = new() - { - Start = s_undefinedPosition, - End = s_undefinedPosition - }; - - /// - /// Returns a for line 0 and character 0. - /// - public static Position DefaultPosition - { - get - { - var defaultPosition = s_defaultPosition; - - // Since Position is mutable, it's possible that something might modify it. If that happens, we should know! - Debug.Assert( - defaultPosition.Line == 0 && - defaultPosition.Character == 0, - $"{nameof(RoslynLspFactory)}.{nameof(DefaultPosition)} has been corrupted. Current value: {defaultPosition.ToDisplayString()}"); - - return defaultPosition; - } - } - - /// - /// Returns a for starting line 0 and character 0, - /// and ending line 0 and character 0. - /// - public static Range DefaultRange - { - get - { - var defaultRange = s_defaultRange; - - // Since Range is mutable, it's possible that something might modify it. If that happens, we should know! - Debug.Assert( - defaultRange.Start.Line == 0 && - defaultRange.Start.Character == 0 && - defaultRange.End.Line == 0 && - defaultRange.End.Character == 0, - $"{nameof(RoslynLspFactory)}.{nameof(DefaultRange)} has been corrupted. Current value: {defaultRange.ToDisplayString()}"); - - return defaultRange; - } - } - - public static Position UndefinedPosition - { - get - { - var undefinedPosition = s_undefinedPosition; - - // Since Position is mutable, it's possible that something might modify it. If that happens, we should know! - Debug.Assert( - undefinedPosition.Line == -1 && - undefinedPosition.Character == -1, - $"{nameof(RoslynLspFactory)}.{nameof(UndefinedPosition)} has been corrupted. Current value: {undefinedPosition.ToDisplayString()}"); - - return undefinedPosition; - } - } - - public static Range UndefinedRange - { - get - { - var undefinedRange = s_undefinedRange; - - // Since Range is mutable, it's possible that something might modify it. If that happens, we should know! - Debug.Assert( - undefinedRange.Start.Line == -1 && - undefinedRange.Start.Character == -1 && - undefinedRange.End.Line == -1 && - undefinedRange.End.Character == -1, - $"{nameof(RoslynLspFactory)}.{nameof(UndefinedRange)} has been corrupted. Current value: {undefinedRange.ToDisplayString()}"); - - return undefinedRange; - } - } - - public static Position CreatePosition(int line, int character) - => (line, character) switch - { - (0, 0) => DefaultPosition, - (-1, -1) => UndefinedPosition, - _ => new(line, character) - }; - - public static Position CreatePosition(LinePosition linePosition) - => CreatePosition(linePosition.Line, linePosition.Character); - - public static Position CreatePosition((int line, int character) position) - => CreatePosition(position.line, position.character); - - public static Range CreateRange(int startLine, int startCharacter, int endLine, int endCharacter) - => startLine == endLine && startCharacter == endCharacter - ? CreateZeroWidthRange(startLine, startCharacter) - : CreateRange(CreatePosition(startLine, startCharacter), CreatePosition(endLine, endCharacter)); - - public static Range CreateRange(Position start, Position end) - => new() { Start = start, End = end }; - - public static Range CreateRange(LinePosition start, LinePosition end) - => CreateRange(start.Line, start.Character, end.Line, end.Character); - - public static Range CreateRange((int line, int character) start, (int line, int character) end) - => CreateRange(start.line, start.character, end.line, end.character); - - public static Range CreateRange(LinePositionSpan span) - => CreateRange(span.Start, span.End); - - public static Range CreateZeroWidthRange(int line, int character) - => (line, character) switch - { - (0, 0) => DefaultRange, - (-1, -1) => UndefinedRange, - _ => CreateZeroWidthRange(CreatePosition(line, character)) - }; - - public static Range CreateZeroWidthRange(Position position) - => CreateRange(position, position); - - public static Range CreateZeroWidthRange(LinePosition position) - => CreateRange(position, position); - - public static Range CreateZeroWidthRange((int line, int character) position) - => CreateRange(position, position); - - public static Range CreateSingleLineRange(int line, int character, int length) - => CreateRange(line, character, line, character + length); - - public static Range CreateSingleLineRange(Position start, int length) - => CreateRange(start, CreatePosition(start.Line, start.Character + length)); - - public static Range CreateSingleLineRange(LinePosition start, int length) - => CreateSingleLineRange(start.Line, start.Character, length); - - public static Range CreateSingleLineRange((int line, int character) start, int length) - => CreateRange(CreatePosition(start), CreatePosition(start.line, start.character + length)); - - public static TextEdit CreateTextEdit(Range range, string newText) - => new() { Range = range, NewText = newText }; - - public static TextEdit CreateTextEdit(LinePositionSpan span, string newText) - => CreateTextEdit(CreateRange(span), newText); - - public static TextEdit CreateTextEdit(int startLine, int startCharacter, int endLine, int endCharacter, string newText) - => CreateTextEdit(CreateRange(startLine, startCharacter, endLine, endCharacter), newText); - - public static TextEdit CreateTextEdit(Position start, Position end, string newText) - => CreateTextEdit(CreateRange(start, end), newText); - - public static TextEdit CreateTextEdit(LinePosition start, LinePosition end, string newText) - => CreateTextEdit(CreateRange(start, end), newText); - - public static TextEdit CreateTextEdit((int line, int character) start, (int line, int character) end, string newText) - => CreateTextEdit(CreateRange(start, end), newText); - - public static TextEdit CreateTextEdit(int line, int character, string newText) - => CreateTextEdit(CreateZeroWidthRange(line, character), newText); - - public static TextEdit CreateTextEdit(Position position, string newText) - => CreateTextEdit(CreateZeroWidthRange(position), newText); - - public static TextEdit CreateTextEdit(LinePosition position, string newText) - => CreateTextEdit(CreateZeroWidthRange(position.Line, position.Character), newText); - - public static TextEdit CreateTextEdit((int line, int character) position, string newText) - => CreateTextEdit(CreateZeroWidthRange(position), newText); -} From b0dcedba1bf3b52f26fd72a1d2a0e0d6e5825777 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 11:28:08 +1000 Subject: [PATCH 003/223] Rename VsLsp* and RoslynLsp* to just Lsp* This commit done entirely via Replace In Files --- .../RazorDiagnosticsBenchmark.cs | 4 +- .../RazorSemanticTokensBenchmark.cs | 2 +- ...zorSemanticTokensRangeEndpointBenchmark.cs | 2 +- .../RazorSemanticTokensScrollingBenchmark.cs | 2 +- .../AutoClosingTagOnAutoInsertProvider.cs | 4 +- .../CloseTextTagOnAutoInsertProvider.cs | 2 +- .../TypeAccessibilityCodeActionProvider.cs | 2 +- .../Razor/AddUsingsCodeActionResolver.cs | 6 +-- .../CodeActions/Razor/CodeBlockService.cs | 10 ++--- ...omponentAccessibilityCodeActionProvider.cs | 4 +- .../CreateComponentCodeActionResolver.cs | 2 +- .../ExtractToCodeBehindCodeActionResolver.cs | 4 +- .../Razor/GenerateMethodCodeActionResolver.cs | 6 +-- .../DelegatedCompletionListProvider.cs | 4 +- .../Delegation/TextEditResponseRewriter.cs | 4 +- .../Definition/DefinitionEndpoint.cs | 2 +- .../RazorTranslateDiagnosticsService.cs | 4 +- ...actTextDocumentPresentationEndpointBase.cs | 2 +- .../TextDocumentUriPresentationEndpoint.cs | 2 +- .../Formatting/CSharpOnTypeFormattingPass.cs | 4 +- .../Formatting/RazorFormattingPass.cs | 14 +++--- .../MapCode/MapCodeEndpoint.cs | 4 +- .../RazorMapToDocumentRangesEndpoint.cs | 2 +- .../Refactoring/RenameEndpoint.cs | 4 +- .../LSPCSharpSemanticTokensProvider.cs | 2 +- .../AbstractRazorDocumentMappingService.cs | 12 ++--- .../Extensions/LspExtensions_LinePosition.cs | 6 +-- .../LspExtensions_LinePositionSpan.cs | 4 +- .../Extensions/LspExtensions_Position.cs | 4 +- .../Extensions/LspExtensions_Range.cs | 6 +-- .../LspExtensions_RazorSyntaxTree.cs | 2 +- .../Extensions/LspExtensions_SourceText.cs | 4 +- .../Extensions/LspExtensions_SumTypes.cs | 2 +- .../Extensions/LspExtensions_SyntaxNode.cs | 6 +-- .../Extensions/LspExtensions_TextChange.cs | 2 +- .../LspExtensions_TextDocumentIdentifier.cs | 2 +- ...Extensions_VSInternalClientCapabilities.cs | 2 +- .../LspExtensions_VSProjectContext.cs | 2 +- .../Extensions/LspExtensions_WorkspaceEdit.cs | 2 +- .../Extensions/LspFactory.cs | 10 ++--- .../RemoteDocumentHighlight.cs | 4 +- .../RemoteDocumentHighlightService.cs | 6 +-- .../Cohost/CohostSignatureHelpEndpoint.cs | 6 +-- .../DefaultRazorBreakpointResolver.cs | 2 +- ...DefaultRazorProximityExpressionResolver.cs | 2 +- .../RazorCustomMessageTarget_Completion.cs | 6 +-- .../OnAutoInsertEndpointTest.NetFx.cs | 20 ++++----- .../AutoInsert/OnAutoInsertEndpointTest.cs | 8 ++-- .../DefaultCSharpCodeActionProviderTest.cs | 16 +++---- .../DefaultCSharpCodeActionResolverTest.cs | 8 ++-- ...TypeAccessibilityCodeActionProviderTest.cs | 18 ++++---- .../CodeActions/CodeActionEndpointTest.cs | 38 ++++++++-------- .../Html/DefaultHtmlCodeActionProviderTest.cs | 8 ++-- .../Html/DefaultHtmlCodeActionResolverTest.cs | 4 +- ...nentAccessibilityCodeActionProviderTest.cs | 22 +++++----- ...tractToCodeBehindCodeActionProviderTest.cs | 20 ++++----- ...legatedCompletionItemResolverTest.NetFx.cs | 4 +- .../DelegatedCompletionListProviderTest.cs | 6 +-- .../TextEditResponseRewriterTest.cs | 12 ++--- .../Completion/RazorCompletionEndpointTest.cs | 4 +- .../RazorBreakpointSpanEndpointTest.cs | 26 +++++------ .../RazorProximityExpressionsEndpointTest.cs | 10 ++--- .../RazorDiagnosticConverterTest.cs | 8 ++-- .../RazorDiagnosticsPublisherTest.cs | 4 +- ...xtDocumentTextPresentationEndpointTests.cs | 8 ++-- ...extDocumentUriPresentationEndpointTests.cs | 22 +++++----- .../DocumentDidChangeEndpointTest.cs | 10 ++--- .../DocumentOnTypeFormattingEndpointTest.cs | 10 ++--- .../FormattingContentValidationPassTest.cs | 4 +- .../FormattingDiagnosticValidationPassTest.cs | 8 ++-- .../FormattingLanguageServerClient.cs | 2 +- .../Formatting_NetFx/FormattingTestBase.cs | 2 +- .../RazorFormattingServiceTest.cs | 4 +- .../Hover/HoverServiceTest.cs | 40 ++++++++--------- .../InlayHints/InlayHintEndpointTest.cs | 2 +- .../LinkedEditingRangeEndpointTest.cs | 44 +++++++++---------- .../Mapping/RazorLanguageQueryEndpointTest.cs | 8 ++-- .../RazorMapToDocumentRangesEndpointTest.cs | 24 +++++----- .../RangeExtensionsTests.cs | 20 ++++----- .../Refactoring/RenameEndpointTest.cs | 26 +++++------ .../WrapWithTag/WrapWithTagEndpointTests.cs | 38 ++++++++-------- .../CohostUriPresentationEndpointTest.cs | 4 +- .../DefaultRazorBreakpointResolverTest.cs | 4 +- .../DefaultLSPDocumentMappingProviderTest.cs | 8 ++-- .../RazorCustomMessageTargetTest.cs | 12 ++--- .../RazorLSPSpanMappingServiceTest.cs | 4 +- .../LanguageClient/TestDocumentManager.cs | 2 +- ...anguageService_IVsLanguageDebugInfoTest.cs | 2 +- 88 files changed, 367 insertions(+), 367 deletions(-) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs index 7cb21677aa5..f1878b7f567 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs @@ -207,8 +207,8 @@ public Task SendRequestAsync(string method, TPara } } - private Range InRange { get; set; } = VsLspFactory.CreateSingleLineRange(line: 85, character: 8, length: 8); - private Range OutRange { get; set; } = VsLspFactory.CreateSingleLineRange(line: 6, character: 8, length: 8); + private Range InRange { get; set; } = LspFactory.CreateSingleLineRange(line: 85, character: 8, length: 8); + private Range OutRange { get; set; } = LspFactory.CreateSingleLineRange(line: 6, character: 8, length: 8); private Diagnostic[] GetDiagnostics(int n) => Enumerable.Range(1, n).Select(_ => new Diagnostic() { diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs index 6f053edeadc..2c5dd603ac1 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs @@ -66,7 +66,7 @@ public async Task InitializeRazorSemanticAsync() DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version); var text = await DocumentContext.GetSourceTextAsync(CancellationToken.None).ConfigureAwait(false); - Range = VsLspFactory.CreateRange( + Range = LspFactory.CreateRange( start: (0, 0), end: (text.Lines.Count - 1, text.Lines[^1].Span.Length - 1)); } diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs index 6bd676543de..4f30af12f11 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs @@ -79,7 +79,7 @@ public async Task InitializeRazorSemanticAsync() SemanticTokensRangeEndpoint = new SemanticTokensRangeEndpoint(RazorSemanticTokenService, razorSemanticTokensLegendService, razorOptionsMonitor, telemetryReporter: null); var text = await DocumentContext.GetSourceTextAsync(CancellationToken.None).ConfigureAwait(false); - Range = VsLspFactory.CreateRange( + Range = LspFactory.CreateRange( start: (0, 0), end: (text.Lines.Count - 1, text.Lines[^1].Span.Length - 1)); diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs index 4063270b669..f08d37cbf34 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs @@ -55,7 +55,7 @@ public async Task InitializeRazorSemanticAsync() DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version: 1); var text = await DocumentSnapshot.GetTextAsync().ConfigureAwait(false); - Range = VsLspFactory.CreateRange( + Range = LspFactory.CreateRange( start: (0, 0), end: (text.Lines.Count - 1, 0)); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs index e216c899d0d..c553ce23987 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs @@ -68,7 +68,7 @@ public bool TryResolveInsertion(Position position, FormattingContext context, [N if (autoClosingBehavior == AutoClosingBehavior.EndTag) { format = InsertTextFormat.Snippet; - edit = VsLspFactory.CreateTextEdit(position, $"$0"); + edit = LspFactory.CreateTextEdit(position, $"$0"); return true; } @@ -79,7 +79,7 @@ public bool TryResolveInsertion(Position position, FormattingContext context, [N // Need to replace the `>` with ' />$0' or '/>$0' depending on if there's prefixed whitespace. var insertionText = char.IsWhiteSpace(context.SourceText[afterCloseAngleIndex - 2]) ? "/" : " /"; - edit = VsLspFactory.CreateTextEdit(position.Line, position.Character - 1, insertionText); + edit = LspFactory.CreateTextEdit(position.Line, position.Character - 1, insertionText); return true; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs index 8ce976721ee..c644948cfd3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs @@ -38,7 +38,7 @@ public bool TryResolveInsertion(Position position, FormattingContext context, [N // This is a text tag. format = InsertTextFormat.Snippet; - edit = VsLspFactory.CreateTextEdit(position, $"$0"); + edit = LspFactory.CreateTextEdit(position, $"$0"); return true; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs index 0cbd6d6f4a6..e89d2880f55 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs @@ -261,7 +261,7 @@ private static RazorVSInternalCodeAction CreateFQNCodeAction( { var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier() { Uri = context.Request.TextDocument.Uri }; - var fqnTextEdit = VsLspFactory.CreateTextEdit(fqnDiagnostic.Range, fullyQualifiedName); + var fqnTextEdit = LspFactory.CreateTextEdit(fqnDiagnostic.Range, fullyQualifiedName); var fqnWorkspaceEditDocumentChange = new TextDocumentEdit() { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs index 5923d2ed861..ea5b810adfc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs @@ -123,7 +123,7 @@ private static TextDocumentEdit GenerateSingleUsingEditsInterpolated( if (string.CompareOrdinal(newUsingNamespace, usingDirectiveNamespace) < 0) { var usingDirectiveLineIndex = codeDocument.Source.Text.GetLinePosition(usingDirective.Node.Span.Start).Line; - var edit = VsLspFactory.CreateTextEdit(line: usingDirectiveLineIndex, character: 0, newText); + var edit = LspFactory.CreateTextEdit(line: usingDirectiveLineIndex, character: 0, newText); edits.Add(edit); break; } @@ -134,7 +134,7 @@ private static TextDocumentEdit GenerateSingleUsingEditsInterpolated( { var endIndex = existingUsingDirectives[^1].Node.Span.End; var lineIndex = GetLineIndexOrEnd(codeDocument, endIndex - 1) + 1; - var edit = VsLspFactory.CreateTextEdit(line: lineIndex, character: 0, newText); + var edit = LspFactory.CreateTextEdit(line: lineIndex, character: 0, newText); edits.Add(edit); } @@ -168,7 +168,7 @@ private static TextDocumentEdit GenerateSingleUsingEditsAtTop( return new TextDocumentEdit { TextDocument = codeDocumentIdentifier, - Edits = [VsLspFactory.CreateTextEdit(insertPosition, newText: $"@using {newUsingNamespace}{Environment.NewLine}")] + Edits = [LspFactory.CreateTextEdit(insertPosition, newText: $"@using {newUsingNamespace}{Environment.NewLine}")] }; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs index 9cda5df9204..62ece3f7a58 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs @@ -60,10 +60,10 @@ public static TextEdit[] CreateFormattedTextEdit(RazorCodeDocument code, string codeBlockStartText = $"{Environment.NewLine}{codeBlockStartText}"; } - var eofRange = VsLspFactory.CreateZeroWidthRange(lastCharacterLocation.LineNumber, insertCharacterIndex); - var start = VsLspFactory.CreateTextEdit(eofRange, codeBlockStartText); - var method = VsLspFactory.CreateTextEdit(eofRange, indentedMethod); - var end = VsLspFactory.CreateTextEdit(eofRange, Environment.NewLine + "}"); + var eofRange = LspFactory.CreateZeroWidthRange(lastCharacterLocation.LineNumber, insertCharacterIndex); + var start = LspFactory.CreateTextEdit(eofRange, codeBlockStartText); + var method = LspFactory.CreateTextEdit(eofRange, indentedMethod); + var end = LspFactory.CreateTextEdit(eofRange, Environment.NewLine + "}"); return [start, method, end]; } @@ -93,7 +93,7 @@ public static TextEdit[] CreateFormattedTextEdit(RazorCodeDocument code, string ? closeBraceLocation.CharacterIndex : 0; - return [VsLspFactory.CreateTextEdit(insertLineLocation.LineIndex, insertCharacter, formattedGeneratedMethod)]; + return [LspFactory.CreateTextEdit(insertLineLocation.LineIndex, insertCharacter, formattedGeneratedMethod)]; } private static string FormatMethodInCodeBlock( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs index 1404d1910a9..907ac96017c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs @@ -276,14 +276,14 @@ private static WorkspaceEdit CreateRenameTagEdit(RazorCodeActionContext context, using var textEdits = new PooledArrayBuilder(); var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier() { Uri = context.Request.TextDocument.Uri }; - var startTagTextEdit = VsLspFactory.CreateTextEdit(startTag.Name.GetRange(context.CodeDocument.Source), newTagName); + var startTagTextEdit = LspFactory.CreateTextEdit(startTag.Name.GetRange(context.CodeDocument.Source), newTagName); textEdits.Add(startTagTextEdit); var endTag = (startTag.Parent as MarkupElementSyntax)?.EndTag; if (endTag != null) { - var endTagTextEdit = VsLspFactory.CreateTextEdit(endTag.Name.GetRange(context.CodeDocument.Source), newTagName); + var endTagTextEdit = LspFactory.CreateTextEdit(endTag.Name.GetRange(context.CodeDocument.Source), newTagName); textEdits.Add(endTagTextEdit); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs index 75d538382ab..29ddff07cc5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs @@ -85,7 +85,7 @@ private static void TryAddNamespaceDirective(RazorCodeDocument codeDocument, Uri documentChanges.Add(new TextDocumentEdit { TextDocument = documentIdentifier, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), namespaceDirective.GetContent())] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), namespaceDirective.GetContent())] }); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs index 74a832a0f2b..886dd50da75 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs @@ -96,12 +96,12 @@ internal sealed class ExtractToCodeBehindCodeActionResolver( new TextDocumentEdit { TextDocument = codeDocumentIdentifier, - Edits = [VsLspFactory.CreateTextEdit(removeRange, string.Empty)] + Edits = [LspFactory.CreateTextEdit(removeRange, string.Empty)] }, new TextDocumentEdit { TextDocument = codeBehindDocumentIdentifier, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), codeBehindContent)] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), codeBehindContent)] } }; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs index f79fe80a516..3168e767478 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs @@ -112,7 +112,7 @@ razorClassName is null || classLocationLineSpan.StartLinePosition.Character, content); - var edit = VsLspFactory.CreateTextEdit( + var edit = LspFactory.CreateTextEdit( line: classLocationLineSpan.EndLinePosition.Line, character: 0, $"{formattedMethod}{Environment.NewLine}"); @@ -161,7 +161,7 @@ private async Task GenerateMethodInCodeBlockAsync( // just get the simplified text that comes back from Roslyn. var classLocationLineSpan = @class.GetLocation().GetLineSpan(); - var tempTextEdit = VsLspFactory.CreateTextEdit( + var tempTextEdit = LspFactory.CreateTextEdit( line: classLocationLineSpan.EndLinePosition.Line, character: 0, editToSendToRoslyn.NewText); @@ -192,7 +192,7 @@ private async Task GenerateMethodInCodeBlockAsync( .Replace(FormattingUtilities.InitialIndent, string.Empty) .Replace(FormattingUtilities.Indent, string.Empty); - var remappedEdit = VsLspFactory.CreateTextEdit(remappedRange, unformattedMethodSignature); + var remappedEdit = LspFactory.CreateTextEdit(remappedRange, unformattedMethodSignature); var delegatedParams = new DelegatedSimplifyMethodParams(documentContext.Identifier, RequiresVirtualDocument: true, remappedEdit); var result = await _clientConnection.SendRequestAsync( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs index e830fee0ff0..a35d13bb895 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs @@ -214,11 +214,11 @@ private static VSInternalCompletionContext RewriteContext(VSInternalCompletionCo // Edit the CSharp projected document to contain a '.'. This allows C# completion to provide valid // completion items for moments when a user has typed a '.' that's typically interpreted as Html. - var addProvisionalDot = VsLspFactory.CreateTextEdit(previousPosition, "."); + var addProvisionalDot = LspFactory.CreateTextEdit(previousPosition, "."); var provisionalPositionInfo = new DocumentPositionInfo( RazorLanguageKind.CSharp, - VsLspFactory.CreatePosition( + LspFactory.CreatePosition( previousPosition.Line, previousPosition.Character + 1), previousCharacterPositionInfo.HostDocumentIndex + 1); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs index fff2e226c9b..b25972b14ea 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs @@ -90,7 +90,7 @@ private static Range TranslateRange(Position hostDocumentPosition, Position proj var translatedStartPosition = TranslatePosition(offset, hostDocumentPosition, textEditRange.Start); var translatedEndPosition = TranslatePosition(offset, hostDocumentPosition, textEditRange.End); - return VsLspFactory.CreateRange(translatedStartPosition, translatedEndPosition); + return LspFactory.CreateRange(translatedStartPosition, translatedEndPosition); static Position TranslatePosition(int offset, Position hostDocumentPosition, Position editPosition) { @@ -98,7 +98,7 @@ static Position TranslatePosition(int offset, Position hostDocumentPosition, Pos // Note: If this completion handler ever expands to deal with multi-line TextEdits, this logic will likely need to change since // it assumes we're only dealing with single-line TextEdits. - return VsLspFactory.CreatePosition(hostDocumentPosition.Line, translatedCharacter); + return LspFactory.CreatePosition(hostDocumentPosition.Line, translatedCharacter); } } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index 3a6aad8e6f6..c772aff6175 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -264,7 +264,7 @@ private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapsh // If we were trying to navigate to a property, and we couldn't find it, we can at least take // them to the file for the component. If the property was defined in a partial class they can // at least then press F7 to go there. - return VsLspFactory.DefaultRange; + return LspFactory.DefaultRange; } internal static async Task TryGetPropertyRangeAsync(RazorCodeDocument codeDocument, string propertyName, IRazorDocumentMappingService documentMappingService, ILogger logger, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs index 7831e806f0b..7107ff409a0 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs @@ -474,7 +474,7 @@ private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocum // For `Error` Severity diagnostics we still show the diagnostics to // the user, however we set the range to an undefined range to ensure // clicking on the diagnostic doesn't cause errors. - originalRange = VsLspFactory.UndefinedRange; + originalRange = LspFactory.UndefinedRange; } return true; @@ -544,7 +544,7 @@ private bool TryRemapRudeEditRange(Range diagnosticRange, RazorCodeDocument code var diagnosticEndWhitespaceOffset = diagnosticEndCharacter + 1; var endLinePosition = (endLineIndex, diagnosticEndWhitespaceOffset); - remappedRange = VsLspFactory.CreateRange(startLinePosition, endLinePosition); + remappedRange = LspFactory.CreateRange(startLinePosition, endLinePosition); return true; } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs index e2134c10ed2..e45daae36d9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs @@ -238,7 +238,7 @@ private TextEdit[] MapTextEdits(bool mapRanges, RazorCodeDocument codeDocument, return []; } - var newEdit = VsLspFactory.CreateTextEdit(newRange, edit.NewText); + var newEdit = LspFactory.CreateTextEdit(newRange, edit.NewText); mappedEdits.Add(newEdit); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs index 72cf2558498..8d1d0392421 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs @@ -76,7 +76,7 @@ protected override IRazorPresentationParams CreateRazorRequestParameters(UriPres { Uri = request.TextDocument.Uri }, - Edits = [VsLspFactory.CreateTextEdit(request.Range, componentTagText)] + Edits = [LspFactory.CreateTextEdit(request.Range, componentTagText)] } } }; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs index 1c60b4fa464..029d4abade1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs @@ -179,13 +179,13 @@ public async override Task ExecuteAsync(FormattingContext cont start = firstPosition; } - var end = VsLspFactory.CreatePosition(rangeAfterFormatting.End.Line + lineDelta, 0); + var end = LspFactory.CreatePosition(rangeAfterFormatting.End.Line + lineDelta, 0); if (lastPosition is not null && lastPosition.CompareTo(start) < 0) { end = lastPosition; } - var rangeToAdjust = VsLspFactory.CreateRange(start, end); + var rangeToAdjust = LspFactory.CreateRange(start, end); Debug.Assert(cleanedText.IsValidPosition(rangeToAdjust.End), "Invalid range. This is unexpected."); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs index d4d86a468c9..389a1d71d50 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs @@ -117,7 +117,7 @@ directiveCode.Children is [RazorDirectiveSyntax directive] && else if (children.TryGetOpenBraceToken(out var brace)) { // If there is no whitespace at all we normalize to a single space - var edit = VsLspFactory.CreateTextEdit(brace.GetRange(source).Start, " "); + var edit = LspFactory.CreateTextEdit(brace.GetRange(source).Start, " "); edits.Add(edit); return true; @@ -279,7 +279,7 @@ private void TryFormatCSharpBlockStructure(FormattingContext context, List edits, R // If there is anything other than one single space then we replace with one space between directive and brace. // // ie, "@code {" will become "@code {" - var edit = VsLspFactory.CreateTextEdit(node.GetRange(source), " "); + var edit = LspFactory.CreateTextEdit(node.GetRange(source), " "); edits.Add(edit); } @@ -389,7 +389,7 @@ codeRange is not null && newText += FormattingUtilities.GetIndentationString(additionalIndentationLevel, context.Options.InsertSpaces, context.Options.TabSize); } - var edit = VsLspFactory.CreateTextEdit(openBraceRange.End, newText); + var edit = LspFactory.CreateTextEdit(openBraceRange.End, newText); edits.Add(edit); didFormat = true; } @@ -404,7 +404,7 @@ closeBraceRange is not null && { // If we have a directive, then we line the close brace up with it, and ensure // there is a close brace - var edit = VsLspFactory.CreateTextEdit(start: codeRange.End, end: closeBraceRange.Start, + var edit = LspFactory.CreateTextEdit(start: codeRange.End, end: closeBraceRange.Start, context.NewLineString + FormattingUtilities.GetIndentationString( directiveNode.GetRange(source).Start.Character, context.Options.InsertSpaces, context.Options.TabSize)); @@ -414,7 +414,7 @@ closeBraceRange is not null && else if (codeRange.End.Line == closeBraceRange.Start.Line) { // Add a Newline between the content and the "}" if one doesn't already exist. - var edit = VsLspFactory.CreateTextEdit(codeRange.End, context.NewLineString); + var edit = LspFactory.CreateTextEdit(codeRange.End, context.NewLineString); edits.Add(edit); didFormat = true; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs index f076c975592..5887fa977fa 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs @@ -236,7 +236,7 @@ private async Task TryMapCodeAsync( if (insertionSpan is not null) { var textSpan = new TextSpan(insertionSpan.Value, 0); - var edit = VsLspFactory.CreateTextEdit(sourceText.GetRange(textSpan), nodeToMap.ToFullString()); + var edit = LspFactory.CreateTextEdit(sourceText.GetRange(textSpan), nodeToMap.ToFullString()); var textDocumentEdit = new TextDocumentEdit { @@ -440,7 +440,7 @@ async Task TryProcessEditAsync( return false; } - var textEdit = VsLspFactory.CreateTextEdit(hostDocumentRange, documentEdit.NewText); + var textEdit = LspFactory.CreateTextEdit(hostDocumentRange, documentEdit.NewText); var textDocumentEdit = new TextDocumentEdit { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs index 18f308dc13c..3bd789f83bb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs @@ -66,7 +66,7 @@ public Uri GetTextDocumentIdentifier(RazorMapToDocumentRangesParams request) !_documentMappingService.TryMapToHostDocumentRange(codeDocument.GetCSharpDocument(), projectedRange, request.MappingBehavior, out var originalRange)) { // All language queries on unsupported documents return Html. This is equivalent to what pre-VSCode Razor was capable of. - ranges[i] = VsLspFactory.UndefinedRange; + ranges[i] = LspFactory.UndefinedRange; continue; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs index 761ae07fc07..2ece256074c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs @@ -320,11 +320,11 @@ private static TextEdit[] CreateEditsForMarkupTagHelperElement(MarkupTagHelperEl { using var _ = ListPool.GetPooledObject(out var edits); - edits.Add(VsLspFactory.CreateTextEdit(element.StartTag.Name.GetRange(codeDocument.Source), newName)); + edits.Add(LspFactory.CreateTextEdit(element.StartTag.Name.GetRange(codeDocument.Source), newName)); if (element.EndTag is MarkupTagHelperEndTagSyntax endTag) { - edits.Add(VsLspFactory.CreateTextEdit(endTag.Name.GetRange(codeDocument.Source), newName)); + edits.Add(LspFactory.CreateTextEdit(endTag.Name.GetRange(codeDocument.Source), newName)); } return [.. edits]; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs index 841b15ba463..641c91c7b92 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs @@ -50,7 +50,7 @@ internal class LSPCSharpSemanticTokensProvider(LanguageServerFeatureOptions lang // Likely the server doesn't support the new endpoint, fallback to the original one if (csharpResponse?.Tokens is null && csharpRanges.Length > 1) { - var minimalRange = VsLspFactory.CreateRange(csharpRanges[0].Start, csharpRanges[^1].End); + var minimalRange = LspFactory.CreateRange(csharpRanges[0].Start, csharpRanges[^1].End); var newParams = new ProvideSemanticTokensRangesParams( parameter.TextDocument, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs index 03a99f532c1..96f490aa9cd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs @@ -62,7 +62,7 @@ public TextEdit[] GetHostDocumentEdits(IRazorGeneratedDocument generatedDocument // between this edit and the previous one, because the normalization will have swallowed it. See // below for a more info. var newText = (lastNewLineAddedToLine == range.Start.Line ? " " : "") + edit.NewText; - hostDocumentEdits.Add(VsLspFactory.CreateTextEdit(hostDocumentStart!, hostDocumentEnd!, newText)); + hostDocumentEdits.Add(LspFactory.CreateTextEdit(hostDocumentStart!, hostDocumentEnd!, newText)); continue; } @@ -95,7 +95,7 @@ public TextEdit[] GetHostDocumentEdits(IRazorGeneratedDocument generatedDocument // so we can ignore all but the last line. This assert ensures that is true, just in case something changes in Roslyn Debug.Assert(lastNewLine == 0 || edit.NewText[..(lastNewLine - 1)].All(c => c == '\r' || c == '\n'), "We are throwing away part of an edit that has more than just empty lines!"); - var proposedRange = VsLspFactory.CreateSingleLineRange(range.End.Line, character: 0, length: range.End.Character); + var proposedRange = LspFactory.CreateSingleLineRange(range.End.Line, character: 0, length: range.End.Character); startSync = generatedDocumentSourceText.TryGetAbsoluteIndex(proposedRange.Start, out startIndex); endSync = generatedDocumentSourceText.TryGetAbsoluteIndex(proposedRange.End, out endIndex); if (startSync is false || endSync is false) @@ -108,7 +108,7 @@ public TextEdit[] GetHostDocumentEdits(IRazorGeneratedDocument generatedDocument if (mappedStart && mappedEnd) { - hostDocumentEdits.Add(VsLspFactory.CreateTextEdit(hostDocumentStart!, hostDocumentEnd!, edit.NewText[lastNewLine..])); + hostDocumentEdits.Add(LspFactory.CreateTextEdit(hostDocumentStart!, hostDocumentEnd!, edit.NewText[lastNewLine..])); continue; } } @@ -161,13 +161,13 @@ public TextEdit[] GetHostDocumentEdits(IRazorGeneratedDocument generatedDocument // If we already added a newline to this line, then we don't want to add another one, but // we do need to add a space between this edit and the previous one, because the normalization // will have swallowed it. - hostDocumentEdits.Add(VsLspFactory.CreateTextEdit(hostDocumentIndex, " " + edit.NewText)); + hostDocumentEdits.Add(LspFactory.CreateTextEdit(hostDocumentIndex, " " + edit.NewText)); } else { // Otherwise, add a newline and the real content, and remember where we added it lastNewLineAddedToLine = range.Start.Line; - hostDocumentEdits.Add(VsLspFactory.CreateTextEdit( + hostDocumentEdits.Add(LspFactory.CreateTextEdit( hostDocumentIndex, Environment.NewLine + new string(' ', range.Start.Character) + edit.NewText)); } @@ -867,7 +867,7 @@ private TextEdit[] RemapTextEditsCore(Uri generatedDocumentUri, RazorCodeDocumen continue; } - var edit = VsLspFactory.CreateTextEdit(originalRange, edits[i].NewText); + var edit = LspFactory.CreateTextEdit(originalRange, edits[i].NewText); remappedEdits.Add(edit); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs index 8beb8510be0..0eee990af2f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs @@ -5,11 +5,11 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static Position ToPosition(this LinePosition linePosition) - => VsLspFactory.CreatePosition(linePosition.Line, linePosition.Character); + => LspFactory.CreatePosition(linePosition.Line, linePosition.Character); public static Range ToZeroWidthRange(this LinePosition position) - => VsLspFactory.CreateZeroWidthRange(position); + => LspFactory.CreateZeroWidthRange(position); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs index 270532bb5ab..84fbf51ceb8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs @@ -5,8 +5,8 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static Range ToRange(this LinePositionSpan linePositionSpan) - => VsLspFactory.CreateRange(linePositionSpan); + => LspFactory.CreateRange(linePositionSpan); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs index df93c93333f..e134672b0a9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static void Deconstruct(this Position position, out int line, out int character) => (line, character) = (position.Line, position.Character); @@ -14,7 +14,7 @@ public static LinePosition ToLinePosition(this Position position) => new(position.Line, position.Character); public static Range ToZeroWidthRange(this Position position) - => VsLspFactory.CreateZeroWidthRange(position); + => LspFactory.CreateZeroWidthRange(position); public static int CompareTo(this Position position, Position other) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs index ce405277933..7e2d82e730c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static void Deconstruct(this Range range, out Position start, out Position end) => (start, end) = (range.Start, range.End); @@ -77,7 +77,7 @@ public static bool IsSingleLine(this Range range) public static bool IsUndefined(this Range range) { - return range == VsLspFactory.UndefinedRange; + return range == LspFactory.UndefinedRange; } public static bool IsZeroWidth(this Range range) @@ -114,7 +114,7 @@ public static int CompareTo(this Range range1, Range range2) // Empty ranges do not overlap with any range. if (overlapStart.CompareTo(overlapEnd) < 0) { - return VsLspFactory.CreateRange(overlapStart, overlapEnd); + return LspFactory.CreateRange(overlapStart, overlapEnd); } return null; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs index 1bd0773e024..0316dfc4624 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static SyntaxNode? FindInnermostNode( this RazorSyntaxTree syntaxTree, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs index 0df608360b8..9122e5b2deb 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static int GetPosition(this SourceText text, Position position) => text.GetPosition(position.ToLinePosition()); @@ -46,5 +46,5 @@ public static TextChange GetTextChange(this SourceText text, TextEdit edit) => new(text.GetTextSpan(edit.Range), edit.NewText); public static TextEdit GetTextEdit(this SourceText text, TextChange change) - => VsLspFactory.CreateTextEdit(text.GetRange(change.Span), change.NewText.AssumeNotNull()); + => LspFactory.CreateTextEdit(text.GetRange(change.Span), change.NewText.AssumeNotNull()); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs index 6c75dd21d31..7da5906093f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { internal static int Count(this SumType[]> sumType) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs index 92c243bacb5..ad3dcf3e744 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs @@ -9,13 +9,13 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static Range GetRange(this SyntaxNode node, RazorSourceDocument source) { var linePositionSpan = node.GetLinePositionSpan(source); - return VsLspFactory.CreateRange(linePositionSpan); + return LspFactory.CreateRange(linePositionSpan); } public static Range? GetRangeWithoutWhitespace(this SyntaxNode node, RazorSourceDocument source) @@ -52,7 +52,7 @@ public static Range GetRange(this SyntaxNode node, RazorSourceDocument source) var startPositionSpan = GetLinePositionSpan(firstToken, source, node.SpanStart); var endPositionSpan = GetLinePositionSpan(lastToken, source, node.SpanStart); - return VsLspFactory.CreateRange(startPositionSpan.Start, endPositionSpan.End); + return LspFactory.CreateRange(startPositionSpan.Start, endPositionSpan.End); // This is needed because SyntaxToken positions taken from GetTokens // are relative to their parent node and not to the document. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs index 5feb06ba64f..36077f4b831 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static RazorTextChange ToRazorTextChange(this TextChange textChange) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs index 44017ad6256..9029bc33fdd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs @@ -3,7 +3,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static VSProjectContext? GetProjectContext(this TextDocumentIdentifier textDocumentIdentifier) => textDocumentIdentifier is VSTextDocumentIdentifier vsIdentifier diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs index ef801c03cec..f1e3a5e0373 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs @@ -3,7 +3,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { internal static VSInternalClientCapabilities ToVSInternalClientCapabilities(this ClientCapabilities clientCapabilities) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs index 959c14c116a..8bd3e97e1e4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { internal static ProjectKey ToProjectKey(this VSProjectContext projectContext) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs index 7c732521908..6178287c63e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static partial class VsLspExtensions +internal static partial class LspExtensions { public static bool TryGetDocumentChanges(this WorkspaceEdit workspaceEdit, [NotNullWhen(true)] out TextDocumentEdit[]? documentChanges) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs index 5b29d44cc60..182a0c45a79 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs @@ -6,7 +6,7 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; -internal static class VsLspFactory +internal static class LspFactory { private static readonly Position s_defaultPosition = new(0, 0); @@ -37,7 +37,7 @@ public static Position DefaultPosition Debug.Assert( defaultPosition.Line == 0 && defaultPosition.Character == 0, - $"{nameof(VsLspFactory)}.{nameof(DefaultPosition)} has been corrupted. Current value: {defaultPosition.ToDisplayString()}"); + $"{nameof(LspFactory)}.{nameof(DefaultPosition)} has been corrupted. Current value: {defaultPosition.ToDisplayString()}"); return defaultPosition; } @@ -59,7 +59,7 @@ public static Range DefaultRange defaultRange.Start.Character == 0 && defaultRange.End.Line == 0 && defaultRange.End.Character == 0, - $"{nameof(VsLspFactory)}.{nameof(DefaultRange)} has been corrupted. Current value: {defaultRange.ToDisplayString()}"); + $"{nameof(LspFactory)}.{nameof(DefaultRange)} has been corrupted. Current value: {defaultRange.ToDisplayString()}"); return defaultRange; } @@ -75,7 +75,7 @@ public static Position UndefinedPosition Debug.Assert( undefinedPosition.Line == -1 && undefinedPosition.Character == -1, - $"{nameof(VsLspFactory)}.{nameof(UndefinedPosition)} has been corrupted. Current value: {undefinedPosition.ToDisplayString()}"); + $"{nameof(LspFactory)}.{nameof(UndefinedPosition)} has been corrupted. Current value: {undefinedPosition.ToDisplayString()}"); return undefinedPosition; } @@ -93,7 +93,7 @@ public static Range UndefinedRange undefinedRange.Start.Character == -1 && undefinedRange.End.Line == -1 && undefinedRange.End.Character == -1, - $"{nameof(VsLspFactory)}.{nameof(UndefinedRange)} has been corrupted. Current value: {undefinedRange.ToDisplayString()}"); + $"{nameof(LspFactory)}.{nameof(UndefinedRange)} has been corrupted. Current value: {undefinedRange.ToDisplayString()}"); return undefinedRange; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs index c40741ebff5..d54f064a04a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs @@ -4,7 +4,7 @@ using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using static Roslyn.LanguageServer.Protocol.LspExtensions; using RoslynDocumentHighlight = Roslyn.LanguageServer.Protocol.DocumentHighlight; using VsDocumentHighlight = Microsoft.VisualStudio.LanguageServer.Protocol.DocumentHighlight; @@ -21,7 +21,7 @@ public static RemoteDocumentHighlight FromRoslynDocumentHighlight(RoslynDocument public static VsDocumentHighlight ToVsDocumentHighlight(RemoteDocumentHighlight highlight) => new() { - Range = VsLspExtensions.ToRange(highlight.Span), + Range = LspExtensions.ToRange(highlight.Span), Kind = highlight.Kind }; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs index 61252f6d011..f2d62ed9ed2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs @@ -14,8 +14,8 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using static Microsoft.VisualStudio.LanguageServer.Protocol.VsLspExtensions; -using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using static Microsoft.VisualStudio.LanguageServer.Protocol.LspExtensions; +using static Roslyn.LanguageServer.Protocol.LspExtensions; using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -80,7 +80,7 @@ private async ValueTask GetHighlightsAsync( { if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, highlight.Range.ToLinePositionSpan(), out var mappedRange)) { - highlight.Range = Roslyn.LanguageServer.Protocol.RoslynLspExtensions.ToRange(mappedRange); + highlight.Range = Roslyn.LanguageServer.Protocol.LspExtensions.ToRange(mappedRange); results.Add(RemoteDocumentHighlight.FromRoslynDocumentHighlight(highlight)); } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs index 1acfee411eb..030a6bec70c 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs @@ -17,8 +17,8 @@ using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using Microsoft.VisualStudio.Razor.Settings; -using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; -using RoslynLspFactory = Roslyn.LanguageServer.Protocol.RoslynLspFactory; +using static Roslyn.LanguageServer.Protocol.LspExtensions; +using LspFactory = Roslyn.LanguageServer.Protocol.LspFactory; using RoslynSignatureHelp = Roslyn.LanguageServer.Protocol.SignatureHelp; namespace Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; @@ -86,7 +86,7 @@ internal class CohostSignatureHelpEndpoint( var data = await _remoteServiceInvoker.TryInvokeAsync( razorDocument.Project.Solution, (service, solutionInfo, cancellationToken) => - service.GetSignatureHelpAsync(solutionInfo, razorDocument.Id, RoslynLspFactory.CreatePosition(request.Position.ToLinePosition()), cancellationToken), + service.GetSignatureHelpAsync(solutionInfo, razorDocument.Id, LspFactory.CreatePosition(request.Position.ToLinePosition()), cancellationToken), cancellationToken) .ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs index 84dd82b1dea..8025c56fb36 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs @@ -96,7 +96,7 @@ public DefaultRazorBreakpointResolver( return cachedRange; } - var position = VsLspFactory.CreatePosition(lineIndex, characterIndex); + var position = LspFactory.CreatePosition(lineIndex, characterIndex); var hostDocumentRange = await _breakpointSpanProvider.GetBreakpointSpanAsync(documentSnapshot, position, cancellationToken).ConfigureAwait(false); if (hostDocumentRange is null) { diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs index 1b129fef497..e271c871aea 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs @@ -95,7 +95,7 @@ public DefaultRazorProximityExpressionResolver( return cachedExpressions; } - var position = VsLspFactory.CreatePosition(lineIndex, characterIndex); + var position = LspFactory.CreatePosition(lineIndex, characterIndex); var proximityExpressions = await _proximityExpressionsProvider.GetProximityExpressionsAsync(documentSnapshot, position, cancellationToken).ConfigureAwait(false); // Cache range so if we're asked again for this document/line/character we don't have to go async. diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs index 6f86ccd57dd..329f5b82375 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs @@ -187,8 +187,8 @@ private static TextEdit BuildRevertedEdit(TextEdit provisionalTextEdit) if (range.Start == range.End) { // Insertion - revertedProvisionalTextEdit = VsLspFactory.CreateTextEdit( - range: VsLspFactory.CreateSingleLineRange( + revertedProvisionalTextEdit = LspFactory.CreateTextEdit( + range: LspFactory.CreateSingleLineRange( range.Start, length: range.End.Character + provisionalTextEdit.NewText.Length), newText: string.Empty); @@ -196,7 +196,7 @@ private static TextEdit BuildRevertedEdit(TextEdit provisionalTextEdit) else { // Replace - revertedProvisionalTextEdit = VsLspFactory.CreateTextEdit(range, string.Empty); + revertedProvisionalTextEdit = LspFactory.CreateTextEdit(range, string.Empty); } return revertedProvisionalTextEdit; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs index 7f7e31e9747..6ae6e6bdb80 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs @@ -31,7 +31,7 @@ public async Task Handle_SingleProvider_InvokesProvider() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -62,18 +62,18 @@ public async Task Handle_MultipleProviderSameTrigger_UsesSuccessful() var optionsMonitor = GetOptionsMonitor(); var insertProvider1 = new TestOnAutoInsertProvider(">", canResolve: false) { - ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) + ResolvedTextEdit = LspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var insertProvider2 = new TestOnAutoInsertProvider(">", canResolve: true) { - ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) + ResolvedTextEdit = LspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider1, insertProvider2], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -107,18 +107,18 @@ public async Task Handle_MultipleProviderSameTrigger_UsesFirstSuccessful() var optionsMonitor = GetOptionsMonitor(); var insertProvider1 = new TestOnAutoInsertProvider(">", canResolve: true) { - ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) + ResolvedTextEdit = LspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var insertProvider2 = new TestOnAutoInsertProvider(">", canResolve: true) { - ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) + ResolvedTextEdit = LspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider1, insertProvider2], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -155,7 +155,7 @@ public async Task Handle_NoApplicableProvider_CallsProviderAndReturnsNull() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -190,7 +190,7 @@ public async Task Handle_OnTypeFormattingOff_Html_CallsLanguageServer() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = "=", Options = new FormattingOptions { @@ -223,7 +223,7 @@ public async Task Handle_AutoInsertAttributeQuotesOff_Html_DoesNotCallLanguageSe var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = "=", Options = new FormattingOptions { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs index 57a48de76b4..4e71963389a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs @@ -31,7 +31,7 @@ public async Task Handle_MultipleProviderUnmatchingTrigger_ReturnsNull() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = "!", Options = new FormattingOptions { @@ -66,7 +66,7 @@ public async Task Handle_DocumentNotFound_ReturnsNull() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -101,7 +101,7 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, Character = ">", Options = new FormattingOptions { @@ -135,7 +135,7 @@ public async Task Handle_OnTypeFormattingOff_CSharp_ReturnsNull() var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, - Position = VsLspFactory.CreatePosition(1, 3), + Position = LspFactory.CreatePosition(1, 3), Character = "/", Options = new FormattingOptions { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs index 335e5df5f48..2d9ca497c73 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs @@ -52,7 +52,7 @@ public async Task ProvideAsync_ValidCodeActions_ReturnsProvidedCodeAction() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -83,7 +83,7 @@ public async Task ProvideAsync_SupportsCodeActionResolveFalse_ValidCodeActions_R var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -111,7 +111,7 @@ public async Task ProvideAsync_FunctionsBlock_SingleLine_ValidCodeActions_Return var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -144,7 +144,7 @@ public async Task ProvideAsync_FunctionsBlock_OpenBraceSameLine_ValidCodeActions var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -178,7 +178,7 @@ public async Task ProvideAsync_FunctionsBlock_OpenBraceNextLine_ValidCodeActions var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -209,7 +209,7 @@ public async Task ProvideAsync_InvalidCodeActions_ReturnsNoCodeActions() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -246,7 +246,7 @@ public async Task ProvideAsync_InvalidCodeActions_ShowAllFeatureFlagOn_ReturnsCo var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -292,7 +292,7 @@ public async Task ProvideAsync_ImplicitExpression_ReturnsProvidedCodeAction() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs index 6062be141b2..2dc1288ab2b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs @@ -33,13 +33,13 @@ public class DefaultCSharpCodeActionResolverTest(ITestOutputHelper testOutput) : DocumentChanges = new TextDocumentEdit[] { new() { - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "Generated C# Based Edit")] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), "Generated C# Based Edit")] } } } }; - private static readonly TextEdit[] s_defaultFormattedEdits = [VsLspFactory.CreateTextEdit(position: (0, 0), "Remapped & Formatted Edit")]; + private static readonly TextEdit[] s_defaultFormattedEdits = [LspFactory.CreateTextEdit(position: (0, 0), "Remapped & Formatted Edit")]; private static readonly CodeAction s_defaultUnresolvedCodeAction = new CodeAction() { @@ -105,11 +105,11 @@ public async Task ResolveAsync_MultipleDocumentChanges_ReturnsOriginalCodeAction { new TextDocumentEdit() { - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "1. Generated C# Based Edit")] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), "1. Generated C# Based Edit")] }, new TextDocumentEdit() { - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "2. Generated C# Based Edit")] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), "2. Generated C# Based Edit")] } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs index 7c3c0afff5d..4432a1bf83e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs @@ -34,7 +34,7 @@ public async Task Handle_MissingDiagnostics_ReturnsEmpty() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { // Even though the DTO declares this as non-null, we want to make sure we behave @@ -71,7 +71,7 @@ public async Task Handle_InvalidDiagnostics_VSCode_ReturnsEmpty() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = new Diagnostic[] { @@ -126,7 +126,7 @@ public async Task Handle_EmptyCodeActions_ReturnsEmpty() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = new Diagnostic[] { @@ -166,7 +166,7 @@ public async Task Handle_ValidDiagnostic_ValidCodeAction_VSCode_ReturnsCodeActio var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = new Diagnostic[] { @@ -179,7 +179,7 @@ public async Task Handle_ValidDiagnostic_ValidCodeAction_VSCode_ReturnsCodeActio { Severity = DiagnosticSeverity.Error, Code = errorCode, - Range = VsLspFactory.CreateRange(0, 8, 0, 12) + Range = LspFactory.CreateRange(0, 8, 0, 12) }, new Diagnostic() { @@ -242,7 +242,7 @@ public async Task Handle_CodeActionInSingleLineDirective_VS_ReturnsOnlyUsingCode var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = Array.Empty() @@ -294,7 +294,7 @@ public async Task Handle_ValidCodeAction_VS_ReturnsCodeActions() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = Array.Empty() @@ -352,7 +352,7 @@ public async Task Handle_ValidDiagnostic_MultipleValidCodeActions_VSCode_Returns var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() { Diagnostics = new Diagnostic[] { @@ -365,7 +365,7 @@ public async Task Handle_ValidDiagnostic_MultipleValidCodeActions_VSCode_Returns { Severity = DiagnosticSeverity.Error, Code = "CS0246", - Range = VsLspFactory.CreateRange(0, 8, 0, 12) + Range = LspFactory.CreateRange(0, 8, 0, 12) }, new Diagnostic() { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs index e5dc42a3fb7..76515aa9b92 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs @@ -72,7 +72,7 @@ public async Task Handle_NoDocument() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; @@ -108,7 +108,7 @@ public async Task Handle_UnsupportedDocument() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -142,7 +142,7 @@ public async Task Handle_NoProviders() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -179,7 +179,7 @@ public async Task Handle_OneRazorCodeActionProvider() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -219,7 +219,7 @@ public async Task Handle_OneCSharpCodeActionProvider() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -257,7 +257,7 @@ public async Task Handle_OneCodeActionProviderWithMultipleCodeActions() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -302,7 +302,7 @@ public async Task Handle_MultipleCodeActionProvidersWithMultipleCodeActions() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -347,7 +347,7 @@ public async Task Handle_MultipleProviders() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -385,7 +385,7 @@ public async Task Handle_OneNullReturningProvider() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -430,7 +430,7 @@ public async Task Handle_MultipleMixedProvider() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -470,7 +470,7 @@ public async Task Handle_MultipleMixedProvider_SupportsCodeActionResolveTrue() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -522,7 +522,7 @@ public async Task Handle_MixedProvider_SupportsCodeActionResolveTrue_UsesGroups( var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -574,7 +574,7 @@ public async Task Handle_MultipleMixedProvider_SupportsCodeActionResolveFalse() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; var requestContext = CreateRazorRequestContext(documentContext); @@ -619,8 +619,8 @@ public async Task GenerateRazorCodeActionContextAsync_WithSelectionRange() _supportsCodeActionResolve = false }; - var initialRange = VsLspFactory.CreateZeroWidthRange(0, 1); - var selectionRange = VsLspFactory.CreateZeroWidthRange(0, 5); + var initialRange = LspFactory.CreateZeroWidthRange(0, 1); + var selectionRange = LspFactory.CreateZeroWidthRange(0, 5); var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, @@ -661,7 +661,7 @@ public async Task GenerateRazorCodeActionContextAsync_WithoutSelectionRange() _supportsCodeActionResolve = false }; - var initialRange = VsLspFactory.CreateZeroWidthRange(0, 1); + var initialRange = LspFactory.CreateZeroWidthRange(0, 1); var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, @@ -706,7 +706,7 @@ public async Task GetCSharpCodeActionsFromLanguageServerAsync_InvalidRangeMappin _supportsCodeActionResolve = false }; - var initialRange = VsLspFactory.CreateZeroWidthRange(0, 1); + var initialRange = LspFactory.CreateZeroWidthRange(0, 1); var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, @@ -732,7 +732,7 @@ public async Task GetCSharpCodeActionsFromLanguageServerAsync_ReturnsCodeActions var documentPath = new Uri("C:/path/to/Page.razor"); var codeDocument = CreateCodeDocument("@code {}"); var documentContext = CreateDocumentContext(documentPath, codeDocument); - var projectedRange = VsLspFactory.CreateZeroWidthRange(15, 2); + var projectedRange = LspFactory.CreateZeroWidthRange(15, 2); var documentMappingService = CreateDocumentMappingService(projectedRange.ToLinePositionSpan()); var languageServer = CreateLanguageServer(); var codeActionEndpoint = new CodeActionEndpoint( @@ -750,7 +750,7 @@ public async Task GetCSharpCodeActionsFromLanguageServerAsync_ReturnsCodeActions _supportsCodeActionResolve = false }; - var initialRange = VsLspFactory.CreateZeroWidthRange(0, 1); + var initialRange = LspFactory.CreateZeroWidthRange(0, 1); var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = documentPath }, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs index 5104d53b0fa..8c21b56f374 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs @@ -34,7 +34,7 @@ public async Task ProvideAsync_WrapsResolvableCodeActions() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -67,7 +67,7 @@ public async Task ProvideAsync_RemapsAndFixesEdits() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -85,7 +85,7 @@ public async Task ProvideAsync_RemapsAndFixesEdits() Uri = new Uri(documentPath), Version = 1 }, - Edits = [VsLspFactory.CreateTextEdit(context.SourceText.GetRange(span), "Goo ~~~~~~~~~~~~~~~ Bar")] + Edits = [LspFactory.CreateTextEdit(context.SourceText.GetRange(span), "Goo ~~~~~~~~~~~~~~~ Bar")] } } }; @@ -112,7 +112,7 @@ public async Task ProvideAsync_RemapsAndFixesEdits() Uri = new Uri("c:/Test.razor.html"), Version = 1 }, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "Goo")] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), "Goo")] } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs index 5d7704aa426..2d7d9b67d38 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs @@ -46,7 +46,7 @@ public async Task ResolveAsync_RemapsAndFixesEdits() Uri = documentUri, Version = 1 }, - Edits = [VsLspFactory.CreateTextEdit(sourceText.GetRange(span), "Goo ~~~~~~~~~~~~~~~ Bar")] + Edits = [LspFactory.CreateTextEdit(sourceText.GetRange(span), "Goo ~~~~~~~~~~~~~~~ Bar")] } } }; @@ -77,7 +77,7 @@ public async Task ResolveAsync_RemapsAndFixesEdits() Uri = new Uri("c:/Test.razor.html"), Version = 1 }, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "Goo")] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), "Goo")] } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs index 7d4ca269ff6..cc0f250405f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs @@ -35,7 +35,7 @@ public async Task Handle_NoTagName_DoesNotProvideLightBulb() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), Context = new VSInternalCodeActionContext() }; @@ -64,7 +64,7 @@ public async Task Handle_InvalidSyntaxTree_NoStartNode() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -94,7 +94,7 @@ public async Task Handle_CursorOutsideComponent() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -123,7 +123,7 @@ public async Task Handle_ExistingComponent_SupportsFileCreationTrue_ReturnsResul var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -171,7 +171,7 @@ public async Task Handle_ExistingComponent_CaseIncorrect_ReturnsResults() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -221,7 +221,7 @@ @using Fully.Qualified var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -263,7 +263,7 @@ public async Task Handle_ExistingGenericComponent_SupportsFileCreationTrue_Retur var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -311,7 +311,7 @@ public async Task Handle_NewComponent_SupportsFileCreationTrue_ReturnsResult() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -342,7 +342,7 @@ public async Task Handle_NewComponent_CaretInAttribute_ReturnsResult() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -373,7 +373,7 @@ public async Task Handle_NewComponent_SupportsFileCreationFalse_ReturnsEmpty() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -402,7 +402,7 @@ public async Task Handle_ExistingComponent_SupportsFileCreationFalse_ReturnsResu var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs index a0995f885a9..61c8fb4efed 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs @@ -38,7 +38,7 @@ public async Task Handle_InvalidFileKind() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -69,7 +69,7 @@ public async Task Handle_OutsideCodeDirective() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -99,7 +99,7 @@ public async Task Handle_InCodeDirectiveBlock_ReturnsNull() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -129,7 +129,7 @@ public async Task Handle_InCodeDirectiveMalformed_ReturnsNull() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -164,7 +164,7 @@ void Test() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -205,7 +205,7 @@ public async Task Handle_InCodeDirective_SupportsFileCreationTrue_ReturnsResult( var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -248,7 +248,7 @@ public async Task Handle_AtEndOfCodeDirectiveWithNoSpace_ReturnsResult() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -285,7 +285,7 @@ public async Task Handle_InCodeDirective_SupportsFileCreationFalse_ReturnsNull() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -321,7 +321,7 @@ public async Task Handle_InFunctionsDirective_SupportsFileCreationTrue_ReturnsRe var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() }; @@ -358,7 +358,7 @@ public async Task Handle_NullRelativePath_ReturnsNull() var request = new VSCodeActionParams() { TextDocument = new VSTextDocumentIdentifier { Uri = new Uri(documentPath) }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = null! }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs index b39900715b0..a1f9ba82ff2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs @@ -52,8 +52,8 @@ public DelegatedCompletionItemResolverTest(ITestOutputHelper testOutput) }; var documentContext = TestDocumentContext.From("C:/path/to/file.cshtml", hostDocumentVersion: 0); - _csharpCompletionParams = new DelegatedCompletionParams(documentContext.Identifier, VsLspFactory.CreatePosition(10, 6), RazorLanguageKind.CSharp, new VSInternalCompletionContext(), ProvisionalTextEdit: null, ShouldIncludeSnippets: false, CorrelationId: Guid.Empty); - _htmlCompletionParams = new DelegatedCompletionParams(documentContext.Identifier, VsLspFactory.DefaultPosition, RazorLanguageKind.Html, new VSInternalCompletionContext(), ProvisionalTextEdit: null, ShouldIncludeSnippets: false, CorrelationId: Guid.Empty); + _csharpCompletionParams = new DelegatedCompletionParams(documentContext.Identifier, LspFactory.CreatePosition(10, 6), RazorLanguageKind.CSharp, new VSInternalCompletionContext(), ProvisionalTextEdit: null, ShouldIncludeSnippets: false, CorrelationId: Guid.Empty); + _htmlCompletionParams = new DelegatedCompletionParams(documentContext.Identifier, LspFactory.DefaultPosition, RazorLanguageKind.Html, new VSInternalCompletionContext(), ProvisionalTextEdit: null, ShouldIncludeSnippets: false, CorrelationId: Guid.Empty); _documentContextFactory = new TestDocumentContextFactory(); _formattingService = new AsyncLazy(() => TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory)); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs index cc82c40eb4d..d51767f48ad 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs @@ -71,7 +71,7 @@ await _provider.GetCompletionListAsync( var delegatedParameters = _provider.DelegatedParams; Assert.NotNull(delegatedParameters); Assert.Equal(RazorLanguageKind.Html, delegatedParameters.ProjectedKind); - Assert.Equal(VsLspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); + Assert.Equal(LspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); Assert.Equal(CompletionTriggerKind.Invoked, delegatedParameters.Context.TriggerKind); Assert.Equal(1337, delegatedParameters.Identifier.Version); Assert.Null(delegatedParameters.ProvisionalTextEdit); @@ -98,7 +98,7 @@ await _provider.GetCompletionListAsync( var delegatedParameters = _provider.DelegatedParams; Assert.NotNull(delegatedParameters); Assert.Equal(RazorLanguageKind.Html, delegatedParameters.ProjectedKind); - Assert.Equal(VsLspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); + Assert.Equal(LspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); Assert.Equal(CompletionTriggerKind.TriggerCharacter, delegatedParameters.Context.TriggerKind); Assert.Equal(VSInternalCompletionInvokeKind.Typing, delegatedParameters.Context.InvokeKind); Assert.Equal(1337, delegatedParameters.Identifier.Version); @@ -126,7 +126,7 @@ await _provider.GetCompletionListAsync( var delegatedParameters = _provider.DelegatedParams; Assert.NotNull(delegatedParameters); Assert.Equal(RazorLanguageKind.Html, delegatedParameters.ProjectedKind); - Assert.Equal(VsLspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); + Assert.Equal(LspFactory.CreatePosition(0, 1), delegatedParameters.ProjectedPosition); Assert.Equal(CompletionTriggerKind.Invoked, delegatedParameters.Context.TriggerKind); Assert.Equal(VSInternalCompletionInvokeKind.Typing, delegatedParameters.Context.InvokeKind); Assert.Equal(1337, delegatedParameters.Identifier.Version); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs index 38115319260..2696cfe185b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs @@ -19,7 +19,7 @@ public async Task RewriteAsync_NotCSharp_Noops() // Arrange var getCompletionsAt = 1; var documentContent = "<"; - var textEditRange = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 1); + var textEditRange = LspFactory.CreateSingleLineRange(start: (0, 0), length: 1); var delegatedCompletionList = GenerateCompletionList(textEditRange); // Act @@ -37,9 +37,9 @@ public async Task RewriteAsync_CSharp_AdjustsItemRange() var getCompletionsAt = 1; var documentContent = "@DateTime"; // Line 19: __o = DateTime - var textEditRange = VsLspFactory.CreateSingleLineRange(line: 19, character: 6, length: 8); + var textEditRange = LspFactory.CreateSingleLineRange(line: 19, character: 6, length: 8); var delegatedCompletionList = GenerateCompletionList(textEditRange); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 8); // Act var rewrittenCompletionList = await GetRewrittenCompletionListAsync( @@ -56,13 +56,13 @@ public async Task RewriteAsync_CSharp_AdjustsListRange() var getCompletionsAt = 1; var documentContent = "@DateTime"; // Line 19: __o = DateTime - var textEditRange = VsLspFactory.CreateSingleLineRange(line: 19, character: 6, length: 8); + var textEditRange = LspFactory.CreateSingleLineRange(line: 19, character: 6, length: 8); var delegatedCompletionList = GenerateCompletionList(textEditRange); delegatedCompletionList.ItemDefaults = new CompletionListItemDefaults() { EditRange = textEditRange, }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 8); // Act var rewrittenCompletionList = await GetRewrittenCompletionListAsync( @@ -79,7 +79,7 @@ private static VSInternalCompletionList GenerateCompletionList(Range textEditRan Items = [ new VSInternalCompletionItem() { - TextEdit = VsLspFactory.CreateTextEdit(textEditRange, "Hello") + TextEdit = LspFactory.CreateTextEdit(textEditRange, "Hello") } ] }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs index 4809ad880ae..f145c1ca53e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs @@ -28,7 +28,7 @@ public async Task Handle_NoDocumentContext_NoCompletionItems() { Uri = new Uri(documentPath) }, - Position = VsLspFactory.CreatePosition(0, 1), + Position = LspFactory.CreatePosition(0, 1), Context = new VSInternalCompletionContext(), }; var requestContext = CreateRazorRequestContext(documentContext: null); @@ -56,7 +56,7 @@ public async Task Handle_AutoShowCompletionDisabled_NoCompletionItems() { Uri = uri }, - Position = VsLspFactory.CreatePosition(0, 1), + Position = LspFactory.CreatePosition(0, 1), Context = new VSInternalCompletionContext() { InvokeKind = VSInternalCompletionInvokeKind.Typing }, }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs index bfae068bda8..d2c5921b3c9 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs @@ -39,7 +39,7 @@ public async Task Handle_UnsupportedDocument_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; codeDocument.SetUnsupported(); var requestContext = CreateRazorRequestContext(documentContext); @@ -64,9 +64,9 @@ public async Task Handle_StartsInHtml_BreakpointMoved() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -89,9 +89,9 @@ public async Task Handle_ImplicitExpression_StartsInHtml_BreakpointMoved() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -114,9 +114,9 @@ public async Task Handle_StartsInHtml_BreakpointMoved_Razor() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -139,9 +139,9 @@ public async Task Handle_ImplicitExpression_StartsInHtml_BreakpointMoved_Razor() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -165,7 +165,7 @@ public async Task Handle_StartsInHtml_InvalidBreakpointSpan_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -189,7 +189,7 @@ public async Task Handle_StartInHtml_NoCSharpOnLine_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -216,7 +216,7 @@ public async Task Handle_StartInHtml_NoActualCSharp_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = LspFactory.CreatePosition(1, 0) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -243,7 +243,7 @@ public async Task Handle_InvalidBreakpointSpan_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(2, 0) + Position = LspFactory.CreatePosition(2, 0) }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs index e8bfb086782..3cd6acb4f6b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs @@ -39,7 +39,7 @@ public async Task Handle_UnsupportedDocument_ReturnsNull() var request = new RazorProximityExpressionsParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), }; codeDocument.SetUnsupported(); var requestContext = CreateRazorRequestContext(documentContext); @@ -64,7 +64,7 @@ public async Task Handle_ReturnsValidExpressions() var request = new RazorProximityExpressionsParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 8), + Position = LspFactory.CreatePosition(1, 8), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -89,7 +89,7 @@ public async Task Handle_StartsInHtml_ReturnsValidExpressions() var request = new RazorProximityExpressionsParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -114,7 +114,7 @@ public async Task Handle_StartInHtml_NoCSharpOnLine_ReturnsNull() var request = new RazorProximityExpressionsParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -141,7 +141,7 @@ public async Task Handle_InvalidLocation_ReturnsNull() var request = new RazorProximityExpressionsParams() { Uri = documentPath, - Position = VsLspFactory.DefaultPosition, + Position = LspFactory.DefaultPosition, }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs index 4e670005541..0b40950b057 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs @@ -64,7 +64,7 @@ public void ConvertSpanToRange_ReturnsConvertedRange() // Arrange var sourceSpan = new SourceSpan(3, 0, 3, 4); var sourceText = SourceText.From("Hello World"); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 3, length: 4); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 3, length: 4); // Act var range = RazorDiagnosticConverter.ConvertSpanToRange(sourceSpan, sourceText); @@ -80,7 +80,7 @@ public void ConvertSpanToRange_StartsOutsideOfDocument_EmptyDocument_NormalizesT // Arrange var sourceText = SourceText.From(string.Empty); var sourceSpan = new SourceSpan(5, 0, 5, 4); - var expectedRange = VsLspFactory.DefaultRange; + var expectedRange = LspFactory.DefaultRange; // Act var range = RazorDiagnosticConverter.ConvertSpanToRange(sourceSpan, sourceText); @@ -96,7 +96,7 @@ public void ConvertSpanToRange_StartsOutsideOfDocument_NormalizesToEnd() // Arrange var sourceText = SourceText.From("Hello World"); var sourceSpan = new SourceSpan(sourceText.Length + 5, 0, sourceText.Length + 5, 4); - var expectedRange = VsLspFactory.CreateZeroWidthRange(0, 11); + var expectedRange = LspFactory.CreateZeroWidthRange(0, 11); // Act var range = RazorDiagnosticConverter.ConvertSpanToRange(sourceSpan, sourceText); @@ -112,7 +112,7 @@ public void ConvertSpanToRange_EndsOutsideOfDocument_NormalizesToEnd() // Arrange var sourceText = SourceText.From("Hello World"); var sourceSpan = new SourceSpan(6, 0, 6, 15); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 6, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 6, length: 5); // Act var range = RazorDiagnosticConverter.ConvertSpanToRange(sourceSpan, sourceText); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs index e5910df49ec..543e90e278b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs @@ -42,7 +42,7 @@ public class RazorDiagnosticsPublisherTest(ITestOutputHelper testOutput) : Langu Code = "TestCode", Severity = DiagnosticSeverity.Error, Message = "TestMessage", - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 0, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 0, length: 1) } ]; @@ -155,7 +155,7 @@ public async Task PublishDiagnosticsAsync_NewDocumentDiagnosticsGetPublished(boo Code = "TestCode", Severity = DiagnosticSeverity.Error, Message = "TestMessage", - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 0, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 0, length: 1) } }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs index f5af246e6e4..a2072787e14 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs @@ -51,7 +51,7 @@ public async Task Handle_Html_MakesRequest() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Text = "Hi there" }; var requestContext = CreateRazorRequestContext(documentContext); @@ -90,7 +90,7 @@ public async Task Handle_CSharp_DoesNotMakeRequest() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Text = "Hi there" }; var requestContext = CreateRazorRequestContext(documentContext); @@ -131,7 +131,7 @@ public async Task Handle_DocumentNotFound_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Text = "Hi there" }; var requestContext = CreateRazorRequestContext(documentContext); @@ -173,7 +173,7 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Text = "Hi there" }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs index 3e0c2fecef4..30df2ebf408 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs @@ -69,7 +69,7 @@ public async Task Handle_SimpleComponent_ReturnsResult() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [droppedUri] }; var requestContext = CreateRazorRequestContext(documentContext); @@ -127,7 +127,7 @@ public async Task Handle_SimpleComponentWithChildFile_ReturnsResult() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [ new Uri("file:///c:/path/MyTagHelper.razor.cs"), @@ -196,7 +196,7 @@ public async Task Handle_ComponentWithRequiredAttribute_ReturnsResult() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [droppedUri] }; var requestContext = CreateRazorRequestContext(documentContext); @@ -248,7 +248,7 @@ public async Task Handle_NoTypeNameIdentifier_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [droppedUri] }; var requestContext = CreateRazorRequestContext(documentContext); @@ -294,7 +294,7 @@ public async Task Handle_MultipleUris_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [ new Uri("file:///c:/path/SomeOtherFile.cs"), @@ -346,7 +346,7 @@ public async Task Handle_NotComponent_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [droppedUri] }; var requestContext = CreateRazorRequestContext(documentContext); @@ -404,7 +404,7 @@ public async Task Handle_ComponentWithNestedFiles_ReturnsResult() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1), Uris = [droppedUri1, droppedUri2] }; var requestContext = CreateRazorRequestContext(documentContext); @@ -453,7 +453,7 @@ public async Task Handle_CSharp_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -497,7 +497,7 @@ public async Task Handle_DocumentNotFound_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -542,7 +542,7 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -586,7 +586,7 @@ public async Task Handle_NoUris_ReturnsNull() { Uri = uri }, - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) + Range = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 1) }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs index baf947911fb..b80ba2f8b69 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs @@ -27,7 +27,7 @@ public void ApplyContentChanges_SingleChange() var sourceText = SourceText.From("Hello World"); var change = new TextDocumentContentChangeEvent() { - Range = VsLspFactory.CreateZeroWidthRange(0, 5), + Range = LspFactory.CreateZeroWidthRange(0, 5), RangeLength = 0, Text = "!" }; @@ -48,7 +48,7 @@ public void ApplyContentChanges_MultipleChanges() var changes = new[] { new TextDocumentContentChangeEvent() { - Range = VsLspFactory.CreateZeroWidthRange(0, 5), + Range = LspFactory.CreateZeroWidthRange(0, 5), RangeLength = 0, Text = Environment.NewLine }, @@ -57,7 +57,7 @@ public void ApplyContentChanges_MultipleChanges() new TextDocumentContentChangeEvent() { - Range = VsLspFactory.CreateZeroWidthRange(1, 0), + Range = LspFactory.CreateZeroWidthRange(1, 0), RangeLength = 0, Text = "!" }, @@ -66,7 +66,7 @@ public void ApplyContentChanges_MultipleChanges() new TextDocumentContentChangeEvent() { - Range = VsLspFactory.CreateZeroWidthRange(0, 1), + Range = LspFactory.CreateZeroWidthRange(0, 1), RangeLength = 4, Text = """ i! @@ -109,7 +109,7 @@ public async Task Handle_DidChangeTextDocument_UpdatesDocument() var endpoint = new DocumentDidChangeEndpoint(projectService.Object, LoggerFactory); var change = new TextDocumentContentChangeEvent() { - Range = VsLspFactory.CreateZeroWidthRange(0, 3), + Range = LspFactory.CreateZeroWidthRange(0, 3), RangeLength = 0, Text = "

" }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs index 0ba0f51c73c..1fdb5d79ae8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs @@ -62,7 +62,7 @@ public async Task Handle_OnTypeFormatting_DocumentNotFound_ReturnsNull() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, Character = ".", - Position = VsLspFactory.CreatePosition(2, 11), + Position = LspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 } }; var requestContext = CreateRazorRequestContext(documentContext); @@ -97,7 +97,7 @@ public async Task Handle_OnTypeFormatting_RemapFailed_ReturnsNull() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, Character = ".", - Position = VsLspFactory.CreatePosition(2, 11), + Position = LspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 }, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -133,7 +133,7 @@ public async Task Handle_OnTypeFormatting_HtmlLanguageKind_ReturnsNull() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, Character = "}", - Position = VsLspFactory.CreatePosition(2, 11), + Position = LspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 }, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -169,7 +169,7 @@ public async Task Handle_OnTypeFormatting_RazorLanguageKind_ReturnsNull() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, Character = "}", - Position = VsLspFactory.CreatePosition(2, 11), + Position = LspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 } }; var requestContext = CreateRazorRequestContext(documentContext); @@ -204,7 +204,7 @@ public async Task Handle_OnTypeFormatting_UnexpectedTriggerCharacter_ReturnsNull { TextDocument = new TextDocumentIdentifier { Uri = uri, }, Character = ".", - Position = VsLspFactory.CreatePosition(2, 11), + Position = LspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 } }; Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index 4e9160ab8b6..a463f8fbea6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -72,7 +72,7 @@ public class Foo { } using var context = CreateFormattingContext(source); var edits = new[] { - VsLspFactory.CreateTextEdit(2, 0, " ") + LspFactory.CreateTextEdit(2, 0, " ") }; var input = new FormattingResult(edits, RazorLanguageKind.Razor); var pass = GetPass(); @@ -96,7 +96,7 @@ public class Foo { } using var context = CreateFormattingContext(source); var edits = new[] { - VsLspFactory.CreateTextEdit(2, 0, 3, 0, " ") // Nukes a line + LspFactory.CreateTextEdit(2, 0, 3, 0, " ") // Nukes a line }; var input = new FormattingResult(edits, RazorLanguageKind.Razor); var pass = GetPass(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index ed17457db2a..7a36ce7ae5d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -28,7 +28,7 @@ public class Foo { } } "); using var context = CreateFormattingContext(source); - var badEdit = VsLspFactory.CreateTextEdit(position: (0, 0), "@ "); + var badEdit = LspFactory.CreateTextEdit(position: (0, 0), "@ "); var input = new FormattingResult([badEdit], RazorLanguageKind.CSharp); var pass = GetPass(); @@ -49,7 +49,7 @@ public class Foo { } } "); using var context = CreateFormattingContext(source); - var badEdit = VsLspFactory.CreateTextEdit(position: (0, 0), "@ "); + var badEdit = LspFactory.CreateTextEdit(position: (0, 0), "@ "); var input = new FormattingResult([badEdit], RazorLanguageKind.Html); var pass = GetPass(); @@ -72,7 +72,7 @@ public class Foo { } using var context = CreateFormattingContext(source); var edits = new[] { - VsLspFactory.CreateTextEdit(2, 0, " ") + LspFactory.CreateTextEdit(2, 0, " ") }; var input = new FormattingResult(edits, RazorLanguageKind.Razor); var pass = GetPass(); @@ -94,7 +94,7 @@ public class Foo { } } "); using var context = CreateFormattingContext(source); - var badEdit = VsLspFactory.CreateTextEdit(position: (0, 0), "@ "); // Creates a diagnostic + var badEdit = LspFactory.CreateTextEdit(position: (0, 0), "@ "); // Creates a diagnostic var input = new FormattingResult([badEdit], RazorLanguageKind.Razor); var pass = GetPass(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs index 5c77e198d46..daf60dbe6fd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs @@ -129,7 +129,7 @@ private async Task CallWebToolsApplyFormattedEd foreach (var textChange in response.TextChanges) { var span = new TextSpan(textChange.Position, textChange.Length); - var edit = VsLspFactory.CreateTextEdit(sourceText.GetRange(span), textChange.NewText); + var edit = LspFactory.CreateTextEdit(sourceText.GetRange(span), textChange.NewText); edits.Add(edit); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 9ec26d51add..8e3bef3a2e0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -208,7 +208,7 @@ protected async Task RunCodeActionFormattingTestAsync( } protected static TextEdit Edit(int startLine, int startChar, int endLine, int endChar, string newText) - => VsLspFactory.CreateTextEdit(startLine, startChar, endLine, endChar, newText); + => LspFactory.CreateTextEdit(startLine, startChar, endLine, endChar, newText); private static SourceText ApplyEdits(SourceText source, TextEdit[] edits) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs index 889ecd2cfaa..a61de35e8b0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs @@ -26,8 +26,8 @@ public class Foo{} var sourceText = SourceText.From(source); var edits = new[] { - VsLspFactory.CreateTextEdit(VsLspFactory.CreateSingleLineRange(line: 2, character: 13, length: 3), "Bar"), - VsLspFactory.CreateTextEdit(2, 0, " ") + LspFactory.CreateTextEdit(LspFactory.CreateSingleLineRange(line: 2, character: 13, length: 3), "Bar"), + LspFactory.CreateTextEdit(2, 0, " ") }; // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index 335945678d6..1c533c81c72 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -72,7 +72,7 @@ public async Task GetHoverInfo_TagHelper_Element() // Assert Assert.Contains("**Test1TagHelper**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -98,7 +98,7 @@ public async Task GetHoverInfo_TagHelper_Element_WithParent() // Assert Assert.Contains("**SomeChild**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 2, character: 5, length: 9); + var expectedRange = LspFactory.CreateSingleLineRange(line: 2, character: 5, length: 9); Assert.Equal(expectedRange, hover.Range); } @@ -148,7 +148,7 @@ public async Task GetHoverInfo_TagHelper_Element_EndTag() // Assert Assert.Contains("**Test1TagHelper**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -173,7 +173,7 @@ public async Task GetHoverInfo_TagHelper_Attribute() // Assert Assert.Contains("**BoolVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.DoesNotContain("**IntVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, hover.Range); } @@ -199,7 +199,7 @@ public async Task GetHoverInfo_TagHelper_AttributeTrailingEdge() // Assert Assert.Contains("**BoolVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.DoesNotContain("**IntVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, hover.Range); } @@ -290,7 +290,7 @@ public async Task GetHoverInfo_TagHelper_MinimizedAttribute() // Assert Assert.Contains("**BoolVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.DoesNotContain("**IntVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, hover.Range); } @@ -319,7 +319,7 @@ public void Increment(){ // Assert Assert.NotNull(hover); Assert.Contains("**Test**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 5, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -343,7 +343,7 @@ public async Task GetHoverInfo_TagHelper_MalformedElement() // Assert Assert.Contains("**Test1TagHelper**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -368,7 +368,7 @@ public async Task GetHoverInfo_TagHelper_MalformedAttribute() // Assert Assert.Contains("**BoolVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.DoesNotContain("**IntVal**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, hover.Range); } @@ -416,7 +416,7 @@ public async Task GetHoverInfo_TagHelper_PlainTextElement() // Assert Assert.Contains("Test1TagHelper", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -442,7 +442,7 @@ public async Task GetHoverInfo_TagHelper_PlainTextElement_EndTag() // Assert Assert.Contains("Test1TagHelper", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5); Assert.Equal(expectedRange, hover.Range); } @@ -467,7 +467,7 @@ public async Task GetHoverInfo_TagHelper_TextComponent() // Assert Assert.Contains("Text", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 1, length: 4); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 1, length: 4); Assert.Equal(expectedRange, hover.Range); } @@ -494,7 +494,7 @@ public async Task GetHoverInfo_TagHelper_TextComponent_NestedInHtml() // Assert Assert.Contains("Text", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 4); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 5, length: 4); Assert.Equal(expectedRange, hover.Range); } @@ -549,7 +549,7 @@ public async Task GetHoverInfo_TagHelper_TextComponent_NestedInCSharpAndText() // Assert Assert.Contains("Text", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 3, character: 9, length: 4); + var expectedRange = LspFactory.CreateSingleLineRange(line: 3, character: 9, length: 4); Assert.Equal(expectedRange, hover.Range); } @@ -576,7 +576,7 @@ public async Task GetHoverInfo_TagHelper_PlainTextAttribute() Assert.Contains("BoolVal", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.DoesNotContain("IntVal", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal); Assert.Equal(MarkupKind.PlainText, ((MarkupContent)hover.Contents).Kind); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, hover.Range); } @@ -650,7 +650,7 @@ public async Task GetHoverInfo_TagHelper_Element_VSClient_ReturnVSHover() // Assert Assert.False(vsHover.Contents.Value.TryGetFourth(out var _)); Assert.True(vsHover.Contents.Value.TryGetThird(out var _) && !vsHover.Contents.Value.Third.Any()); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5); Assert.Equal(expectedRange, vsHover.Range); var container = (ContainerElement)vsHover.RawContent; @@ -691,7 +691,7 @@ public async Task GetHoverInfo_TagHelper_Attribute_VSClient_ReturnVSHover() // Assert Assert.False(vsHover.Contents.Value.TryGetFourth(out var _)); Assert.True(vsHover.Contents.Value.TryGetThird(out var markedStrings) && !markedStrings.Any()); - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); + var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8); Assert.Equal(expectedRange, vsHover.Range); var container = (ContainerElement)vsHover.RawContent; @@ -749,7 +749,7 @@ public async Task Handle_Hover_SingleServer_CallsDelegatedLanguageServer() { Uri = new Uri("C:/text.razor") }, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), }; var documentContext = CreateDefaultDocumentContext(); var requestContext = CreateRazorRequestContext(documentContext: documentContext); @@ -780,7 +780,7 @@ public async Task Handle_Hover_SingleServer_CSharpVariable() // Assert var range = result.Range; - var expected = VsLspFactory.CreateSingleLineRange(line: 3, character: 8, length: 10); + var expected = LspFactory.CreateSingleLineRange(line: 3, character: 8, length: 10); Assert.Equal(expected, range); @@ -810,7 +810,7 @@ public async Task Handle_Hover_SingleServer_Component() // Assert var range = result.Range; - var expected = VsLspFactory.CreateSingleLineRange(line: 2, character: 1, length: 5); + var expected = LspFactory.CreateSingleLineRange(line: 2, character: 1, length: 5); Assert.Equal(expected, range); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs index 82b4e407c2d..b58e504a512 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs @@ -105,7 +105,7 @@ private async Task VerifyInlayHintsAsync(string input, Dictionary + Position = LspFactory.CreatePosition(1, 3) // }; var requestContext = CreateRazorRequestContext(documentContext: null); @@ -51,13 +51,13 @@ public async Task Handle_TagHelperStartTag_ReturnsCorrectRange() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 3) // + Position = LspFactory.CreatePosition(1, 3) // }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), - VsLspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), + LspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -84,13 +84,13 @@ public async Task Handle_TagHelperStartTag_ReturnsCorrectRange_EndSpan() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 6) // + Position = LspFactory.CreatePosition(1, 6) // }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), - VsLspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), + LspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -117,13 +117,13 @@ public async Task Handle_TagHelperEndTag_ReturnsCorrectRange() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 9) // + Position = LspFactory.CreatePosition(1, 9) // }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), - VsLspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), + LspFactory.CreateSingleLineRange(line: 1, character: 9, length: 5) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -150,7 +150,7 @@ public async Task Handle_NoTag_ReturnsNull() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(0, 1) // @[||]addTagHelper * + Position = LspFactory.CreatePosition(0, 1) // @[||]addTagHelper * }; var requestContext = CreateRazorRequestContext(documentContext); @@ -176,7 +176,7 @@ public async Task Handle_SelfClosingTagHelper_ReturnsNull() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 3) // + Position = LspFactory.CreatePosition(1, 3) // }; var requestContext = CreateRazorRequestContext(documentContext); @@ -202,13 +202,13 @@ public async Task Handle_NestedTagHelperStartTags_ReturnsCorrectRange() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 1) // <[||]test1> + Position = LspFactory.CreatePosition(1, 1) // <[||]test1> }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), - VsLspFactory.CreateSingleLineRange(line: 1, character: 24, length: 5) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5), + LspFactory.CreateSingleLineRange(line: 1, character: 24, length: 5) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -235,13 +235,13 @@ public async Task Handle_HTMLStartTag_ReturnsCorrectRange() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 3) // + Position = LspFactory.CreatePosition(1, 3) // }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 4), - VsLspFactory.CreateSingleLineRange(line: 1, character: 8, length: 4) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 4), + LspFactory.CreateSingleLineRange(line: 1, character: 8, length: 4) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -268,13 +268,13 @@ public async Task Handle_HTMLEndTag_ReturnsCorrectRange() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 8) // + Position = LspFactory.CreatePosition(1, 8) // }; var expectedRanges = new[] { - VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 4), - VsLspFactory.CreateSingleLineRange(line: 1, character: 8, length: 4) + LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 4), + LspFactory.CreateSingleLineRange(line: 1, character: 8, length: 4) }; var requestContext = CreateRazorRequestContext(documentContext); @@ -301,7 +301,7 @@ public async Task Handle_SelfClosingHTMLTag_ReturnsNull() var request = new LinkedEditingRangeParams { TextDocument = new TextDocumentIdentifier { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 3) // + Position = LspFactory.CreatePosition(1, 3) // }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs index 7f056bbde56..f788b4c06fd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs @@ -41,7 +41,7 @@ public async Task Handle_ResolvesLanguageRequest_Razor() var request = new RazorLanguageQueryParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(0, 1), + Position = LspFactory.CreatePosition(0, 1), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -68,7 +68,7 @@ public async Task Handle_ResolvesLanguageRequest_Html() var request = new RazorLanguageQueryParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(0, 2), + Position = LspFactory.CreatePosition(0, 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -98,7 +98,7 @@ public async Task Handle_ResolvesLanguageRequest_CSharp() var request = new RazorLanguageQueryParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(0, 1), + Position = LspFactory.CreatePosition(0, 1), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -129,7 +129,7 @@ public async Task Handle_Unsupported_ResolvesLanguageRequest_Html() var request = new RazorLanguageQueryParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(0, 1), + Position = LspFactory.CreatePosition(0, 1), }; var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs index 60cad5462b1..ed5683d7d7e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs @@ -48,10 +48,10 @@ public async Task Handle_MapToDocumentRanges_CSharp() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.CSharp, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(line: 0, character: 10, length: 12)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(line: 0, character: 10, length: 12)], RazorDocumentUri = documentPath, }; - var expectedRange = VsLspFactory.CreateSingleLineRange(line: 0, character: 4, length: 12); + var expectedRange = LspFactory.CreateSingleLineRange(line: 0, character: 4, length: 12); var requestContext = CreateRazorRequestContext(documentContext); @@ -82,7 +82,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_Unmapped() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.CSharp, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 3)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(start: (0, 0), length: 3)], RazorDocumentUri = documentPath, }; @@ -93,7 +93,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_Unmapped() // Assert Assert.NotNull(response); - Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); + Assert.Equal(LspFactory.UndefinedRange, response!.Ranges[0]); Assert.Equal(1337, response.HostDocumentVersion); } @@ -115,7 +115,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_LeadingOverlapsUnmapped() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.CSharp, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 22)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(start: (0, 0), length: 22)], RazorDocumentUri = documentPath, }; @@ -126,7 +126,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_LeadingOverlapsUnmapped() // Assert Assert.NotNull(response); - Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); + Assert.Equal(LspFactory.UndefinedRange, response!.Ranges[0]); Assert.Equal(1337, response.HostDocumentVersion); } @@ -148,7 +148,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_TrailingOverlapsUnmapped() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.CSharp, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(line: 0, character : 10, length: 13)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(line: 0, character : 10, length: 13)], RazorDocumentUri = documentPath, }; @@ -159,7 +159,7 @@ public async Task Handle_MapToDocumentRanges_CSharp_TrailingOverlapsUnmapped() // Assert Assert.NotNull(response); - Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); + Assert.Equal(LspFactory.UndefinedRange, response!.Ranges[0]); Assert.Equal(1337, response.HostDocumentVersion); } @@ -174,7 +174,7 @@ public async Task Handle_MapToDocumentRanges_Html() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.Html, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(line: 0, character: 16, length: 4)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(line: 0, character: 16, length: 4)], RazorDocumentUri = documentPath, }; @@ -200,7 +200,7 @@ public async Task Handle_MapToDocumentRanges_Razor() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.Razor, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(line: 0, character: 4, length: 1)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(line: 0, character: 4, length: 1)], RazorDocumentUri = documentPath, }; @@ -234,7 +234,7 @@ public async Task Handle_MapToDocumentRanges_Unsupported() var request = new RazorMapToDocumentRangesParams() { Kind = RazorLanguageKind.CSharp, - ProjectedRanges = [VsLspFactory.CreateSingleLineRange(line: 0, character: 10, length: 12)], + ProjectedRanges = [LspFactory.CreateSingleLineRange(line: 0, character: 10, length: 12)], RazorDocumentUri = documentPath, }; @@ -245,7 +245,7 @@ public async Task Handle_MapToDocumentRanges_Unsupported() // Assert Assert.NotNull(response); - Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); + Assert.Equal(LspFactory.UndefinedRange, response!.Ranges[0]); Assert.Equal(1337, response.HostDocumentVersion); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs index 98e5dc223d1..6e11b326a24 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs @@ -13,8 +13,8 @@ public class RangeExtensionsTests public void CompareTo_StartAndEndAreSame_ReturnsZero() { // Arrange - var range1 = VsLspFactory.CreateRange(1, 2, 3, 4); - var range2 = VsLspFactory.CreateRange(1, 2, 3, 4); + var range1 = LspFactory.CreateRange(1, 2, 3, 4); + var range2 = LspFactory.CreateRange(1, 2, 3, 4); // Act var result = range1.CompareTo(range2); @@ -27,8 +27,8 @@ public void CompareTo_StartAndEndAreSame_ReturnsZero() public void CompareTo_StartOfThisRangeIsBeforeOther_ReturnsNegative() { // Arrange - var range1 = VsLspFactory.CreateRange(1, 2, 3, 4); - var range2 = VsLspFactory.CreateRange(2, 2, 3, 4); + var range1 = LspFactory.CreateRange(1, 2, 3, 4); + var range2 = LspFactory.CreateRange(2, 2, 3, 4); // Act var result = range1.CompareTo(range2); @@ -41,8 +41,8 @@ public void CompareTo_StartOfThisRangeIsBeforeOther_ReturnsNegative() public void CompareTo_EndOfThisRangeIsBeforeOther_ReturnsNegative() { // Arrange - var range1 = VsLspFactory.CreateRange(1, 2, 3, 4); - var range2 = VsLspFactory.CreateRange(1, 2, 4, 4); + var range1 = LspFactory.CreateRange(1, 2, 3, 4); + var range2 = LspFactory.CreateRange(1, 2, 4, 4); // Act var result = range1.CompareTo(range2); @@ -55,8 +55,8 @@ public void CompareTo_EndOfThisRangeIsBeforeOther_ReturnsNegative() public void CompareTo_StartOfThisRangeIsAfterOther_ReturnsPositive() { // Arrange - var range1 = VsLspFactory.CreateRange(2, 2, 3, 4); - var range2 = VsLspFactory.CreateRange(1, 2, 3, 4); + var range1 = LspFactory.CreateRange(2, 2, 3, 4); + var range2 = LspFactory.CreateRange(1, 2, 3, 4); // Act var result = range1.CompareTo(range2); @@ -69,8 +69,8 @@ public void CompareTo_StartOfThisRangeIsAfterOther_ReturnsPositive() public void CompareTo_EndOfThisRangeIsAfterOther_ReturnsPositive() { // Arrange - var range1 = VsLspFactory.CreateRange(1, 2, 4, 4); - var range2 = VsLspFactory.CreateRange(1, 2, 3, 4); + var range1 = LspFactory.CreateRange(1, 2, 4, 4); + var range2 = LspFactory.CreateRange(1, 2, 3, 4); // Act var result = range1.CompareTo(range2); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 879c0bf5fbe..4ff2ec8d1f8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -117,7 +117,7 @@ public async Task Handle_Rename_FileManipulationNotSupported_ReturnsNull() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(2, 1), + Position = LspFactory.CreatePosition(2, 1), NewName = "Component5" }; @@ -140,7 +140,7 @@ public async Task Handle_Rename_WithNamespaceDirective() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(2, 1), + Position = LspFactory.CreatePosition(2, 1), NewName = "Component5" }; @@ -181,7 +181,7 @@ public async Task Handle_Rename_OnComponentParameter_ReturnsNull() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 14), + Position = LspFactory.CreatePosition(1, 14), NewName = "Test2" }; @@ -204,7 +204,7 @@ public async Task Handle_Rename_OnOpeningBrace_ReturnsNull() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), NewName = "Test2" }; @@ -227,7 +227,7 @@ public async Task Handle_Rename_OnComponentNameLeadingEdge_ReturnsResult() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 1), + Position = LspFactory.CreatePosition(1, 1), NewName = "Test2" }; @@ -250,7 +250,7 @@ public async Task Handle_Rename_OnComponentName_ReturnsResult() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 3), + Position = LspFactory.CreatePosition(1, 3), NewName = "Test2" }; @@ -273,7 +273,7 @@ public async Task Handle_Rename_OnComponentNameTrailingEdge_ReturnsResult() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 10), + Position = LspFactory.CreatePosition(1, 10), NewName = "Test2" }; @@ -296,7 +296,7 @@ public async Task Handle_Rename_ComponentInSameFile() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 1), + Position = LspFactory.CreatePosition(1, 1), NewName = "Component5" }; @@ -382,7 +382,7 @@ public async Task Handle_Rename_FullyQualifiedAndNot() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(2, 1), + Position = LspFactory.CreatePosition(2, 1), NewName = "Component5" }; @@ -428,7 +428,7 @@ public async Task Handle_Rename_MultipleFileUsages() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 1), + Position = LspFactory.CreatePosition(1, 1), NewName = "Component5" }; @@ -481,7 +481,7 @@ public async Task Handle_Rename_DifferentDirectories() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 1), + Position = LspFactory.CreatePosition(1, 1), NewName = "TestComponent" }; @@ -546,7 +546,7 @@ public async Task Handle_Rename_SingleServer_CallsDelegatedLanguageServer() var request = new RenameParams { TextDocument = new() { Uri = uri }, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), NewName = "Test2" }; @@ -580,7 +580,7 @@ public async Task Handle_Rename_SingleServer_DoesNotDelegateForRazor() var request = new RenameParams { TextDocument = new() { Uri = PathUtilities.GetUri(s_componentWithParamFilePath) }, - Position = VsLspFactory.CreatePosition(1, 0), + Position = LspFactory.CreatePosition(1, 0), NewName = "Test2" }; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs index fc85888a50b..4853d918edd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs @@ -44,7 +44,7 @@ public async Task Handle_Html_ReturnsResult() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 2), + Range = LspFactory.CreateSingleLineRange(start: (0, 0), length: 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -79,7 +79,7 @@ public async Task Handle_CSharp_ReturnsNull() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 2), + Range = LspFactory.CreateSingleLineRange(start: (0, 0), length: 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -114,7 +114,7 @@ public async Task Handle_CSharp_WholeImplicitStatement_ReturnsResult() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 8), + Range = LspFactory.CreateSingleLineRange(start: (0, 0), length: 8), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -149,7 +149,7 @@ public async Task Handle_CSharp_PartOfImplicitStatement_ReturnsNull() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(line: 0, character: 2, length: 2), + Range = LspFactory.CreateSingleLineRange(line: 0, character: 2, length: 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -184,7 +184,7 @@ public async Task Handle_CSharp_InImplicitStatement_ReturnsResult() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateZeroWidthRange(0, 4), + Range = LspFactory.CreateZeroWidthRange(0, 4), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -212,7 +212,7 @@ public async Task Handle_DocumentNotFound_ReturnsNull() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = missingUri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 2), + Range = LspFactory.CreateSingleLineRange(start: (0, 0), length: 2), }; var requestContext = CreateRazorRequestContext(documentContext: null); @@ -240,7 +240,7 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 2), + Range = LspFactory.CreateSingleLineRange(start: (0, 0), length: 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -274,10 +274,10 @@ public async Task CleanUpTextEdits_NoTilde() var computedEdits = new TextEdit[] { - VsLspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), - VsLspFactory.CreateTextEdit(line: 1, character: 0, " "), - VsLspFactory.CreateTextEdit( - range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), + LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), + LspFactory.CreateTextEdit(line: 1, character: 0, " "), + LspFactory.CreateTextEdit( + range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), newText: " }" + Environment.NewLine + "
"), }; @@ -313,11 +313,11 @@ public async Task CleanUpTextEdits_BadEditWithTilde() var computedEdits = new TextEdit[] { - VsLspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), - VsLspFactory.CreateTextEdit(line: 1, character: 0, " "), + LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), + LspFactory.CreateTextEdit(line: 1, character: 0, " "), // This is the problematic edit.. the close brace has been replaced with a tilde - VsLspFactory.CreateTextEdit( - range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), + LspFactory.CreateTextEdit( + range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), newText: " ~" + Environment.NewLine + "
") }; @@ -353,11 +353,11 @@ public async Task CleanUpTextEdits_GoodEditWithTilde() var computedEdits = new[] { - VsLspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), - VsLspFactory.CreateTextEdit(line: 1, character: 0, " "), + LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "), + LspFactory.CreateTextEdit(line: 1, character: 0, " "), // This looks like a bad edit, but the original source document had a tilde - VsLspFactory.CreateTextEdit( - range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), + LspFactory.CreateTextEdit( + range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1), newText: " ~" + Environment.NewLine + "
") }; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs index 981e8f7a8b9..0ca41897540 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs @@ -61,7 +61,7 @@ The end. { Uri = FileUri("File1.razor.g.html") }, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), htmlTag)] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), htmlTag)] } } }, @@ -125,7 +125,7 @@ This is a Razor document. { Uri = FileUri("File1.razor.g.html") }, - Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), htmlTag)] + Edits = [LspFactory.CreateTextEdit(position: (0, 0), htmlTag)] } } }, diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs index f52c195fd07..2011c5e7117 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs @@ -132,7 +132,7 @@ public async Task TryResolveBreakpointRangeAsync_MappableCSharpBreakpointLocatio { // Arrange var hostDocumentPosition = GetPosition(ValidBreakpointCSharp, _hostTextbuffer); - var hostBreakpointRange = VsLspFactory.CreateSingleLineRange(start: hostDocumentPosition, length: ValidBreakpointCSharp.Length); + var hostBreakpointRange = LspFactory.CreateSingleLineRange(start: hostDocumentPosition, length: ValidBreakpointCSharp.Length); var projectionProvider = new TestLSPBreakpointSpanProvider( _documentUri, new Dictionary() @@ -183,6 +183,6 @@ private static Position GetPosition(string content, ITextBuffer textBuffer) } var line = textBuffer.CurrentSnapshot.GetLineFromPosition(index); - return VsLspFactory.CreatePosition(line.LineNumber, index - line.Start.Position); + return LspFactory.CreatePosition(line.LineNumber, index - line.Start.Position); } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs index 0efc73d8dbf..742509d06af 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs @@ -47,7 +47,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer() var response = new RazorMapToDocumentRangesResponse() { - Ranges = [VsLspFactory.CreateRange(1, 1, 3, 3)], + Ranges = [LspFactory.CreateRange(1, 1, 3, 3)], HostDocumentVersion = 1 }; var requestInvoker = new Mock(MockBehavior.Strict); @@ -61,7 +61,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer() .ReturnsAsync(new ReinvocationResponse("TestLanguageClient", response)); var mappingProvider = new DefaultLSPDocumentMappingProvider(requestInvoker.Object, _documentManager); - var projectedRange = VsLspFactory.CreateRange(10, 10, 15, 15); + var projectedRange = LspFactory.CreateRange(10, 10, 15, 15); // Act var result = await mappingProvider.MapToDocumentRangesAsync(RazorLanguageKind.CSharp, uri, new[] { projectedRange }, DisposalToken); @@ -70,7 +70,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer() Assert.NotNull(result); Assert.Equal(1, result.HostDocumentVersion); var actualRange = result.Ranges[0]; - Assert.Equal(VsLspFactory.CreatePosition(1, 1), actualRange.Start); - Assert.Equal(VsLspFactory.CreatePosition(3, 3), actualRange.End); + Assert.Equal(LspFactory.CreatePosition(1, 1), actualRange.Start); + Assert.Equal(LspFactory.CreatePosition(3, 3), actualRange.End); } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs index 99132c4935c..419fa70db8a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs @@ -214,7 +214,7 @@ public async Task ProvideCodeActionsAsync_CannotLookupDocument_ReturnsNullAsync( { Uri = new Uri("C:/path/to/file.razor") }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() } }; @@ -295,7 +295,7 @@ async IAsyncEnumerable> { Uri = testDocUri }, - Range = VsLspFactory.DefaultRange, + Range = LspFactory.DefaultRange, Context = new VSInternalCodeActionContext() } }; @@ -420,7 +420,7 @@ public async Task ProvideSemanticTokensAsync_CannotLookupDocument_ReturnsNullAsy Uri = new Uri("C:/path/to/file.razor") }, requiredHostDocumentVersion: 1, - ranges: [VsLspFactory.DefaultRange], + ranges: [LspFactory.DefaultRange], correlationId: Guid.Empty); // Act @@ -469,7 +469,7 @@ public async Task ProvideSemanticTokensAsync_CannotLookupVirtualDocument_Returns Uri = new Uri("C:/path/to/file.razor") }, requiredHostDocumentVersion: 0, - ranges: [VsLspFactory.DefaultRange], + ranges: [LspFactory.DefaultRange], correlationId: Guid.Empty); // Act @@ -546,7 +546,7 @@ public async Task ProvideSemanticTokensAsync_ContainsRange_ReturnsSemanticTokens Uri = new Uri("C:/path/to%20-%20project/file.razor") }, requiredHostDocumentVersion: 0, - ranges: [VsLspFactory.DefaultRange], + ranges: [LspFactory.DefaultRange], correlationId: Guid.Empty); // Act @@ -624,7 +624,7 @@ public async Task ProvideSemanticTokensAsync_EmptyRange_ReturnsNoSemanticTokens( Uri = new Uri("C:/path/to%20-%20project/file.razor") }, requiredHostDocumentVersion: 0, - ranges: [VsLspFactory.DefaultRange], + ranges: [LspFactory.DefaultRange], correlationId: Guid.Empty); var expectedResults = new ProvideSemanticTokensResponse(null, documentVersion); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs index cae25378834..d2b8d278c79 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs @@ -64,7 +64,7 @@ public async Task MapSpans_WithinRange_ReturnsMapping() var textSnapshot = new StringTextSnapshot(s_mockGeneratedContent, 1); var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan); - var mappedRange = VsLspFactory.CreateSingleLineRange(2, character: 1, length: 10); + var mappedRange = LspFactory.CreateSingleLineRange(2, character: 1, length: 10); var documentMappingProvider = new Mock(MockBehavior.Strict); var mappingResult = new RazorMapToDocumentRangesResponse() @@ -138,7 +138,7 @@ public void MapSpans_GetMappedSpanResults_MappingErrorReturnsDefaultMappedSpan() { // Arrange var sourceTextRazor = SourceText.From(""); - var response = new RazorMapToDocumentRangesResponse { Ranges = new Range[] { VsLspFactory.UndefinedRange } }; + var response = new RazorMapToDocumentRangesResponse { Ranges = new Range[] { LspFactory.UndefinedRange } }; // Act var results = RazorLSPSpanMappingService.GetMappedSpanResults(_mockDocumentUri.LocalPath, sourceTextRazor, response); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs index 9637feecd45..9c3a2717d15 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs @@ -73,7 +73,7 @@ private void UpdateCSharpServerDocument(IReadOnlyList changes, Virt var rangesAndTexts = changes.Select(c => { GetLinesAndOffsets(virtualSourceText, c.OldSpan, out var startLine, out var startCharacter, out var endLine, out var endCharacter); - var range = VsLspFactory.CreateRange(startLine, startCharacter, endLine, endCharacter); + var range = LspFactory.CreateRange(startLine, startCharacter, endLine, endCharacter); return (range, c.NewText); }).ToArray(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs index 4dd8aa8e590..45058bebe8d 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs @@ -69,7 +69,7 @@ public void ValidateBreakpointLocation_NullBreakpointRange_ReturnsEFail() public void ValidateBreakpointLocation_ValidBreakpointRange_ReturnsSOK() { // Arrange - var breakpointRange = VsLspFactory.CreateRange(2, 4, 3, 5); + var breakpointRange = LspFactory.CreateRange(2, 4, 3, 5); var breakpointResolver = Mock.Of(resolver => resolver.TryResolveBreakpointRangeAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(breakpointRange), MockBehavior.Strict); var languageService = CreateLanguageServiceWith(breakpointResolver); From 27c038c1e399bd4297d7787d9cdc37b278ff3768 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 11:31:54 +1000 Subject: [PATCH 004/223] Change all Range aliases to LspRange aliases This is to make things easier in future, as we'll be getting a global using for all protocol types --- .../LanguageServer/RazorCodeActionsBenchmark.cs | 8 ++++---- .../LanguageServer/RazorDiagnosticsBenchmark.cs | 14 +++++++------- .../LanguageServer/RazorSemanticTokensBenchmark.cs | 4 ++-- .../RazorSemanticTokensRangeEndpointBenchmark.cs | 4 ++-- .../RazorSemanticTokensScrollingBenchmark.cs | 4 ++-- .../Definition/DefinitionEndpoint.cs | 6 +++--- .../Diagnostics/RazorDiagnosticConverter.cs | 4 ++-- .../RazorTranslateDiagnosticsService.cs | 6 +++--- .../Formatting/CSharpFormatter.cs | 6 +++--- .../Formatting/CSharpFormattingPassBase.cs | 4 ++-- .../Formatting/CSharpOnTypeFormattingPass.cs | 8 ++++---- .../Formatting/RazorFormattingService.cs | 4 ++-- .../Hover/HoverService.cs | 6 +++--- .../Mapping/RazorMapToDocumentRangesEndpoint.cs | 4 ++-- .../Services/LSPCSharpSemanticTokensProvider.cs | 4 ++-- .../IRazorDocumentMappingServiceExtensions.cs | 10 +++++----- .../RazorMapToDocumentRangesParams.cs | 4 ++-- .../ProvideSemanticTokensRangesParams.cs | 6 +++--- .../Debugging/RazorBreakpointResolver.cs | 4 ++-- .../Debugging/DefaultLSPBreakpointSpanProvider.cs | 4 ++-- .../Debugging/DefaultRazorBreakpointResolver.cs | 8 ++++---- .../DefaultLSPDocumentMappingProvider.cs | 4 ++-- .../DocumentMapping/LSPDocumentMappingProvider.cs | 4 ++-- .../ValidateBreakpointRangeEndpointTest.cs | 4 ++-- .../FormattingLanguageServerTestBase.cs | 4 ++-- ...elegatingEndpointTestBase.TestLanguageServer.cs | 6 +++--- .../LanguageServer/CSharpTestLspServer.cs | 6 +++--- .../DefaultRazorBreakpointResolverTest.cs | 4 ++-- .../Debugging/TestLSPBreakpointSpanProvider.cs | 12 ++++++------ .../RazorLSPSpanMappingServiceTest.cs | 12 ++++++------ 30 files changed, 89 insertions(+), 89 deletions(-) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs index 8f8a680ae8f..2f76d296831 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs @@ -20,7 +20,7 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; @@ -31,9 +31,9 @@ public class RazorCodeActionsBenchmark : RazorLanguageServerBenchmarkBase private CodeActionEndpoint? CodeActionEndpoint { get; set; } private IDocumentSnapshot? DocumentSnapshot { get; set; } private SourceText? DocumentText { get; set; } - private Range? RazorCodeActionRange { get; set; } - private Range? CSharpCodeActionRange { get; set; } - private Range? HtmlCodeActionRange { get; set; } + private LspRange? RazorCodeActionRange { get; set; } + private LspRange? CSharpCodeActionRange { get; set; } + private LspRange? HtmlCodeActionRange { get; set; } private RazorRequestContext RazorRequestContext { get; set; } public enum FileTypes diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs index f1878b7f567..24444f16bdf 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs @@ -22,7 +22,7 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; @@ -119,27 +119,27 @@ private IRazorDocumentMappingService BuildRazorDocumentMappingService() { var razorDocumentMappingService = new Mock(MockBehavior.Strict); - Range? hostDocumentRange; + LspRange? hostDocumentRange; razorDocumentMappingService.Setup( r => r.TryMapToHostDocumentRange( It.IsAny(), InRange, It.IsAny(), out hostDocumentRange)) - .Returns((IRazorGeneratedDocument generatedDocument, Range range, MappingBehavior mappingBehavior, out Range? actualOutRange) => + .Returns((IRazorGeneratedDocument generatedDocument, LspRange range, MappingBehavior mappingBehavior, out LspRange? actualOutRange) => { actualOutRange = OutRange; return true; }); - Range? hostDocumentRange2; + LspRange? hostDocumentRange2; razorDocumentMappingService.Setup( r => r.TryMapToHostDocumentRange( It.IsAny(), It.IsNotIn(InRange), It.IsAny(), out hostDocumentRange2)) - .Returns((IRazorGeneratedDocument generatedDocument, Range range, MappingBehavior mappingBehavior, out Range? actualOutRange) => + .Returns((IRazorGeneratedDocument generatedDocument, LspRange range, MappingBehavior mappingBehavior, out LspRange? actualOutRange) => { actualOutRange = null; return false; @@ -207,8 +207,8 @@ public Task SendRequestAsync(string method, TPara } } - private Range InRange { get; set; } = LspFactory.CreateSingleLineRange(line: 85, character: 8, length: 8); - private Range OutRange { get; set; } = LspFactory.CreateSingleLineRange(line: 6, character: 8, length: 8); + private LspRange InRange { get; set; } = LspFactory.CreateSingleLineRange(line: 85, character: 8, length: 8); + private LspRange OutRange { get; set; } = LspFactory.CreateSingleLineRange(line: 6, character: 8, length: 8); private Diagnostic[] GetDiagnostics(int n) => Enumerable.Range(1, n).Select(_ => new Diagnostic() { diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs index 2c5dd603ac1..fa61204cb93 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs @@ -20,7 +20,7 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; @@ -36,7 +36,7 @@ public class RazorSemanticTokensBenchmark : RazorLanguageServerBenchmarkBase private VersionedDocumentContext DocumentContext { get; set; } - private Range Range { get; set; } + private LspRange Range { get; set; } private string PagesDirectory { get; set; } diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs index 4f30af12f11..a30a3828c86 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs @@ -22,7 +22,7 @@ using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; @@ -40,7 +40,7 @@ public class RazorSemanticTokensRangeEndpointBenchmark : RazorLanguageServerBenc private VersionedDocumentContext DocumentContext { get; set; } - private Range Range { get; set; } + private LspRange Range { get; set; } private string PagesDirectory { get; set; } diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs index f08d37cbf34..be37d59ac3c 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs @@ -15,7 +15,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.VisualStudio.LanguageServer.Protocol; using static Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer.RazorSemanticTokensBenchmark; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; @@ -31,7 +31,7 @@ public class RazorSemanticTokensScrollingBenchmark : RazorLanguageServerBenchmar private IDocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot; - private Range Range { get; set; } + private LspRange Range { get; set; } private string PagesDirectory { get; set; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index c772aff6175..41ef8c1ecf2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -22,7 +22,7 @@ Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxKind = Microsoft.AspNetCore.Razor.Language.SyntaxKind; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; @@ -245,7 +245,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V }; } - private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapshot, BoundAttributeDescriptor? attributeDescriptor, CancellationToken cancellationToken) + private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapshot, BoundAttributeDescriptor? attributeDescriptor, CancellationToken cancellationToken) { if (attributeDescriptor is not null) { @@ -267,7 +267,7 @@ private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapsh return LspFactory.DefaultRange; } - internal static async Task TryGetPropertyRangeAsync(RazorCodeDocument codeDocument, string propertyName, IRazorDocumentMappingService documentMappingService, ILogger logger, CancellationToken cancellationToken) + internal static async Task TryGetPropertyRangeAsync(RazorCodeDocument codeDocument, string propertyName, IRazorDocumentMappingService documentMappingService, ILogger logger, CancellationToken cancellationToken) { // Parse the C# file and find the property that matches the name. // We don't worry about parameter attributes here for two main reasons: diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs index 1ee9556ff92..ce6dd366ab9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs @@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; @@ -71,7 +71,7 @@ internal static DiagnosticSeverity ConvertSeverity(RazorDiagnosticSeverity sever } // Internal for testing - internal static Range? ConvertSpanToRange(SourceSpan sourceSpan, SourceText sourceText) + internal static LspRange? ConvertSpanToRange(SourceSpan sourceSpan, SourceText sourceText) { if (sourceSpan == SourceSpan.Undefined) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs index 7107ff409a0..bb851658894 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs @@ -19,7 +19,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol; using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; using DiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; @@ -446,7 +446,7 @@ internal virtual bool CheckIfDocumentHasRazorDiagnostic(RazorCodeDocument codeDo return codeDocument.GetSyntaxTree().Diagnostics.Any(d => d.Id.Equals(razorDiagnosticCode, StringComparison.Ordinal)); } - private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocument codeDocument, SourceText sourceText, [NotNullWhen(true)] out Range? originalRange) + private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocument codeDocument, SourceText sourceText, [NotNullWhen(true)] out LspRange? originalRange) { if (IsRudeEditDiagnostic(diagnostic)) { @@ -487,7 +487,7 @@ private static bool IsRudeEditDiagnostic(Diagnostic diagnostic) str.StartsWith("ENC"); } - private bool TryRemapRudeEditRange(Range diagnosticRange, RazorCodeDocument codeDocument, SourceText sourceText, [NotNullWhen(true)] out Range? remappedRange) + private bool TryRemapRudeEditRange(LspRange diagnosticRange, RazorCodeDocument codeDocument, SourceText sourceText, [NotNullWhen(true)] out LspRange? remappedRange) { // This is a rude edit diagnostic that has already been mapped to the Razor document. The mapping isn't absolutely correct though, // it's based on the runtime code generation of the Razor document therefore we need to re-map the already mapped diagnostic in a diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs index 47089246f24..88b790cac64 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs @@ -15,7 +15,7 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -25,7 +25,7 @@ internal sealed class CSharpFormatter(IRazorDocumentMappingService documentMappi private readonly IRazorDocumentMappingService _documentMappingService = documentMappingService; - public async Task FormatAsync(FormattingContext context, Range rangeToFormat, CancellationToken cancellationToken) + public async Task FormatAsync(FormattingContext context, LspRange rangeToFormat, CancellationToken cancellationToken) { if (context is null) { @@ -77,7 +77,7 @@ private TextEdit[] MapEditsToHostDocument(RazorCodeDocument codeDocument, TextEd return actualEdits; } - private static async Task GetFormattingEditsAsync(FormattingContext context, Range projectedRange, CancellationToken cancellationToken) + private static async Task GetFormattingEditsAsync(FormattingContext context, LspRange projectedRange, CancellationToken cancellationToken) { var csharpSourceText = context.CodeDocument.GetCSharpSourceText(); var spanToFormat = csharpSourceText.GetTextSpan(projectedRange); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs index ab97332f801..098e56d3a77 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs @@ -14,7 +14,7 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -30,7 +30,7 @@ protected CSharpFormattingPassBase(IRazorDocumentMappingService documentMappingS public override bool IsValidationPass => false; - protected async Task> AdjustIndentationAsync(FormattingContext context, CancellationToken cancellationToken, Range? range = null) + protected async Task> AdjustIndentationAsync(FormattingContext context, CancellationToken cancellationToken, LspRange? range = null) { // In this method, the goal is to make final adjustments to the indentation of each line. // We will take into account the following, diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs index 029d4abade1..2c2d6677dae 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs @@ -20,7 +20,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -280,7 +280,7 @@ private static int LineDelta(SourceText text, IEnumerable changes, o return delta; } - private static List CleanupDocument(FormattingContext context, Range? range = null) + private static List CleanupDocument(FormattingContext context, LspRange? range = null) { var text = context.SourceText; range ??= text.GetRange(TextSpan.FromBounds(0, text.Length)); @@ -305,7 +305,7 @@ private static List CleanupDocument(FormattingContext context, Range return changes; } - private static void CleanupSourceMappingStart(FormattingContext context, Range sourceMappingRange, List changes, out bool newLineAdded) + private static void CleanupSourceMappingStart(FormattingContext context, LspRange sourceMappingRange, List changes, out bool newLineAdded) { newLineAdded = false; @@ -428,7 +428,7 @@ private static string PrependLines(string text, string newLine, int count) return builder.ToString(); } - private static void CleanupSourceMappingEnd(FormattingContext context, Range sourceMappingRange, List changes, bool newLineWasAddedAtStart) + private static void CleanupSourceMappingEnd(FormattingContext context, LspRange sourceMappingRange, List changes, bool newLineWasAddedAtStart) { // // We look through every source mapping that intersects with the affected range and diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs index 007250d2bdd..89f49f0bf5e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs @@ -13,7 +13,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -37,7 +37,7 @@ public RazorFormattingService( public async Task FormatAsync( VersionedDocumentContext documentContext, - Range? range, + LspRange? range, FormattingOptions options, CancellationToken cancellationToken) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs index fe063b11312..218e474e2a2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs @@ -20,7 +20,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Adornments; using MarkupKind = Microsoft.VisualStudio.LanguageServer.Protocol.MarkupKind; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; @@ -249,7 +249,7 @@ internal sealed partial class HoverService( return null; } - private VSInternalHover? AttributeInfoToHover(ImmutableArray boundAttributes, Range range, string attributeName, VSInternalClientCapabilities clientCapabilities) + private VSInternalHover? AttributeInfoToHover(ImmutableArray boundAttributes, LspRange range, string attributeName, VSInternalClientCapabilities clientCapabilities) { var descriptionInfos = boundAttributes.SelectAsArray(boundAttribute => { @@ -296,7 +296,7 @@ internal sealed partial class HoverService( } } - private async Task ElementInfoToHoverAsync(string documentFilePath, IEnumerable descriptors, Range range, VSInternalClientCapabilities clientCapabilities, CancellationToken cancellationToken) + private async Task ElementInfoToHoverAsync(string documentFilePath, IEnumerable descriptors, LspRange range, VSInternalClientCapabilities clientCapabilities, CancellationToken cancellationToken) { var descriptionInfos = descriptors.SelectAsArray(BoundElementDescriptionInfo.From); var elementDescriptionInfo = new AggregateBoundElementDescription(descriptionInfos); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs index 3bd789f83bb..1ab59705e3f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs @@ -11,7 +11,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Mapping; @@ -58,7 +58,7 @@ public Uri GetTextDocumentIdentifier(RazorMapToDocumentRangesParams request) } var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var ranges = new Range[request.ProjectedRanges.Length]; + var ranges = new LspRange[request.ProjectedRanges.Length]; for (var i = 0; i < request.ProjectedRanges.Length; i++) { var projectedRange = request.ProjectedRanges[i]; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs index 641c91c7b92..f507b9104a0 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs @@ -15,7 +15,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; @@ -33,7 +33,7 @@ internal class LSPCSharpSemanticTokensProvider(LanguageServerFeatureOptions lang { var documentVersion = documentContext.Version; - using var _ = ListPool.GetPooledObject(out var csharpRangeList); + using var _ = ListPool.GetPooledObject(out var csharpRangeList); foreach (var span in csharpSpans) { csharpRangeList.Add(span.ToRange()); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs index 0fdc80e24b4..13d96a0790e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs @@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; @@ -19,7 +19,7 @@ internal static class IRazorDocumentMappingServiceExtensions public static bool TryMapToHostDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, LinePositionSpan projectedRange, out LinePositionSpan originalRange) => service.TryMapToHostDocumentRange(generatedDocument, projectedRange, MappingBehavior.Strict, out originalRange); - public static bool TryMapToHostDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, Range projectedRange, [NotNullWhen(true)] out Range? originalRange) + public static bool TryMapToHostDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, LspRange projectedRange, [NotNullWhen(true)] out LspRange? originalRange) => service.TryMapToHostDocumentRange(generatedDocument, projectedRange, MappingBehavior.Strict, out originalRange); public static async Task GetPositionInfoAsync(this IRazorDocumentMappingService service, DocumentContext documentContext, int hostDocumentIndex, CancellationToken cancellationToken) @@ -62,14 +62,14 @@ public static DocumentPositionInfo GetPositionInfo( return new DocumentPositionInfo(languageKind, position, hostDocumentIndex); } - public static bool TryMapToHostDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, Range generatedDocumentRange, MappingBehavior mappingBehavior, [NotNullWhen(true)] out Range? hostDocumentRange) + public static bool TryMapToHostDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, LspRange generatedDocumentRange, MappingBehavior mappingBehavior, [NotNullWhen(true)] out LspRange? hostDocumentRange) { var result = service.TryMapToHostDocumentRange(generatedDocument, generatedDocumentRange.ToLinePositionSpan(), mappingBehavior, out var hostDocumentLinePositionSpan); hostDocumentRange = result ? hostDocumentLinePositionSpan.ToRange() : null; return result; } - public static bool TryMapToGeneratedDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, Range hostDocumentRange, [NotNullWhen(true)] out Range? generatedDocumentRange) + public static bool TryMapToGeneratedDocumentRange(this IRazorDocumentMappingService service, IRazorGeneratedDocument generatedDocument, LspRange hostDocumentRange, [NotNullWhen(true)] out LspRange? generatedDocumentRange) { var result = service.TryMapToGeneratedDocumentRange(generatedDocument, hostDocumentRange.ToLinePositionSpan(), out var generatedDocumentLinePositionSpan); generatedDocumentRange = result ? generatedDocumentLinePositionSpan.ToRange() : null; @@ -102,7 +102,7 @@ public static bool TryMapToGeneratedDocumentOrNextCSharpPosition(this IRazorDocu /// generated document. If the uri passed in is not for a generated document, or the range cannot be mapped /// for some other reason, the original passed in range is returned unchanged. /// - public static async Task<(Uri MappedDocumentUri, Range MappedRange)> MapToHostDocumentUriAndRangeAsync(this IRazorDocumentMappingService service, Uri generatedDocumentUri, Range generatedDocumentRange, CancellationToken cancellationToken) + public static async Task<(Uri MappedDocumentUri, LspRange MappedRange)> MapToHostDocumentUriAndRangeAsync(this IRazorDocumentMappingService service, Uri generatedDocumentUri, LspRange generatedDocumentRange, CancellationToken cancellationToken) { var result = await service.MapToHostDocumentUriAndRangeAsync(generatedDocumentUri, generatedDocumentRange.ToLinePositionSpan(), cancellationToken).ConfigureAwait(false); return (result.MappedDocumentUri, result.MappedRange.ToRange()); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs index cd9b57edc84..d9bc9acc59c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs @@ -4,7 +4,7 @@ using System; using System.Text.Json.Serialization; using Microsoft.CodeAnalysis.Razor.DocumentMapping; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; @@ -17,7 +17,7 @@ internal class RazorMapToDocumentRangesParams public required Uri RazorDocumentUri { get; init; } [JsonPropertyName("projectedRanges")] - public required Range[] ProjectedRanges { get; init; } + public required LspRange[] ProjectedRanges { get; init; } [JsonPropertyName("mappingBehavior")] public MappingBehavior MappingBehavior { get; init; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs index 73e62bf91db..4a47066f3b8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs @@ -4,7 +4,7 @@ using System; using System.Text.Json.Serialization; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; @@ -14,12 +14,12 @@ internal class ProvideSemanticTokensRangesParams : SemanticTokensParams public long RequiredHostDocumentVersion { get; } [JsonPropertyName("ranges")] - public Range[] Ranges { get; } + public LspRange[] Ranges { get; } [JsonPropertyName("correlationId")] public Guid CorrelationId { get; } - public ProvideSemanticTokensRangesParams(TextDocumentIdentifier textDocument, long requiredHostDocumentVersion, Range[] ranges, Guid correlationId) + public ProvideSemanticTokensRangesParams(TextDocumentIdentifier textDocument, long requiredHostDocumentVersion, LspRange[] ranges, Guid correlationId) { TextDocument = textDocument; RequiredHostDocumentVersion = requiredHostDocumentVersion; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs index a9dfe15d5bc..b3f61e9e008 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs @@ -4,11 +4,11 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.Text; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.Debugging; internal abstract class RazorBreakpointResolver { - public abstract Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); + public abstract Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs index ee9438b506f..0e8a266c328 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs @@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; @@ -29,7 +29,7 @@ public DefaultLSPBreakpointSpanProvider( _logger = loggerFactory.GetOrCreateLogger(); } - public async override Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public async override Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) { if (documentSnapshot is null) { diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs index 8025c56fb36..690631253fe 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs @@ -11,7 +11,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; @@ -21,7 +21,7 @@ internal class DefaultRazorBreakpointResolver : RazorBreakpointResolver private readonly FileUriProvider _fileUriProvider; private readonly LSPDocumentManager _documentManager; private readonly LSPBreakpointSpanProvider _breakpointSpanProvider; - private readonly MemoryCache _cache; + private readonly MemoryCache _cache; [ImportingConstructor] public DefaultRazorBreakpointResolver( @@ -51,10 +51,10 @@ public DefaultRazorBreakpointResolver( // 4 is a magic number that was determined based on the functionality of VisualStudio. Currently when you set or edit a breakpoint // we get called with two different locations for the same breakpoint. Because of this 2 time call our size must be at least 2, // we grow it to 4 just to be safe for lesser known scenarios. - _cache = new MemoryCache(sizeLimit: 4); + _cache = new MemoryCache(sizeLimit: 4); } - public override async Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) + public override async Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) { if (textBuffer is null) { diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs index caca4cd081d..1663a966be4 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs @@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; @@ -45,7 +45,7 @@ public DefaultLSPDocumentMappingProvider( public async override Task MapToDocumentRangesAsync( RazorLanguageKind languageKind, Uri razorDocumentUri, - Range[] projectedRanges, + LspRange[] projectedRanges, CancellationToken cancellationToken) { if (razorDocumentUri is null) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs index 1adeb935106..16e5bf80dd2 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs @@ -6,11 +6,11 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; internal abstract class LSPDocumentMappingProvider { - public abstract Task MapToDocumentRangesAsync(RazorLanguageKind languageKind, Uri razorDocumentUri, Range[] projectedRanges, CancellationToken cancellationToken); + public abstract Task MapToDocumentRangesAsync(RazorLanguageKind languageKind, Uri razorDocumentUri, LspRange[] projectedRanges, CancellationToken cancellationToken); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs index 1bc93112012..99e05e6190a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs @@ -14,7 +14,7 @@ using Moq; using Xunit; using Xunit.Abstractions; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; @@ -137,7 +137,7 @@ private async Task VerifyBreakpointRangeAsync(string input) Assert.Equal(expectedRange, result); } - private async Task GetBreakpointRangeAsync(RazorCodeDocument codeDocument, string razorFilePath, TextSpan breakpointSpan) + private async Task GetBreakpointRangeAsync(RazorCodeDocument codeDocument, string razorFilePath, TextSpan breakpointSpan) { var languageServer = await CreateLanguageServerAsync(codeDocument, razorFilePath); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs index 25a4ba44e63..95b89f2a2db 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs @@ -14,7 +14,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit.Abstractions; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -37,7 +37,7 @@ internal class DummyRazorFormattingService : IRazorFormattingService { public bool Called { get; private set; } - public Task FormatAsync(VersionedDocumentContext documentContext, Range? range, FormattingOptions options, CancellationToken cancellationToken) + public Task FormatAsync(VersionedDocumentContext documentContext, LspRange? range, FormattingOptions options, CancellationToken cancellationToken) { Called = true; return SpecializedTasks.EmptyArray(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs index f8d2fdd96b6..ff1b414a209 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs @@ -22,7 +22,7 @@ using ImplementationResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< Microsoft.VisualStudio.LanguageServer.Protocol.Location[], Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalReferenceItem[]>; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer; @@ -340,7 +340,7 @@ public Task SendNotificationAsync(string method, CancellationToken cancellationT throw new NotImplementedException(); } - private Task HandleValidateBreakpointRangeAsync(T @params) + private Task HandleValidateBreakpointRangeAsync(T @params) { var delegatedParams = Assert.IsType(@params); var delegatedRequest = new VSInternalValidateBreakableRangeParams() @@ -353,7 +353,7 @@ private Task HandleValidateBreakpointRangeAsync(T @params) Range = delegatedParams.ProjectedRange, }; - return _csharpServer.ExecuteRequestAsync( + return _csharpServer.ExecuteRequestAsync( VSInternalMethods.TextDocumentValidateBreakableRangeName, delegatedRequest, _cancellationToken); } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs index 2b20c842cf4..f264cad399e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs @@ -15,7 +15,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol; using Nerdbank.Streams; using StreamJsonRpc; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; @@ -174,7 +174,7 @@ static DidOpenTextDocumentParams CreateDidOpenTextDocumentParams(Uri uri, string }; } - public async Task ReplaceTextAsync(Uri documentUri, params (Range Range, string Text)[] changes) + public async Task ReplaceTextAsync(Uri documentUri, params (LspRange Range, string Text)[] changes) { var didChangeParams = CreateDidChangeTextDocumentParams( documentUri, @@ -182,7 +182,7 @@ public async Task ReplaceTextAsync(Uri documentUri, params (Range Range, string await ExecuteRequestAsync(Methods.TextDocumentDidChangeName, didChangeParams, _cancellationToken); - static DidChangeTextDocumentParams CreateDidChangeTextDocumentParams(Uri documentUri, ImmutableArray<(Range Range, string Text)> changes) + static DidChangeTextDocumentParams CreateDidChangeTextDocumentParams(Uri documentUri, ImmutableArray<(LspRange Range, string Text)> changes) { var changeEvents = changes.Select(change => new TextDocumentContentChangeEvent { diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs index 2011c5e7117..fac2bc3b725 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs @@ -15,7 +15,7 @@ using Moq; using Xunit; using Xunit.Abstractions; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; @@ -135,7 +135,7 @@ public async Task TryResolveBreakpointRangeAsync_MappableCSharpBreakpointLocatio var hostBreakpointRange = LspFactory.CreateSingleLineRange(start: hostDocumentPosition, length: ValidBreakpointCSharp.Length); var projectionProvider = new TestLSPBreakpointSpanProvider( _documentUri, - new Dictionary() + new Dictionary() { [hostDocumentPosition] = hostBreakpointRange }); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs index b594365bdd2..d3d3e64669f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs @@ -11,16 +11,16 @@ using Microsoft.AspNetCore.Razor.Threading; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; internal class TestLSPBreakpointSpanProvider : LSPBreakpointSpanProvider { private readonly Uri _documentUri; - private readonly IReadOnlyDictionary _mappings; + private readonly IReadOnlyDictionary _mappings; - public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary mappings) + public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary mappings) { if (documentUri is null) { @@ -36,11 +36,11 @@ public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public override Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) { if (documentSnapshot.Uri != _documentUri) { - return SpecializedTasks.Null(); + return SpecializedTasks.Null(); } foreach (var mapping in _mappings.OrderBy(d => d.Key)) @@ -52,6 +52,6 @@ public override Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentS } } - return SpecializedTasks.Null(); + return SpecializedTasks.Null(); } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs index d2b8d278c79..639a3f16a58 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs @@ -18,7 +18,7 @@ using Moq; using Xunit; using Xunit.Abstractions; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient; @@ -71,8 +71,8 @@ public async Task MapSpans_WithinRange_ReturnsMapping() { Ranges = [mappedRange] }; - documentMappingProvider.Setup(dmp => dmp.MapToDocumentRangesAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) - .Callback((languageKind, uri, ranges, ct) => + documentMappingProvider.Setup(dmp => dmp.MapToDocumentRangesAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((languageKind, uri, ranges, ct) => { Assert.Equal(RazorLanguageKind.CSharp, languageKind); Assert.Equal(_mockDocumentUri, uri); @@ -113,8 +113,8 @@ public async Task MapSpans_OutsideRange_ReturnsEmpty() var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan); var documentMappingProvider = new Mock(MockBehavior.Strict); - documentMappingProvider.Setup(dmp => dmp.MapToDocumentRangesAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) - .Callback((languageKind, uri, ranges, ct) => + documentMappingProvider.Setup(dmp => dmp.MapToDocumentRangesAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((languageKind, uri, ranges, ct) => { Assert.Equal(RazorLanguageKind.CSharp, languageKind); Assert.Equal(_mockDocumentUri, uri); @@ -138,7 +138,7 @@ public void MapSpans_GetMappedSpanResults_MappingErrorReturnsDefaultMappedSpan() { // Arrange var sourceTextRazor = SourceText.From(""); - var response = new RazorMapToDocumentRangesResponse { Ranges = new Range[] { LspFactory.UndefinedRange } }; + var response = new RazorMapToDocumentRangesResponse { Ranges = new LspRange[] { LspFactory.UndefinedRange } }; // Act var results = RazorLSPSpanMappingService.GetMappedSpanResults(_mockDocumentUri.LocalPath, sourceTextRazor, response); From 4c649b28a3ea6b0ec0e97a9e24b2f108555c014c Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 12:08:00 +1000 Subject: [PATCH 005/223] Reference Roslyn protocol library, and deal with the extern alias bits --- Directory.Packages.props | 1 + ...oft.AspNetCore.Razor.Microbenchmarks.csproj | 3 +++ .../GlobalUsings.cs | 18 ++++++++++++++++++ ...soft.AspNetCore.Razor.LanguageServer.csproj | 8 ++++++++ .../GlobalUsings.cs | 16 ++++++++++++++++ ...rosoft.CodeAnalysis.Razor.Workspaces.csproj | 3 --- .../Microsoft.CodeAnalysis.Remote.Razor.csproj | 5 ++--- ....VisualStudio.LanguageServices.Razor.csproj | 4 ++++ ...AspNetCore.Razor.LanguageServer.Test.csproj | 11 +++++++++++ ...AspNetCore.Razor.Test.Common.Tooling.csproj | 3 +++ 10 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GlobalUsings.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GlobalUsings.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 4e2bdea802f..dc7a59c8505 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,6 +47,7 @@ + diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj index 1010350dd29..da4879516d9 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj @@ -31,6 +31,7 @@ + TestServices\%(FileName)%(Extension) @@ -54,6 +55,8 @@ + + diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GlobalUsings.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GlobalUsings.cs new file mode 100644 index 00000000000..30da818ec34 --- /dev/null +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GlobalUsings.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +// The item doesn't support aliases so we need to define aliased global usings in a .cs file not in the .csproj +// https://github.com/dotnet/sdk/issues/37814 +extern alias RLSP; +global using RLSP::Roslyn.LanguageServer.Protocol; + +// Avoid extern alias in every file that needs to use Range +global using LspRange = RLSP::Roslyn.LanguageServer.Protocol.Range; + +// Avoid ambiguity errors because of our global using above +global using Range = System.Range; + +// We put our extensions on Roslyn's LSP types in the same namespace, for convenience, but of course without the alias, +// so to prevent confusion at not needing a using directive to access types, but needing one for extensions, we just +// global using the our extensions (which of course means they didn't need to be in the same namespace for convenience!) +global using Roslyn.LanguageServer.Protocol; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Microsoft.AspNetCore.Razor.LanguageServer.csproj b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Microsoft.AspNetCore.Razor.LanguageServer.csproj index 8c0b64042b4..e818a269bcb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Microsoft.AspNetCore.Razor.LanguageServer.csproj +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Microsoft.AspNetCore.Razor.LanguageServer.csproj @@ -26,6 +26,14 @@ + + + + + + diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj index 6caeb6b2982..2b56b9591dc 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj @@ -14,6 +14,7 @@ + @@ -54,6 +55,8 @@ + + From eb3565c9aeba1c342e2092c221fb3545f4c37ce7 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 13:21:51 +1000 Subject: [PATCH 006/223] Remove unused usings Not a mechanical commit, but my word is it doing a good job cosplaying as one --- .../LanguageServer/BenchmarkClientCapabilitiesService.cs | 1 - .../LanguageServer/RazorCSharpFormattingBenchmark.cs | 1 - .../LanguageServer/RazorCodeActionsBenchmark.cs | 2 -- .../LanguageServer/RazorCompletionBenchmark.cs | 1 - .../LanguageServer/RazorDiagnosticsBenchmark.cs | 2 -- .../LanguageServer/RazorSemanticTokensBenchmark.cs | 2 -- .../RazorSemanticTokensRangeEndpointBenchmark.cs | 2 -- .../LanguageServer/RazorSemanticTokensScrollingBenchmark.cs | 2 -- .../Serialization/CompletionListSerializationBenchmark.cs | 1 - .../AbstractRazorDelegatingEndpoint.cs | 1 - .../AutoInsert/AutoClosingTagOnAutoInsertProvider.cs | 1 - .../AutoInsert/CloseTextTagOnAutoInsertProvider.cs | 1 - .../AutoInsert/IOnAutoInsertProvider.cs | 1 - .../AutoInsert/OnAutoInsertEndpoint.cs | 1 - .../PreferHtmlInAttributeValuesDocumentPositionStrategy.cs | 1 - .../CapabilitiesManager.cs | 1 - .../ClientConnection.cs | 1 - .../CodeActions/AddUsingsCodeActionProviderHelper.cs | 1 - .../CodeActions/BaseDelegatedCodeActionResolver.cs | 1 - .../CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs | 1 - .../CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs | 1 - .../CSharp/UnformattedRemappingCSharpCodeActionResolver.cs | 1 - .../CodeActions/CodeActionEndpoint.cs | 1 - .../CodeActions/CodeActionResolveEndpoint.cs | 1 - .../CodeActions/Html/DefaultHtmlCodeActionProvider.cs | 1 - .../CodeActions/Html/DefaultHtmlCodeActionResolver.cs | 1 - .../CodeActions/Models/AddUsingsCodeActionParams.cs | 1 - .../CodeActions/Models/CodeActionExtensions.cs | 1 - .../CodeActions/Models/CodeActionResolveParams.cs | 1 - .../CodeActions/Models/RazorVSInternalCodeAction.cs | 1 - .../CodeActions/Razor/AddUsingsCodeActionResolver.cs | 1 - .../CodeActions/Razor/CodeBlockService.cs | 1 - .../Razor/ComponentAccessibilityCodeActionProvider.cs | 1 - .../CodeActions/Razor/CreateComponentCodeActionResolver.cs | 1 - .../CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs | 1 - .../CodeActions/Razor/GenerateMethodCodeActionResolver.cs | 1 - .../CodeActions/Razor/IRazorCodeActionResolver.cs | 1 - .../CodeActions/Razor/RazorCodeActionFactory.cs | 1 - .../ColorPresentation/ColorPresentationEndpoint.cs | 1 - .../Completion/AggregateCompletionItemResolver.cs | 1 - .../Completion/CompletionItemResolver.cs | 1 - .../Completion/CompletionListCache.cs | 1 - .../Completion/CompletionListMerger.cs | 1 - .../Completion/CompletionListOptimizer.cs | 1 - .../Completion/CompletionListProvider.cs | 1 - .../Completion/Delegation/DelegatedCompletionItemResolver.cs | 1 - .../Completion/Delegation/DelegatedCompletionListProvider.cs | 1 - .../Delegation/DelegatedCompletionResponseRewriter.cs | 1 - .../Completion/Delegation/DesignTimeHelperResponseRewriter.cs | 1 - .../Delegation/HtmlCommitCharacterResponseRewriter.cs | 1 - .../Completion/Delegation/SnippetResponseRewriter.cs | 1 - .../Completion/Delegation/TextEditResponseRewriter.cs | 1 - .../Completion/RazorCompletionEndpoint.cs | 1 - .../Completion/RazorCompletionItemResolver.cs | 1 - .../Completion/RazorCompletionListProvider.cs | 1 - .../Completion/RazorCompletionResolveEndpoint.cs | 1 - .../Completion/VSInternalCompletionItemExtensions.cs | 1 - .../Completion/VSInternalCompletionListExtensions.cs | 1 - .../Debugging/RazorBreakpointSpanEndpoint.cs | 1 - .../Debugging/RazorProximityExpressionsEndpoint.cs | 1 - .../Debugging/ValidateBreakpointRangeEndpoint.cs | 1 - .../Debugging/ValidateBreakpointRangeParams.cs | 1 - .../DefaultDocumentPositionInfoStrategy.cs | 1 - .../DefaultRazorConfigurationService.cs | 1 - .../Definition/DefinitionEndpoint.cs | 2 -- .../Diagnostics/DocumentPullDiagnosticsEndpoint.cs | 1 - .../Diagnostics/RazorDiagnosticConverter.cs | 2 -- .../Diagnostics/RazorDiagnosticsPublisher.TestAccessor.cs | 1 - .../Diagnostics/RazorDiagnosticsPublisher.cs | 1 - .../Diagnostics/RazorTranslateDiagnosticsService.cs | 2 -- .../DocumentColor/DocumentColorEndpoint.cs | 1 - .../DocumentColor/DocumentColorService.cs | 1 - .../DocumentColor/IDocumentColorService.cs | 1 - .../DocumentContextFactory.cs | 1 - .../DocumentHighlighting/DocumentHighlightEndpoint.cs | 1 - .../AbstractTextDocumentPresentationEndpointBase.cs | 1 - .../ITextDocumentTextPresentationHandler.cs | 1 - .../ITextDocumentUriPresentationHandler.cs | 1 - .../TextDocumentTextPresentationEndpoint.cs | 1 - .../TextDocumentUriPresentationEndpoint.cs | 1 - .../DocumentSymbols/DocumentSymbolEndpoint.cs | 1 - .../DocumentSynchronization/DocumentDidChangeEndpoint.cs | 1 - .../DocumentSynchronization/DocumentDidCloseEndpoint.cs | 1 - .../DocumentSynchronization/DocumentDidOpenEndpoint.cs | 1 - .../DocumentSynchronization/DocumentDidSaveEndpoint.cs | 1 - .../EndpointContracts/IDidChangeConfigurationEndpoint.cs | 2 -- .../EndpointContracts/IRazorRequestHandler.cs | 1 - .../Extensions/IServiceCollectionExtensions.cs | 1 - .../FindAllReferences/FindAllReferencesEndpoint.cs | 1 - .../Folding/FoldingRangeEndpoint.cs | 1 - .../Formatting/CSharpFormatter.cs | 2 -- .../Formatting/CSharpFormattingPass.cs | 1 - .../Formatting/CSharpFormattingPassBase.cs | 2 -- .../Formatting/CSharpOnTypeFormattingPass.cs | 2 -- .../Formatting/DocumentFormattingEndpoint.cs | 1 - .../Formatting/DocumentOnTypeFormattingEndpoint.cs | 1 - .../Formatting/DocumentRangeFormattingEndpoint.cs | 1 - .../Formatting/FormattingContentValidationPass.cs | 1 - .../Formatting/FormattingContext.cs | 1 - .../Formatting/FormattingDiagnosticValidationPass.cs | 1 - .../Formatting/FormattingOptionsExtensions.cs | 1 - .../Formatting/FormattingPassBase.cs | 1 - .../Formatting/FormattingResult.cs | 1 - .../Formatting/HtmlFormatter.cs | 1 - .../Formatting/HtmlFormattingPass.cs | 1 - .../Formatting/IRazorFormattingService.cs | 1 - .../Formatting/RazorFormattingPass.cs | 1 - .../Formatting/RazorFormattingService.cs | 2 -- .../GeneratedDocumentPublisher.cs | 1 - .../Hosting/RazorLanguageServerCapability.cs | 1 - .../Hosting/RazorLanguageServerHost.cs | 1 - .../Hosting/VSInternalServerCapabilitiesExtensions.cs | 1 - .../Hover/HoverEndpoint.cs | 1 - .../Hover/HoverService.TestAccessor.cs | 1 - .../Hover/HoverService.cs | 3 --- .../Hover/IHoverService.cs | 1 - .../IDocumentPositionInfoStrategy.cs | 1 - .../IOnInitialized.cs | 1 - .../Implementation/ImplementationEndpoint.cs | 1 - .../InlayHints/IInlayHintService.cs | 1 - .../InlayHints/InlayHintEndpoint.cs | 1 - .../InlayHints/InlayHintResolveEndpoint.cs | 1 - .../InlayHints/InlayHintService.cs | 1 - .../InlayHints/RazorInlayHintWrapper.cs | 1 - .../InlineCompletion/InlineCompletionEndPoint.cs | 1 - .../LinkedEditingRange/LinkedEditingRangeEndpoint.cs | 1 - .../MapCode/MapCodeEndpoint.cs | 1 - .../MapCode/Mappers/InsertMapper.cs | 1 - .../Mapping/RazorLanguageQueryEndpoint.cs | 1 - .../Mapping/RazorLanguageQueryParams.cs | 1 - .../Mapping/RazorLanguageQueryResponse.cs | 1 - .../Mapping/RazorMapToDocumentRangesEndpoint.cs | 2 -- .../PreferAttributeNameDocumentPositionInfoStrategy.cs | 1 - .../ProjectContexts/ProjectContextsEndpoint.cs | 1 - .../RazorConfigurationEndpoint.cs | 1 - .../RazorInitializeEndpoint.cs | 1 - .../RazorInitializedEndpoint.cs | 1 - .../RazorRequestContextFactory.cs | 1 - .../Refactoring/RenameEndpoint.cs | 1 - .../Semantic/SemanticTokensRangeEndpoint.cs | 1 - .../Semantic/Services/LSPCSharpSemanticTokensProvider.cs | 2 -- .../SignatureHelp/SignatureHelpEndpoint.cs | 1 - .../SpellCheck/DocumentSpellCheckEndpoint.cs | 1 - .../SpellCheck/WorkspaceSpellCheckEndpoint.cs | 1 - .../Tooltip/DefaultLSPTagHelperTooltipFactory.cs | 1 - .../Tooltip/LSPTagHelperTooltipFactory.cs | 1 - .../WorkspaceSemanticTokensRefreshNotifier.cs | 1 - .../WrapWithTag/WrapWithTagEndpoint.cs | 1 - .../WrapWithTag/WrapWithTagParams.cs | 2 -- .../WrapWithTag/WrapWithTagResponse.cs | 1 - .../Microsoft.CodeAnalysis.Razor.Workspaces/DebuggerDisplay.cs | 1 - .../DocumentMapping/AbstractRazorDocumentMappingService.cs | 1 - .../DocumentMapping/DocumentPositionInfo.cs | 1 - .../DocumentMapping/IRazorDocumentMappingService.cs | 1 - .../DocumentMapping/IRazorDocumentMappingServiceExtensions.cs | 2 -- .../FoldingRanges/AbstractSyntaxNodeFoldingProvider.cs | 3 ++- .../FoldingRanges/FoldingRangeService.cs | 1 - .../FoldingRanges/IFoldingRangeService.cs | 1 - .../FoldingRanges/IRazorFoldingRangeProvider.cs | 1 - .../FoldingRanges/RazorFileUsingsFoldingSyntaxWalker.cs | 1 - .../FoldingRanges/UsingsFoldingRangeProvider.cs | 1 - .../ICapabilitiesProvider.cs | 2 -- .../ProjectSystem/DocumentContext.cs | 1 - .../ProjectSystem/IDocumentContextFactory.cs | 1 - .../ProjectSystem/IDocumentContextFactoryExtensions.cs | 1 - .../ProjectSystem/VersionedDocumentContext.cs | 1 - .../Protocol/CodeActions/FormatNewFileParams.cs | 1 - .../Protocol/CodeActions/RazorResolveCodeActionParams.cs | 1 - .../Protocol/CodeActions/SimplifyMethodParams.cs | 1 - .../Protocol/CodeActions/VSCodeActionParams.cs | 1 - .../Protocol/ColorPresentation/ColorPresentation.cs | 1 - .../Protocol/ColorPresentation/ColorPresentationParams.cs | 1 - .../Protocol/ColorPresentation/DelegatedDocumentColorParams.cs | 1 - .../Protocol/Completion/RazorInlineCompletionRequest.cs | 1 - .../Protocol/Debugging/RazorBreakpointSpanParams.cs | 1 - .../Protocol/Debugging/RazorBreakpointSpanResponse.cs | 1 - .../Protocol/Debugging/RazorProximityExpressionsParams.cs | 1 - .../Protocol/DelegatedTypes.cs | 1 - .../Protocol/Diagnostics/RazorPullDiagnosticResponse.cs | 1 - .../Protocol/DocumentHighlight/RemoteDocumentHighlight.cs | 1 - .../Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs | 1 - .../DocumentMapping/RazorMapToDocumentRangesResponse.cs | 1 - .../Protocol/DocumentPresentation/IPresentationParams.cs | 2 -- .../Protocol/DocumentPresentation/TextPresentationParams.cs | 2 -- .../Protocol/DocumentPresentation/UriPresentationParams.cs | 2 -- .../Protocol/Folding/RazorFoldingRangeRequestParam.cs | 1 - .../Protocol/Folding/RazorFoldingRangeResponse.cs | 1 - .../Protocol/Folding/RemoteFoldingRange.cs | 1 - .../Protocol/Formatting/RazorDocumentFormattingParams.cs | 1 - .../Protocol/Formatting/RazorDocumentFormattingResponse.cs | 1 - .../Protocol/Formatting/RazorDocumentOnTypeFormattingParams.cs | 1 - .../Protocol/IClientCapabilitiesService.cs | 2 -- .../SemanticTokens/ProvideSemanticTokensRangesParams.cs | 2 -- .../Protocol/SemanticTokens/SemanticTokensRangesParams.cs | 1 - .../Protocol/TextDocumentIdentifierAndVersion.cs | 1 - .../Debugging/RazorBreakpointResolver.cs | 1 - .../Cohost/CohostDocumentHighlightPresentationEndpoint.cs | 1 - .../LanguageClient/Cohost/CohostFoldingRangeEndpoint.cs | 1 - .../LanguageClient/Cohost/CohostLinkedEditingRangeEndpoint.cs | 1 - .../LanguageClient/Cohost/CohostSemanticTokensRangeEndpoint.cs | 1 - .../LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs | 1 - .../LanguageClient/Cohost/CohostUriPresentationEndpoint.cs | 1 - .../LanguageClient/Cohost/IDynamicRegistrationProvider.cs | 1 - .../Cohost/RazorCohostClientCapabilitiesService.cs | 1 - .../Cohost/RazorCohostDynamicRegistrationService.cs | 1 - .../Debugging/DefaultLSPBreakpointSpanProvider.cs | 2 -- .../Debugging/DefaultLSPProximityExpressionsProvider.cs | 1 - .../LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs | 2 -- .../Debugging/DefaultRazorProximityExpressionResolver.cs | 1 - .../LanguageClient/Debugging/LSPBreakpointSpanProvider.cs | 1 - .../Debugging/LSPProximityExpressionsProvider.cs | 1 - .../DocumentMapping/DefaultLSPDocumentMappingProvider.cs | 1 - .../DocumentMapping/LSPDocumentMappingProvider.cs | 1 - .../LanguageClient/Endpoints/RazorCustomMessageTarget.cs | 1 - .../Endpoints/RazorCustomMessageTarget_CodeActions.cs | 1 - .../Endpoints/RazorCustomMessageTarget_Completion.cs | 1 - .../Endpoints/RazorCustomMessageTarget_Diagnostics.cs | 1 - .../Endpoints/RazorCustomMessageTarget_DocumentColor.cs | 1 - .../Endpoints/RazorCustomMessageTarget_DocumentSymbol.cs | 1 - .../Endpoints/RazorCustomMessageTarget_FoldingRange.cs | 1 - .../Endpoints/RazorCustomMessageTarget_HtmlFormatting.cs | 1 - .../Endpoints/RazorCustomMessageTarget_InlayHints.cs | 1 - .../Endpoints/RazorCustomMessageTarget_MapCode.cs | 1 - .../Endpoints/RazorCustomMessageTarget_OnAutoInsert.cs | 1 - .../Endpoints/RazorCustomMessageTarget_Presentation.cs | 1 - .../Endpoints/RazorCustomMessageTarget_ProjectContexts.cs | 1 - .../Endpoints/RazorCustomMessageTarget_Rename.cs | 1 - .../Endpoints/RazorCustomMessageTarget_SemanticTokens.cs | 1 - .../Endpoints/RazorCustomMessageTarget_SimplifyMethod.cs | 1 - .../Endpoints/RazorCustomMessageTarget_SpellCheck.cs | 1 - .../Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs | 1 - .../Endpoints/RazorCustomMessageTarget_ValidateBreakpoint.cs | 1 - .../RazorCustomMessageTarget_WorkspaceConfiguration.cs | 1 - .../Endpoints/RazorCustomMessageTarget_WrapWithTag.cs | 1 - .../LanguageClient/Extensions/TextDocumentExtensions.cs | 1 - .../LanguageClient/RazorCSharpInterceptionMiddleLayer.cs | 1 - .../LanguageClient/RazorLSPSpanMappingService.cs | 1 - .../LanguageClient/WorkspaceConfigurationChangedListener.cs | 1 - .../LanguageClient/WrapWithTag/VSInternalWrapWithTagParams.cs | 1 - .../WrapWithTag/VSInternalWrapWithTagResponse.cs | 1 - .../AutoInsert/OnAutoInsertEndpointTest.NetFx.cs | 1 - .../AutoInsert/OnAutoInsertEndpointTest.cs | 1 - ...ferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs | 1 - .../AutoInsert/RazorOnAutoInsertProviderTestBase.cs | 1 - .../CodeActions/AddUsingsCodeActionResolverTest.cs | 1 - .../CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs | 1 - .../CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs | 1 - .../CSharp/TypeAccessibilityCodeActionProviderTest.cs | 1 - .../CodeActions/CodeActionEndToEndTest.NetFx.cs | 1 - .../CodeActions/CodeActionEndpointTest.cs | 1 - .../CodeActions/CodeActionResolutionEndpointTest.cs | 1 - .../CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs | 1 - .../CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs | 1 - .../Razor/ComponentAccessibilityCodeActionProviderTest.cs | 1 - .../CodeActions/Razor/CreateComponentCodeActionResolverTest.cs | 1 - .../Razor/ExtractToCodeBehindCodeActionProviderTest.cs | 1 - .../Razor/ExtractToCodeBehindCodeActionResolverTest.cs | 1 - .../Completion/CompletionListCacheTest.cs | 1 - .../Completion/CompletionListMergerTest.cs | 1 - .../Completion/CompletionListOptimizerTest.cs | 1 - .../Completion/CompletionListProviderTest.cs | 1 - .../Completion/DefaultLSPTagHelperTooltipFactoryTest.cs | 1 - .../Delegation/DelegatedCompletionItemResolverTest.NetFx.cs | 1 - .../Delegation/DelegatedCompletionListProviderTest.cs | 1 - .../Delegation/DesignTimeHelperResponseRewriterTest.cs | 1 - .../Delegation/HtmlCommitCharacterResponseRewriterTest.cs | 1 - .../Completion/Delegation/ResponseRewriterTestBase.cs | 1 - .../Completion/Delegation/SnippetResponseRewriterTest.cs | 1 - .../Delegation/TestDelegatedCompletionListProvider.cs | 1 - .../Completion/Delegation/TextEditResponseRewriterTest.cs | 1 - .../Completion/DirectiveVerifier.cs | 1 - .../Completion/RazorCompletionEndpointTest.cs | 1 - .../Completion/RazorCompletionItemResolverTest.cs | 1 - .../Completion/RazorCompletionListProviderTest.cs | 1 - .../Completion/RazorCompletionResolveEndpointTest.cs | 1 - .../Completion/TestDocumentMappingService.cs | 1 - .../Debugging/RazorBreakpointSpanEndpointTest.cs | 1 - .../Debugging/RazorProximityExpressionsEndpointTest.cs | 1 - .../Debugging/ValidateBreakpointRangeEndpointTest.cs | 2 -- .../DefaultRazorConfigurationServiceTest.cs | 1 - .../DefaultWorkspaceDirectoryPathResolverTest.cs | 1 - .../Definition/DefinitionEndpointDelegationTest.cs | 1 - .../Definition/DefinitionEndpointTest.cs | 1 - .../Diagnostics/CSharpDiagnosticsEndToEndTest.cs | 1 - .../Diagnostics/DocumentPullDiagnosticsEndpointTest.cs | 1 - .../Diagnostics/RazorDiagnosticConverterTest.cs | 1 - .../Diagnostics/RazorDiagnosticsPublisherTest.cs | 1 - .../DocumentHighlighting/DocumentHighlightEndpointTest.cs | 1 - .../TextDocumentTextPresentationEndpointTests.cs | 1 - .../TextDocumentUriPresentationEndpointTests.cs | 1 - .../DocumentSymbols/DocumentSymbolEndpointTest.cs | 1 - .../DocumentSynchronization/DocumentDidChangeEndpointTest.cs | 1 - .../DocumentSynchronization/DocumentDidCloseEndpointTest.cs | 1 - .../DocumentSynchronization/DocumentDidOpenEndpointTest.cs | 1 - .../FindReferences/FindAllReferencesEndpointTest.cs | 1 - .../Folding/FoldingEndpointTest.cs | 1 - .../Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs | 1 - .../Formatting_NetFx/DocumentRangeFormattingEndpointTest.cs | 1 - .../Formatting_NetFx/FormattingContentValidationPassTest.cs | 1 - .../Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs | 1 - .../Formatting_NetFx/FormattingLanguageServerClient.cs | 1 - .../Formatting_NetFx/FormattingLanguageServerTestBase.cs | 2 -- .../Formatting_NetFx/FormattingTestBase.cs | 1 - .../Formatting_NetFx/RazorFormattingServiceTest.cs | 1 - .../GeneratedDocumentPublisherTest.cs | 1 - .../Hover/HoverServiceTest.cs | 1 - .../Implementation/ImplementationEndpointTest.cs | 1 - .../InlayHints/InlayHintEndpointTest.cs | 1 - .../LinkedEditingRange/LinkedEditingRangeEndpointTest.cs | 1 - .../MapCode/MapCodeTest.cs | 1 - .../Mapping/RazorLanguageQueryEndpointTest.cs | 1 - .../Mapping/RazorMapToDocumentRangesEndpointTest.cs | 1 - .../ProjectContexts/ProjectContextsEndpointTest.cs | 1 - .../RangeExtensionsTests.cs | 1 - .../RazorConfigurationEndpointTest.cs | 1 - .../RazorFileChangeDetectorManagerTest.cs | 1 - .../RazorLanguageServerTest.cs | 1 - .../Refactoring/RenameEndpointDelegationTest.cs | 1 - .../Refactoring/RenameEndpointTest.cs | 1 - .../Semantic/RazorSemanticTokensRefreshEndpointTest.cs | 1 - .../Semantic/SemanticTokensTest.cs | 1 - .../PlatformAgnosticClientCapabilitiesJsonConverterTest.cs | 1 - .../SignatureHelp/SignatureHelpEndpointTest.cs | 1 - ...ingleServerDelegatingEndpointTestBase.TestLanguageServer.cs | 1 - .../SingleServerDelegatingEndpointTestBase.cs | 1 - .../SpellCheck/DocumentSpellCheckEndpointTest.cs | 1 - .../TestClient.cs | 1 - .../WorkspaceSemanticTokensRefreshNotifierTest.cs | 1 - .../WrapWithTag/WrapWithTagEndpointTests.cs | 1 - .../LanguageServer/CSharpTestLspServer.cs | 2 -- .../LanguageServer/TestDocumentContextFactory.cs | 1 - 331 files changed, 2 insertions(+), 361 deletions(-) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/BenchmarkClientCapabilitiesService.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/BenchmarkClientCapabilitiesService.cs index 5abecc34303..2331cbb9c12 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/BenchmarkClientCapabilitiesService.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/BenchmarkClientCapabilitiesService.cs @@ -4,7 +4,6 @@ #nullable disable using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs index 4cfa36773c0..1b2c4cf7688 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs index 2f76d296831..21c4d3ca9ae 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs @@ -19,8 +19,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs index f9baad11704..959936aa90b 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs index 24444f16bdf..61be4c31490 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs @@ -20,9 +20,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs index fa61204cb93..2a8bbe848b8 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs @@ -19,8 +19,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.Extensions.DependencyInjection; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs index a30a3828c86..14f9adcac9f 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs @@ -21,8 +21,6 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs index be37d59ac3c..a3605ace618 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs @@ -13,9 +13,7 @@ using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.CodeAnalysis.Text; using Microsoft.Extensions.DependencyInjection; -using Microsoft.VisualStudio.LanguageServer.Protocol; using static Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer.RazorSemanticTokensBenchmark; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.LanguageServer; diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Serialization/CompletionListSerializationBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Serialization/CompletionListSerializationBenchmark.cs index 9e98822d88d..d6795a2d4a7 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Serialization/CompletionListSerializationBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Serialization/CompletionListSerializationBenchmark.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Completion; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Completion; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Microbenchmarks.Serialization; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs index 88574c846ba..b224765d9cc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs index c553ce23987..d66d5fcda77 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs index c644948cfd3..3c833bee83e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs index 5e83a82a646..7f918a275c5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs @@ -3,7 +3,6 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs index ea7d46e8e45..7241826fae8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs index 3169a1d7648..3ee97974518 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CapabilitiesManager.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CapabilitiesManager.cs index 46635c91ffb..d98dbe9993f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CapabilitiesManager.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CapabilitiesManager.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.RpcContracts.Settings; using Microsoft.VisualStudio.Threading; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs index 0a3c90a7b8f..77a128a2580 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/AddUsingsCodeActionProviderHelper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/AddUsingsCodeActionProviderHelper.cs index a216287aea1..a1027062db7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/AddUsingsCodeActionProviderHelper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/AddUsingsCodeActionProviderHelper.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/BaseDelegatedCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/BaseDelegatedCodeActionResolver.cs index 341c8ca5ae1..e0b3c564de5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/BaseDelegatedCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/BaseDelegatedCodeActionResolver.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs index 9e62f694a04..4b7ba677def 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs index e89d2880f55..e327b257a9d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/TypeAccessibilityCodeActionProvider.cs @@ -17,7 +17,6 @@ using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs index df9aaf7fe45..6efc272b6c4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs index 124f3fc5935..d663e318ce9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs @@ -23,7 +23,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionResolveEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionResolveEndpoint.cs index cdf0620fcab..b94ceea0519 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionResolveEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionResolveEndpoint.cs @@ -13,7 +13,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionProvider.cs index 5f7f6d007e0..2b73f1522be 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionProvider.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.DocumentMapping; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs index 604f02a3458..7b565a0bd1b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/AddUsingsCodeActionParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/AddUsingsCodeActionParams.cs index 4f1bf25bcae..d04e0943b43 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/AddUsingsCodeActionParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/AddUsingsCodeActionParams.cs @@ -3,7 +3,6 @@ using System; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionExtensions.cs index 8d10ca7bb71..25bb3b59185 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionExtensions.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text.Json; using System.Text.Json.Nodes; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionResolveParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionResolveParams.cs index 927b8a9ecf5..95476ead70a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionResolveParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/CodeActionResolveParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/RazorVSInternalCodeAction.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/RazorVSInternalCodeAction.cs index dc53eff8e46..8f5da5002a7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/RazorVSInternalCodeAction.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Models/RazorVSInternalCodeAction.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs index ea5b810adfc..b6bd2f0296c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/AddUsingsCodeActionResolver.cs @@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs index 62ece3f7a58..ffdfcc938bb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Razor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs index 907ac96017c..9b78047864f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ComponentAccessibilityCodeActionProvider.cs @@ -17,7 +17,6 @@ using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.CodeAnalysis.Razor; using Microsoft.VisualStudio.Editor.Razor; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs index 29ddff07cc5..aa98932d2c4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CreateComponentCodeActionResolver.cs @@ -14,7 +14,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs index 886dd50da75..25a29c971a2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/ExtractToCodeBehindCodeActionResolver.cs @@ -22,7 +22,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs index 3168e767478..00fd783ef21 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs @@ -20,7 +20,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using CSharpSyntaxFactory = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Razor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/IRazorCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/IRazorCodeActionResolver.cs index 60b58952eea..9d2478b88a2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/IRazorCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/IRazorCodeActionResolver.cs @@ -4,7 +4,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/RazorCodeActionFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/RazorCodeActionFactory.cs index 832f3c2a351..6b996880775 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/RazorCodeActionFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/RazorCodeActionFactory.cs @@ -4,7 +4,6 @@ using System; using System.Text.Json; using Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Razor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs index 3e53f3ab948..e93bfecb498 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.ColorPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/AggregateCompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/AggregateCompletionItemResolver.cs index 21075cfacc1..e321fa0ef11 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/AggregateCompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/AggregateCompletionItemResolver.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionItemResolver.cs index 010b53c71db..64996ea6471 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionItemResolver.cs @@ -3,7 +3,6 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListCache.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListCache.cs index ee163ec8b1a..da335a0d684 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListCache.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListCache.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListMerger.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListMerger.cs index cf1344a1936..ddac8244746 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListMerger.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListMerger.cs @@ -11,7 +11,6 @@ using System.Text.Json.Serialization; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Newtonsoft.Json.Linq; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs index 0fa09dcc0b2..5147c57c251 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.VisualStudio.LanguageServer.Protocol; using AliasedVSCommitCharacters = Microsoft.VisualStudio.LanguageServer.Protocol.SumType; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs index f296da09b3d..23ddbcc8db1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs index 7d58f7bfbd6..bbd5c27f005 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs index a35d13bb895..8571b3bcd9a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionResponseRewriter.cs index 68c04994f45..57de12530ba 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionResponseRewriter.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DesignTimeHelperResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DesignTimeHelperResponseRewriter.cs index 675b2d27148..2d4f3223a57 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DesignTimeHelperResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DesignTimeHelperResponseRewriter.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs index 1bd58636764..48c24deec92 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/SnippetResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/SnippetResponseRewriter.cs index 85ceaa682a6..e1e8d1667d4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/SnippetResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/SnippetResponseRewriter.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs index b25972b14ea..ac6bb4aaebd 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs index fea284d3d97..fa3cc7348ea 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs index 6cc6fd21f6e..c216ae10c6d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.Completion; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs index e73f38dcad8..74ce4cc94f2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Completion; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionResolveEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionResolveEndpoint.cs index 5c22672d50f..a96a1abb23f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionResolveEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionResolveEndpoint.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionItemExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionItemExtensions.cs index c52fe46804c..eac89b3c240 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionItemExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionItemExtensions.cs @@ -7,7 +7,6 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.Completion; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionListExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionListExtensions.cs index 94a502eb190..4d0c90a396c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionListExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/VSInternalCompletionListExtensions.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text.Json; using System.Text.Json.Nodes; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs index f28856851d3..bd9124daafe 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs index cf6700e9a68..9d5b42ebaa6 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs index 5f5c32bb01d..7e4cb4a209b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeParams.cs index afc28afba5a..b282bb92eb9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs index a9ebe134264..28f9bebe04e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs @@ -6,7 +6,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs index 6010dde3ebd..ac5b7c15082 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRazorConfigurationService.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Settings; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index 41ef8c1ecf2..8082873a320 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -17,12 +17,10 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxKind = Microsoft.AspNetCore.Razor.Language.SyntaxKind; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index b4277742608..79c3464a9b9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs index ce6dd366ab9..38729b486aa 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs @@ -7,8 +7,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.TestAccessor.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.TestAccessor.cs index ddcc99f5817..b8b331260c4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.TestAccessor.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.TestAccessor.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs index e3f0eb8d901..31b4825ad74 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs @@ -17,7 +17,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs index bb851658894..f386fc9f19d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs @@ -16,10 +16,8 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; using DiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs index 61fa87dd95e..cc5d04d076e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs index 56cf6818cd2..f7bc9a1174c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs index f2e90ab2df7..c2dedaee3cc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs index c752e617e0b..5b3e2efc798 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentHighlighting/DocumentHighlightEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentHighlighting/DocumentHighlightEndpoint.cs index 5854d01677e..3b0e13d4b96 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentHighlighting/DocumentHighlightEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentHighlighting/DocumentHighlightEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentHighlighting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs index e45daae36d9..96d829f98bc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentTextPresentationHandler.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentTextPresentationHandler.cs index fba285f3ebc..56d6fd402f8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentTextPresentationHandler.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentTextPresentationHandler.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentUriPresentationHandler.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentUriPresentationHandler.cs index 97c1e0ecaef..976273c4ac8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentUriPresentationHandler.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/ITextDocumentUriPresentationHandler.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentTextPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentTextPresentationEndpoint.cs index 69aea0a8c69..707138cb469 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentTextPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentTextPresentationEndpoint.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs index 8d1d0392421..bf3978fb76f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/TextDocumentUriPresentationEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentPresentation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs index e64bb4e1df1..2f90d525fb5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Tagging; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSymbols; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs index afd1da50b3c..569a325ac1f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSynchronization; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidCloseEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidCloseEndpoint.cs index f167f64356b..0ebddd56f73 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidCloseEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidCloseEndpoint.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.CodeAnalysis.Razor; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSynchronization; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs index 8af40ddf029..dc724c75fbc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSynchronization; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidSaveEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidSaveEndpoint.cs index 19cadfb93e8..c53d34cafbb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidSaveEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidSaveEndpoint.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSynchronization; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IDidChangeConfigurationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IDidChangeConfigurationEndpoint.cs index 9eb0fd97dc3..65fe3a2f68b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IDidChangeConfigurationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IDidChangeConfigurationEndpoint.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; [RazorLanguageServerEndpoint(Methods.WorkspaceDidChangeConfigurationName)] diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IRazorRequestHandler.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IRazorRequestHandler.cs index 42440bf86ab..6e35df1ee9e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IRazorRequestHandler.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/IRazorRequestHandler.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 167a0c55101..ee96e827e70 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -30,7 +30,6 @@ using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Extensions; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs index b3b9da23856..4d857727aeb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.FindAllReferences; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs index d94e078be6b..42f80f9c91e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Folding; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Folding; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs index 88b790cac64..65d36ed0499 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormatter.cs @@ -14,8 +14,6 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPass.cs index ae44807e53d..407d5875d08 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPass.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs index 098e56d3a77..89d17ad85ec 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpFormattingPassBase.cs @@ -13,8 +13,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs index 2c2d6677dae..431c50a7ff1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/CSharpOnTypeFormattingPass.cs @@ -19,8 +19,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentFormattingEndpoint.cs index 1c074702874..7f7606d473a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentFormattingEndpoint.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs index 71389874fcc..a534aafd87f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentRangeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentRangeFormattingEndpoint.cs index 414a1bf1ef5..6da4c776ec9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentRangeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentRangeFormattingEndpoint.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs index ec990b20f27..b6e46c58da2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContentValidationPass.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContext.cs index 9e1c13b6e92..f1e1cec1028 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingContext.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingDiagnosticValidationPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingDiagnosticValidationPass.cs index ed7d5014b05..64d54a9a33a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingDiagnosticValidationPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingDiagnosticValidationPass.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingOptionsExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingOptionsExtensions.cs index 5271e0f9ec1..6c6aa6f8ab3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingOptionsExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingOptionsExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs index 79a5af2ee64..5ae7cb2d988 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingPassBase.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingResult.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingResult.cs index 7dc0c87c222..46067d90266 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingResult.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/FormattingResult.cs @@ -3,7 +3,6 @@ using System; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs index 288afdeacac..bd3e7177b23 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Formatting; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs index 988494d9858..f4494c1aaf2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs index 9048b915931..1b083959198 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs index 389a1d71d50..4a2cf9a7e6b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs index 89f49f0bf5e..f0e5318328a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs @@ -12,8 +12,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs index 4799f85575e..fc6b2c80e2c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerCapability.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerCapability.cs index 0eac8fb6c58..74ffb3e9ebf 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerCapability.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerCapability.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Text.Json; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hosting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerHost.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerHost.cs index 56e9cb461b9..bb53b2b3444 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerHost.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/RazorLanguageServerHost.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.Extensions.DependencyInjection; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hosting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs index 83b32a3dd23..a12054ad5e8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Razor.SemanticTokens; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hosting; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs index 956c0fec725..aca0ec495fb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.TestAccessor.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.TestAccessor.cs index c78299255ad..2648847ea86 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.TestAccessor.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.TestAccessor.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs index 218e474e2a2..651010b0a12 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs @@ -17,10 +17,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Tooltip; using Microsoft.VisualStudio.Editor.Razor; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Adornments; -using MarkupKind = Microsoft.VisualStudio.LanguageServer.Protocol.MarkupKind; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs index 5408dd8f17d..f0140439629 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs index c575fc47796..17e28d5168e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IOnInitialized.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IOnInitialized.cs index 0dfd09f719d..08921fa1db6 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IOnInitialized.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IOnInitialized.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs index fc5c3807078..293b5652077 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using ImplementationResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< Microsoft.VisualStudio.LanguageServer.Protocol.Location[], Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalReferenceItem[]>; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs index 54865b68151..d3f0b2d10aa 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintEndpoint.cs index 3a4f746604a..894559f8f39 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintEndpoint.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintResolveEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintResolveEndpoint.cs index 1f5b6cf999d..7432376bc5e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintResolveEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintResolveEndpoint.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs index c0debade37d..4459e7a94f8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces.InlayHints; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/RazorInlayHintWrapper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/RazorInlayHintWrapper.cs index 8d21b84e325..9386a65f42a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/RazorInlayHintWrapper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/RazorInlayHintWrapper.cs @@ -3,7 +3,6 @@ using System.Text.Json.Serialization; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Workspaces.InlayHints; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs index 9593b528e87..1bac93d63cd 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs @@ -19,7 +19,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Completion; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.InlineCompletion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LinkedEditingRange/LinkedEditingRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LinkedEditingRange/LinkedEditingRangeEndpoint.cs index 977805958e8..06277e48ac1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LinkedEditingRange/LinkedEditingRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LinkedEditingRange/LinkedEditingRangeEndpoint.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.LinkedEditingRange; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.LinkedEditingRange; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs index 5887fa977fa..47567f00ee5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs @@ -22,7 +22,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Location = Microsoft.VisualStudio.LanguageServer.Protocol.Location; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs index d5981471507..edd26152e62 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.MapCode.Mappers; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs index b4e6da2b476..d0cb3455c21 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Mapping; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryParams.cs index 87b292a0911..49e4aa8c8f3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryParams.cs @@ -4,7 +4,6 @@ using System; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Mapping; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryResponse.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryResponse.cs index 584ff8e63d9..daac058f926 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryResponse.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryResponse.cs @@ -3,7 +3,6 @@ using System.Text.Json.Serialization; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Mapping; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs index 1ab59705e3f..ed24c8a561d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs @@ -10,8 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Mapping; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs index 3bd88203f85..79d505ccac3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs @@ -6,7 +6,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectContexts/ProjectContextsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectContexts/ProjectContextsEndpoint.cs index 7be2146e3a7..4d34108c12b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectContexts/ProjectContextsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectContexts/ProjectContextsEndpoint.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectContexts; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorConfigurationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorConfigurationEndpoint.cs index 57e8793dd49..6105ce85c64 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorConfigurationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorConfigurationEndpoint.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializeEndpoint.cs index 205cafb4345..51147b32448 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializeEndpoint.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializedEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializedEndpoint.cs index 277533d056c..8ae9c79918b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializedEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializedEndpoint.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs index 3383b82b7cb..560fe83a80a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs index 2ece256074c..8de141409b2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Refactoring/RenameEndpoint.cs @@ -21,7 +21,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Refactoring; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs index c75e1b44112..1ce6da5c381 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/SemanticTokensRangeEndpoint.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs index f507b9104a0..7fab9a6f0f3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Semantic/Services/LSPCSharpSemanticTokensProvider.cs @@ -14,8 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs index 790cd537f07..f06cde3cf74 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.SignatureHelp; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs index ca84457a042..60d0332d046 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.SpellCheck; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/WorkspaceSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/WorkspaceSpellCheckEndpoint.cs index ae7a2195b0f..2b7ed9b8bfa 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/WorkspaceSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/WorkspaceSpellCheckEndpoint.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.Threading; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.SpellCheck; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs index e51fbbdcb2e..14ba1853e45 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/LSPTagHelperTooltipFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/LSPTagHelperTooltipFactory.cs index e8dc72e35ef..af0dc26bb6a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/LSPTagHelperTooltipFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/LSPTagHelperTooltipFactory.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs index af8ae8a3d26..186f4eb9c32 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WorkspaceSemanticTokensRefreshNotifier.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs index b290be86aef..5aad831013f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.WrapWithTag; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs index 65892849b52..68a74a73b74 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs @@ -2,8 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using Newtonsoft.Json; namespace Microsoft.AspNetCore.Razor.LanguageServer.WrapWithTag; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs index 1f580332c7d..a4130b83329 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.WrapWithTag; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DebuggerDisplay.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DebuggerDisplay.cs index 986350fb436..c0058d8d05c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DebuggerDisplay.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DebuggerDisplay.cs @@ -2,6 +2,5 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Diagnostics; -using Microsoft.VisualStudio.LanguageServer.Protocol; [assembly: DebuggerDisplay("{Label} ({Kind})", Target = typeof(CompletionItem))] diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs index 96f490aa9cd..11ca138901c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractRazorDocumentMappingService.cs @@ -17,7 +17,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs index cfc2ad81629..6aef65fc328 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingService.cs index 358235732a6..31acd7b0b49 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingService.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs index 13d96a0790e..3040e018053 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IRazorDocumentMappingServiceExtensions.cs @@ -9,8 +9,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/AbstractSyntaxNodeFoldingProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/AbstractSyntaxNodeFoldingProvider.cs index 58e81b4112c..36fed29db91 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/AbstractSyntaxNodeFoldingProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/AbstractSyntaxNodeFoldingProvider.cs @@ -1,15 +1,16 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. + using System.Collections.Immutable; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; + internal abstract class AbstractSyntaxNodeFoldingProvider : IRazorFoldingRangeProvider where TNode : RazorSyntaxNode { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/FoldingRangeService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/FoldingRangeService.cs index def3567e4b3..246d8c77399 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/FoldingRangeService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/FoldingRangeService.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IFoldingRangeService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IFoldingRangeService.cs index 2f28b71db11..681cc651fbb 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IFoldingRangeService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IFoldingRangeService.cs @@ -4,7 +4,6 @@ using System.Collections.Immutable; using System.Threading; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IRazorFoldingRangeProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IRazorFoldingRangeProvider.cs index 857d6f4e8bc..e2bba9fb000 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IRazorFoldingRangeProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/IRazorFoldingRangeProvider.cs @@ -3,7 +3,6 @@ using System.Collections.Immutable; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/RazorFileUsingsFoldingSyntaxWalker.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/RazorFileUsingsFoldingSyntaxWalker.cs index 6dd4a046bf8..6d0618f0535 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/RazorFileUsingsFoldingSyntaxWalker.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/RazorFileUsingsFoldingSyntaxWalker.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/UsingsFoldingRangeProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/UsingsFoldingRangeProvider.cs index b04767e106f..925e70e64f2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/UsingsFoldingRangeProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/FoldingRanges/UsingsFoldingRangeProvider.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.FoldingRanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ICapabilitiesProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ICapabilitiesProvider.cs index e878ebdcd02..1bd61eb7102 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ICapabilitiesProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ICapabilitiesProvider.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.AspNetCore.Razor.LanguageServer; internal interface ICapabilitiesProvider diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs index 36a01ebd20f..7771b82d93c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs index 6eb544326ec..1271a6b89fd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs index 519212b9df7..e15ef4aa6f6 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs index b203540027e..deae82a1e75 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs @@ -3,7 +3,6 @@ using System; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/FormatNewFileParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/FormatNewFileParams.cs index 6c2f5d4b282..4fa3b5b7fbd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/FormatNewFileParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/FormatNewFileParams.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/RazorResolveCodeActionParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/RazorResolveCodeActionParams.cs index 4ecf43d0505..5e82598af39 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/RazorResolveCodeActionParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/RazorResolveCodeActionParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/SimplifyMethodParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/SimplifyMethodParams.cs index 516afa1fd4d..2a25dd30c47 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/SimplifyMethodParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/SimplifyMethodParams.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs index ae017574b92..b4b892e4671 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentation.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentation.cs index d8f678ac6bc..28b363af3c1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentation.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentation.cs @@ -4,7 +4,6 @@ #nullable disable using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentationParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentationParams.cs index e56dfddec45..11a2cfc3ce4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentationParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/ColorPresentationParams.cs @@ -4,7 +4,6 @@ #nullable disable using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/DelegatedDocumentColorParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/DelegatedDocumentColorParams.cs index 89729afc428..6c5709be2a3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/DelegatedDocumentColorParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ColorPresentation/DelegatedDocumentColorParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorInlineCompletionRequest.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorInlineCompletionRequest.cs index 2c4a0a6b689..07aaf76af78 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorInlineCompletionRequest.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorInlineCompletionRequest.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Completion; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs index f486bc6230f..cd1b8c17480 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs @@ -3,7 +3,6 @@ using System; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Debugging; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs index c12d63eb605..cfafecfbd05 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Debugging; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs index d56edee55b7..edbd8a9219b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs @@ -3,7 +3,6 @@ using System; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Debugging; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs index ff1b67da580..fee959c6efa 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs @@ -10,7 +10,6 @@ namespace Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; internal record DelegatedSpellCheckParams( [property: JsonPropertyName("identifier")] TextDocumentIdentifierAndVersion Identifier); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Diagnostics/RazorPullDiagnosticResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Diagnostics/RazorPullDiagnosticResponse.cs index 91ee4523003..a619552fde2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Diagnostics/RazorPullDiagnosticResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Diagnostics/RazorPullDiagnosticResponse.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs index d54f064a04a..2dbe5a47bf8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using static Roslyn.LanguageServer.Protocol.LspExtensions; using RoslynDocumentHighlight = Roslyn.LanguageServer.Protocol.DocumentHighlight; using VsDocumentHighlight = Microsoft.VisualStudio.LanguageServer.Protocol.DocumentHighlight; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs index d9bc9acc59c..78137566d81 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesParams.cs @@ -4,7 +4,6 @@ using System; using System.Text.Json.Serialization; using Microsoft.CodeAnalysis.Razor.DocumentMapping; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs index 60e5f99fbc4..8692fa83020 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs index 374c2f7c136..9e3916a3254 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; internal interface IPresentationParams diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/TextPresentationParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/TextPresentationParams.cs index 8e5efe7327d..dde9959fc0a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/TextPresentationParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/TextPresentationParams.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; /// diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/UriPresentationParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/UriPresentationParams.cs index 0bd8aa3fe21..aab83fadf5b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/UriPresentationParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/UriPresentationParams.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; /// diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeRequestParam.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeRequestParam.cs index 90b07fe6ad2..6b73e90c6b1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeRequestParam.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeRequestParam.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Folding; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeResponse.cs index b08e8a162c7..c39b0968321 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RazorFoldingRangeResponse.cs @@ -3,7 +3,6 @@ using System.Collections.Immutable; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Folding; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RemoteFoldingRange.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RemoteFoldingRange.cs index 59d83bb8603..ea5883997db 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RemoteFoldingRange.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Folding/RemoteFoldingRange.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Runtime.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Folding; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingParams.cs index c4a4f7cceb3..d7b3047ba22 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Formatting; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingResponse.cs index b9cb31f7344..4601480b045 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentFormattingResponse.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Formatting; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentOnTypeFormattingParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentOnTypeFormattingParams.cs index 818c49d9197..3162fbec804 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentOnTypeFormattingParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Formatting/RazorDocumentOnTypeFormattingParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol.Formatting; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/IClientCapabilitiesService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/IClientCapabilitiesService.cs index c8d26fd18c6..53c5c1aa096 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/IClientCapabilitiesService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/IClientCapabilitiesService.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.VisualStudio.LanguageServer.Protocol; - namespace Microsoft.CodeAnalysis.Razor.Protocol; internal interface IClientCapabilitiesService diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs index 4a47066f3b8..b2d4d72078e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs @@ -3,8 +3,6 @@ using System; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs index 10864b93015..f6f7239723d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/TextDocumentIdentifierAndVersion.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/TextDocumentIdentifierAndVersion.cs index 90156f1ab1d..dac57219617 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/TextDocumentIdentifierAndVersion.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/TextDocumentIdentifierAndVersion.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Protocol; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs index b3f61e9e008..e740560262f 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.Text; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs index e832f7561d8..9dc3095ef81 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostFoldingRangeEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostFoldingRangeEndpoint.cs index be3ab94f529..206029360da 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostFoldingRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostFoldingRangeEndpoint.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Folding; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostLinkedEditingRangeEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostLinkedEditingRangeEndpoint.cs index f1f42f472dc..d18514cbbdf 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostLinkedEditingRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostLinkedEditingRangeEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSemanticTokensRangeEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSemanticTokensRangeEndpoint.cs index 77504ae52e2..d2ad1dd28f5 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSemanticTokensRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSemanticTokensRangeEndpoint.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using Microsoft.VisualStudio.Razor.Settings; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs index 030a6bec70c..1015b78c820 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient; using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs index 4582ca61358..4a7ac791ebb 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/IDynamicRegistrationProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/IDynamicRegistrationProvider.cs index d3c23b8d4c7..e4574aa45df 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/IDynamicRegistrationProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/IDynamicRegistrationProvider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostClientCapabilitiesService.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostClientCapabilitiesService.cs index cde4f43bbd8..8354226b4ee 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostClientCapabilitiesService.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostClientCapabilitiesService.cs @@ -4,7 +4,6 @@ using System; using System.ComponentModel.Composition; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostDynamicRegistrationService.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostDynamicRegistrationService.cs index 29d86c5cb60..c5b63e2ccf7 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostDynamicRegistrationService.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/RazorCohostDynamicRegistrationService.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs index 0e8a266c328..bd294670d09 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs @@ -9,8 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs index 1452ca9f165..494937c74c8 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs index 690631253fe..555962772bc 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs @@ -8,10 +8,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs index e271c871aea..49c17fb9956 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs index 0c1a05b4b7b..f78eaae24c4 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs index 20747767e8a..930034ba513 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs index 1663a966be4..fb21d226b15 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProvider.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs index 16e5bf80dd2..7bd730ada6e 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/DocumentMapping/LSPDocumentMappingProvider.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs index 1ae779026f7..45303931715 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Razor.Snippets; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_CodeActions.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_CodeActions.cs index 60384baa0af..cf329b4a649 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_CodeActions.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_CodeActions.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs index 329f5b82375..168ea5cf15c 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Completion; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using Microsoft.VisualStudio.Razor.Snippets; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Diagnostics.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Diagnostics.cs index 0ac519a37af..0d9755b548d 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Diagnostics.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Diagnostics.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentColor.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentColor.cs index c43276e66bf..a3657435fa9 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentColor.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentColor.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentSymbol.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentSymbol.cs index 99ffec04426..c67ce0e2850 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentSymbol.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_DocumentSymbol.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FoldingRange.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FoldingRange.cs index a9be7721d86..d82a59e8c7d 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FoldingRange.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FoldingRange.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Folding; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_HtmlFormatting.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_HtmlFormatting.cs index a50e120f2e8..3a6a703602f 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_HtmlFormatting.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_HtmlFormatting.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Formatting; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_InlayHints.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_InlayHints.cs index 0930e048132..14405577086 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_InlayHints.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_InlayHints.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs index bf8e5a895ee..eb2c49ebc06 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_MapCode.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_OnAutoInsert.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_OnAutoInsert.cs index 603053b273d..d94aa3913d6 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_OnAutoInsert.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_OnAutoInsert.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Presentation.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Presentation.cs index db045614f14..9d2337ff89a 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Presentation.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Presentation.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ProjectContexts.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ProjectContexts.cs index 4b3923fc082..3afe12c8fb6 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ProjectContexts.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ProjectContexts.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.DynamicFiles; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Rename.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Rename.cs index 4bb2b66677d..fd8a5ec1e38 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Rename.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Rename.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs index 1d895280ad4..1c2b4f502b5 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SimplifyMethod.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SimplifyMethod.cs index f1ac1f0567e..5ba517d603e 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SimplifyMethod.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SimplifyMethod.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SpellCheck.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SpellCheck.cs index ba4b1a825fc..09880731e09 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SpellCheck.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SpellCheck.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs index 5c11db83526..9ddbad0386e 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ValidateBreakpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ValidateBreakpoint.cs index c0e2ce15b1e..11d3394c450 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ValidateBreakpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_ValidateBreakpoint.cs @@ -4,7 +4,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WorkspaceConfiguration.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WorkspaceConfiguration.cs index 0cc9fd60ae4..8e948c297aa 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WorkspaceConfiguration.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WorkspaceConfiguration.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WrapWithTag.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WrapWithTag.cs index 580c41628e3..9a87e888a71 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WrapWithTag.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_WrapWithTag.cs @@ -6,7 +6,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.WrapWithTag; using StreamJsonRpc; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Extensions/TextDocumentExtensions.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Extensions/TextDocumentExtensions.cs index 14c3bd36ce5..a4116aab58b 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Extensions/TextDocumentExtensions.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Extensions/TextDocumentExtensions.cs @@ -3,7 +3,6 @@ using System; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Extensions; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs index b2f6692ba35..ec1f2d95c09 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Newtonsoft.Json.Linq; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorLSPSpanMappingService.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorLSPSpanMappingService.cs index 5775f527c9c..314fdd9ad07 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorLSPSpanMappingService.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorLSPSpanMappingService.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; using Microsoft.VisualStudio.Text; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WorkspaceConfigurationChangedListener.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WorkspaceConfigurationChangedListener.cs index a2ec0e79fdc..63fa7529943 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WorkspaceConfigurationChangedListener.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WorkspaceConfigurationChangedListener.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Settings; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagParams.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagParams.cs index b9b4d7ff394..a34dfdfa905 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagParams.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagParams.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.WrapWithTag; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagResponse.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagResponse.cs index 35316bc2909..5d6f34aea75 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagResponse.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/WrapWithTag/VSInternalWrapWithTagResponse.cs @@ -3,7 +3,6 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.WrapWithTag; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs index 6ae6e6bdb80..f31d255a157 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs index 4e71963389a..9c379a05f7b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.LanguageServer.Test; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs index 5b72597e19c..bccca45834f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs index cef29ea2d43..db4e19718f0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/AddUsingsCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/AddUsingsCodeActionResolverTest.cs index 7d22fc8ee82..40355525374 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/AddUsingsCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/AddUsingsCodeActionResolverTest.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs index 2d9ca497c73..a84f05c7507 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs index 2dc1288ab2b..777cf9a19b3 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionResolverTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs index 4432a1bf83e..f930b4fa407 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs index 2196a72ccfa..2da62f6d05c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs @@ -28,7 +28,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs index 76515aa9b92..b378d30988a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndpointTest.cs @@ -19,7 +19,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionResolutionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionResolutionEndpointTest.cs index e84c93d22e0..d1451bf9173 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionResolutionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionResolutionEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs index 8c21b56f374..57678844573 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs index 2d7d9b67d38..9216e59f2b5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionResolverTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs index cc0f250405f..5b972ba7a63 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/CreateComponentCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/CreateComponentCodeActionResolverTest.cs index f44e40ddd6f..b6c5a8cfb4e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/CreateComponentCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/CreateComponentCodeActionResolverTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs index 61c8fb4efed..7c67a61ecfe 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionResolverTest.cs index 5b3fce18457..f2df3f19a90 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionResolverTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListCacheTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListCacheTest.cs index e8e4168611b..800f678c403 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListCacheTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListCacheTest.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListMergerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListMergerTest.cs index ee70ac5c7b0..ae2b9078ef2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListMergerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListMergerTest.cs @@ -5,7 +5,6 @@ using System.Linq; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListOptimizerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListOptimizerTest.cs index 9d37f1f9655..d5931b10210 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListOptimizerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListOptimizerTest.cs @@ -4,7 +4,6 @@ #nullable disable using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs index e3f63cfb270..1ff8ecb0a0d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultLSPTagHelperTooltipFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultLSPTagHelperTooltipFactoryTest.cs index d1d4854cdae..0304ad0d85a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultLSPTagHelperTooltipFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultLSPTagHelperTooltipFactoryTest.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs index a1f9ba82ff2..357ab409326 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs @@ -17,7 +17,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs index d51767f48ad..44b17f844f9 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs index 9a1ff7556f7..2a59f285163 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs index 098d1a3f090..b7767a05c38 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs @@ -7,7 +7,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs index 66225461c0c..040a3081db2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs @@ -6,7 +6,6 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs index 78f23228bcc..82c45e335e9 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; using Microsoft.CodeAnalysis.Testing; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs index bb8dee4338e..3bdfc83db66 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs index 2696cfe185b..e636426102a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs @@ -4,7 +4,6 @@ #nullable disable using System.Threading.Tasks; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DirectiveVerifier.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DirectiveVerifier.cs index 586a8d25dd7..3047a241ece 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DirectiveVerifier.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DirectiveVerifier.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis.Razor.Completion; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs index f145c1ca53e..e7190256115 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionEndpointTest.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionItemResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionItemResolverTest.cs index 7d1ff4b8bed..e6bf7abfac2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionItemResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionItemResolverTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Completion; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs index cd809b718d3..cafbed46a4c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Completion; using Microsoft.CodeAnalysis.Razor.Tooltip; using Microsoft.CodeAnalysis.Testing; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; using static Microsoft.AspNetCore.Razor.Language.CommonMetadata; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs index 8586d5b9635..56a4bff1f9f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/TestDocumentMappingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/TestDocumentMappingService.cs index 2e384656518..7e51b223495 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/TestDocumentMappingService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/TestDocumentMappingService.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs index d2c5921b3c9..582cad2b553 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs index 3cd6acb4f6b..688a5c97b97 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs index 99e05e6190a..de15137c695 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/ValidateBreakpointRangeEndpointTest.cs @@ -10,11 +10,9 @@ using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultRazorConfigurationServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultRazorConfigurationServiceTest.cs index 29048394810..e06c649a43a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultRazorConfigurationServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultRazorConfigurationServiceTest.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultWorkspaceDirectoryPathResolverTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultWorkspaceDirectoryPathResolverTest.cs index 704de2c824a..6616a712ba5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultWorkspaceDirectoryPathResolverTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultWorkspaceDirectoryPathResolverTest.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs index 7526d0b052b..bc913d0cbca 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointTest.cs index ebfb6b65708..8094f7ca450 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointTest.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs index 8122d21ac0e..b26579379b8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs index b5d4b12c60a..fd17aef5438 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs index 0b40950b057..befff92f65c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs index 543e90e278b..9011fd45176 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs index 59b5b074499..20fd7b1ad3b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs index a2072787e14..62f80643170 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentTextPresentationEndpointTests.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs index 30df2ebf408..91b1c7efba8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs @@ -14,7 +14,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs index f8cbf5683e3..de6185c4fc3 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs index b80ba2f8b69..7702de65367 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidCloseEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidCloseEndpointTest.cs index 8725a99107b..3d1978d5ae8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidCloseEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidCloseEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs index 4867629a6f9..5b6d7612352 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs index ff0cc641c58..45490846c14 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs @@ -8,7 +8,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs index 4bafb189d06..4ec5e65c334 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs index 1fdb5d79ae8..3e832bda50b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentRangeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentRangeFormattingEndpointTest.cs index 964ed2d0ef8..1d1c63cac14 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentRangeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentRangeFormattingEndpointTest.cs @@ -4,7 +4,6 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index a463f8fbea6..20f074012bd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index 7a36ce7ae5d..c81eb79af71 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs index daf60dbe6fd..a86f857a799 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Formatting; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Utilities; using Microsoft.WebTools.Languages.Shared.ContentTypes; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs index 95b89f2a2db..7873ed1c405 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs @@ -12,9 +12,7 @@ using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit.Abstractions; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 8e3bef3a2e0..d4a09040768 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -22,7 +22,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Roslyn.Test.Utilities; using Xunit; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs index a61de35e8b0..b9c09d12568 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs @@ -6,7 +6,6 @@ using System.Linq; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentPublisherTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentPublisherTest.cs index e2fa1ae18e1..dc56469a0af 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentPublisherTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentPublisherTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index 1c533c81c72..3c358abc519 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -22,7 +22,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Adornments; using Moq; using Xunit; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs index 0dedf24fcda..31687eaf8ff 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs index b58e504a512..a1328dca382 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/LinkedEditingRange/LinkedEditingRangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/LinkedEditingRange/LinkedEditingRangeEndpointTest.cs index f4aad3eeca9..d7b5d2c4848 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/LinkedEditingRange/LinkedEditingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/LinkedEditingRange/LinkedEditingRangeEndpointTest.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Completion; using Microsoft.CodeAnalysis.Razor.LinkedEditingRange; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs index ba8a4a7fce8..92c854be428 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs @@ -15,7 +15,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs index f788b4c06fd..ae1be6f6e11 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs index ed5683d7d7e..7a82047fd71 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs index 8a17f7af7d4..e46ad15e7a0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.ProjectContexts; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs index 6e11b326a24..54ffd326cb3 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RangeExtensionsTests.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; namespace Microsoft.AspNetCore.Razor.LanguageServer.Test; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorConfigurationEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorConfigurationEndpointTest.cs index c044d347085..5a597d5c2c8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorConfigurationEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorConfigurationEndpointTest.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorFileChangeDetectorManagerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorFileChangeDetectorManagerTest.cs index bcb359d3616..b95567533bb 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorFileChangeDetectorManagerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorFileChangeDetectorManagerTest.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorLanguageServerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorLanguageServerTest.cs index 3fc2585b22d..b62b7e0fde4 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorLanguageServerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorLanguageServerTest.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Nerdbank.Streams; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs index f11cb0b851f..68023ebf9ef 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 4ff2ec8d1f8..f185797058d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -24,7 +24,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensRefreshEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensRefreshEndpointTest.cs index ef79b93360f..d95f5bc3f4a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensRefreshEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensRefreshEndpointTest.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs index 4c460d0cffd..d3aaa85f5d7 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs @@ -28,7 +28,6 @@ using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Serialization/PlatformAgnosticClientCapabilitiesJsonConverterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Serialization/PlatformAgnosticClientCapabilitiesJsonConverterTest.cs index 8d2f84072f0..84d5b73fd84 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Serialization/PlatformAgnosticClientCapabilitiesJsonConverterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Serialization/PlatformAgnosticClientCapabilitiesJsonConverterTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text.Json; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; namespace Microsoft.AspNetCore.Razor.LanguageServer.Serialization; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs index b794fc1ece3..64e18140443 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs index ff1b414a209..1f260dac179 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; using Microsoft.CodeAnalysis.Razor.Protocol.Folding; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs index 6d5d6cca9a2..8f28216b150 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs index 72f9c894e4f..ceba29ef96e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestClient.cs index c99ebf5cd55..436855cc6c8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestClient.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WorkspaceSemanticTokensRefreshNotifierTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WorkspaceSemanticTokensRefreshNotifierTest.cs index 3cf9d0fbc02..f604e190c91 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WorkspaceSemanticTokensRefreshNotifierTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WorkspaceSemanticTokensRefreshNotifierTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs index 4853d918edd..d16bc53a40c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs @@ -12,7 +12,6 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs index f264cad399e..f3559f2fd8d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs @@ -12,10 +12,8 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.VisualStudio.Composition; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Nerdbank.Streams; using StreamJsonRpc; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs index 591df7ed021..1d7fd6bd3f8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs @@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; From 9792de5e57c38d917a2b2e3b0d9119e3dd6176dc Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 13:34:41 +1000 Subject: [PATCH 007/223] More Range -> LspRange --- .../Delegation/TextEditResponseRewriter.cs | 2 +- .../ValidateBreakpointRangeEndpoint.cs | 8 ++--- .../Formatting/IRazorFormattingService.cs | 2 +- .../Formatting/RazorFormattingPass.cs | 4 +-- .../InlayHints/IInlayHintService.cs | 2 +- .../InlayHints/InlayHintService.cs | 2 +- .../WrapWithTag/WrapWithTagParams.cs | 2 +- .../WrapWithTag/WrapWithTagResponse.cs | 2 +- .../Extensions/LspExtensions_LinePosition.cs | 2 +- .../LspExtensions_LinePositionSpan.cs | 2 +- .../Extensions/LspExtensions_Position.cs | 2 +- .../Extensions/LspExtensions_Range.cs | 32 ++++++++--------- .../Extensions/LspExtensions_SourceText.cs | 10 +++--- .../Extensions/LspExtensions_SyntaxNode.cs | 4 +-- .../Extensions/LspFactory.cs | 36 +++++++++---------- .../CodeActions/VSCodeActionParams.cs | 2 +- .../Debugging/RazorBreakpointSpanResponse.cs | 2 +- .../Protocol/DelegatedTypes.cs | 4 +-- .../RazorMapToDocumentRangesResponse.cs | 2 +- .../IPresentationParams.cs | 2 +- .../SemanticTokensRangesParams.cs | 2 +- .../Debugging/LSPBreakpointSpanProvider.cs | 2 +- .../TextEditResponseRewriterTest.cs | 2 +- 23 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs index ac6bb4aaebd..d14fe2306f4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/TextEditResponseRewriter.cs @@ -82,7 +82,7 @@ private static VSInternalCompletionList TranslateTextEdits( return completionList; } - private static Range TranslateRange(Position hostDocumentPosition, Position projectedPosition, Range textEditRange) + private static LspRange TranslateRange(Position hostDocumentPosition, Position projectedPosition, LspRange textEditRange) { var offset = projectedPosition.Character - hostDocumentPosition.Character; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs index 7e4cb4a209b..ecbecd8f854 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs @@ -20,7 +20,7 @@ internal class ValidateBreakpointRangeEndpoint( LanguageServerFeatureOptions languageServerFeatureOptions, IClientConnection clientConnection, ILoggerFactory loggerFactory) - : AbstractRazorDelegatingEndpoint( + : AbstractRazorDelegatingEndpoint( languageServerFeatureOptions, documentMappingService, clientConnection, @@ -37,10 +37,10 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V serverCapabilities.EnableValidateBreakpointRange(); } - protected override Task TryHandleAsync(ValidateBreakpointRangeParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + protected override Task TryHandleAsync(ValidateBreakpointRangeParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) { // no such thing as Razor breakpoints (yet?!) - return SpecializedTasks.Null(); + return SpecializedTasks.Null(); } protected async override Task CreateDelegatedParamsAsync(ValidateBreakpointRangeParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) @@ -71,7 +71,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V positionInfo.LanguageKind); } - protected async override Task HandleDelegatedResponseAsync(Range? delegatedResponse, ValidateBreakpointRangeParams originalRequest, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + protected async override Task HandleDelegatedResponseAsync(LspRange? delegatedResponse, ValidateBreakpointRangeParams originalRequest, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) { if (delegatedResponse is null) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs index 1b083959198..5eb363ca31c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs @@ -12,7 +12,7 @@ internal interface IRazorFormattingService { Task FormatAsync( VersionedDocumentContext documentContext, - Range? range, + LspRange? range, FormattingOptions options, CancellationToken cancellationToken); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs index 4a2cf9a7e6b..4c2584529cc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingPass.cs @@ -421,7 +421,7 @@ closeBraceRange is not null && return didFormat; - static bool RangeHasBeenModified(IList edits, Range range) + static bool RangeHasBeenModified(IList edits, LspRange range) { // Because we don't always know what kind of Razor object we're operating on we have to do this to avoid duplicate edits. // The other way to accomplish this would be to apply the edits after every node and function, but that's not in scope for my current work. @@ -430,7 +430,7 @@ static bool RangeHasBeenModified(IList edits, Range range) return hasBeenModified; } - static int GetAdditionalIndentationLevel(FormattingContext context, Range range, SyntaxNode openBraceNode, SyntaxNode codeNode) + static int GetAdditionalIndentationLevel(FormattingContext context, LspRange range, SyntaxNode openBraceNode, SyntaxNode codeNode) { if (!context.TryGetIndentationLevel(codeNode.Position, out var desiredIndentationLevel)) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs index d3f0b2d10aa..1906699be9c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; internal interface IInlayHintService { - Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, Range range, CancellationToken cancellationToken); + Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, LspRange range, CancellationToken cancellationToken); Task ResolveInlayHintAsync(IClientConnection clientConnection, InlayHint inlayHint, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs index 4459e7a94f8..c39cc1713ef 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs @@ -21,7 +21,7 @@ internal sealed class InlayHintService(IRazorDocumentMappingService documentMapp { private readonly IRazorDocumentMappingService _documentMappingService = documentMappingService; - public async Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, Range range, CancellationToken cancellationToken) + public async Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, LspRange range, CancellationToken cancellationToken) { var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var csharpDocument = codeDocument.GetCSharpDocument(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs index 68a74a73b74..d2d1900bb63 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagParams.cs @@ -20,7 +20,7 @@ internal class WrapWithTagParams /// Gets or sets the selection range to be wrapped. /// [JsonPropertyName("_vs_range")] - public Range? Range { get; set; } + public LspRange? Range { get; set; } /// /// Gets or sets the wrapping tag name. diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs index a4130b83329..5d9eb3d1f6c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagResponse.cs @@ -14,7 +14,7 @@ internal class WrapWithTagResponse /// Gets or sets the range of the wrapping tag. /// [JsonPropertyName("_vs_tagRange")] - public Range? TagRange { get; set; } + public LspRange? TagRange { get; set; } /// /// Gets or sets the text edits. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs index 0eee990af2f..38050f87ca5 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs @@ -10,6 +10,6 @@ internal static partial class LspExtensions public static Position ToPosition(this LinePosition linePosition) => LspFactory.CreatePosition(linePosition.Line, linePosition.Character); - public static Range ToZeroWidthRange(this LinePosition position) + public static LspRange ToZeroWidthRange(this LinePosition position) => LspFactory.CreateZeroWidthRange(position); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs index 84fbf51ceb8..66422294e98 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs @@ -7,6 +7,6 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; internal static partial class LspExtensions { - public static Range ToRange(this LinePositionSpan linePositionSpan) + public static LspRange ToRange(this LinePositionSpan linePositionSpan) => LspFactory.CreateRange(linePositionSpan); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs index e134672b0a9..5156ecc9c3e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs @@ -13,7 +13,7 @@ public static void Deconstruct(this Position position, out int line, out int cha public static LinePosition ToLinePosition(this Position position) => new(position.Line, position.Character); - public static Range ToZeroWidthRange(this Position position) + public static LspRange ToZeroWidthRange(this Position position) => LspFactory.CreateZeroWidthRange(position); public static int CompareTo(this Position position, Position other) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs index 7e2d82e730c..0a5a07f8583 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs @@ -7,16 +7,16 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; internal static partial class LspExtensions { - public static void Deconstruct(this Range range, out Position start, out Position end) + public static void Deconstruct(this LspRange range, out Position start, out Position end) => (start, end) = (range.Start, range.End); - public static void Deconstruct(this Range range, out int startLine, out int startCharacter, out int endLine, out int endCharacter) + public static void Deconstruct(this LspRange range, out int startLine, out int startCharacter, out int endLine, out int endCharacter) => (startLine, startCharacter, endLine, endCharacter) = (range.Start.Line, range.Start.Character, range.End.Line, range.End.Character); - public static LinePositionSpan ToLinePositionSpan(this Range range) + public static LinePositionSpan ToLinePositionSpan(this LspRange range) => new(range.Start.ToLinePosition(), range.End.ToLinePosition()); - public static bool IntersectsOrTouches(this Range range, Range other) + public static bool IntersectsOrTouches(this LspRange range, LspRange other) { if (range.IsBefore(other)) { @@ -31,18 +31,18 @@ public static bool IntersectsOrTouches(this Range range, Range other) return true; } - private static bool IsBefore(this Range range, Range other) => + private static bool IsBefore(this LspRange range, LspRange other) => range.End.Line < other.Start.Line || (range.End.Line == other.Start.Line && range.End.Character < other.Start.Character); - private static bool IsAfter(this Range range, Range other) => + private static bool IsAfter(this LspRange range, LspRange other) => other.End.Line < range.Start.Line || (other.End.Line == range.Start.Line && other.End.Character < range.Start.Character); - public static bool OverlapsWith(this Range range, Range other) + public static bool OverlapsWith(this LspRange range, LspRange other) { return range.ToLinePositionSpan().OverlapsWith(other.ToLinePositionSpan()); } - public static bool LineOverlapsWith(this Range range, Range other) + public static bool LineOverlapsWith(this LspRange range, LspRange other) { var overlapStart = range.Start.Line; if (range.Start.Line.CompareTo(other.Start.Line) < 0) @@ -59,33 +59,33 @@ public static bool LineOverlapsWith(this Range range, Range other) return overlapStart.CompareTo(overlapEnd) <= 0; } - public static bool Contains(this Range range, Range other) + public static bool Contains(this LspRange range, LspRange other) { return range.Start.CompareTo(other.Start) <= 0 && range.End.CompareTo(other.End) >= 0; } - public static bool SpansMultipleLines(this Range range) + public static bool SpansMultipleLines(this LspRange range) { return range.Start.Line != range.End.Line; } - public static bool IsSingleLine(this Range range) + public static bool IsSingleLine(this LspRange range) { return range.Start.Line == range.End.Line; } - public static bool IsUndefined(this Range range) + public static bool IsUndefined(this LspRange range) { return range == LspFactory.UndefinedRange; } - public static bool IsZeroWidth(this Range range) + public static bool IsZeroWidth(this LspRange range) { return range.Start == range.End; } - public static int CompareTo(this Range range1, Range range2) + public static int CompareTo(this LspRange range1, LspRange range2) { var result = range1.Start.CompareTo(range2.Start); @@ -97,7 +97,7 @@ public static int CompareTo(this Range range1, Range range2) return result; } - public static Range? Overlap(this Range range, Range other) + public static LspRange? Overlap(this LspRange range, LspRange other) { var overlapStart = range.Start; if (range.Start.CompareTo(other.Start) < 0) @@ -120,6 +120,6 @@ public static int CompareTo(this Range range1, Range range2) return null; } - public static string ToDisplayString(this Range range) + public static string ToDisplayString(this LspRange range) => $"{range.Start.ToDisplayString()}-{range.End.ToDisplayString()}"; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs index 9122e5b2deb..086c5312dd0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs @@ -15,16 +15,16 @@ public static int GetPosition(this SourceText text, Position position) public static Position GetPosition(this SourceText text, int position) => text.GetLinePosition(position).ToPosition(); - public static Range GetRange(this SourceText text, TextSpan span) + public static LspRange GetRange(this SourceText text, TextSpan span) => text.GetLinePositionSpan(span).ToRange(); - public static Range GetRange(this SourceText text, SourceSpan span) + public static LspRange GetRange(this SourceText text, SourceSpan span) => text.GetLinePositionSpan(span).ToRange(); - public static Range GetRange(this SourceText text, int start, int end) + public static LspRange GetRange(this SourceText text, int start, int end) => text.GetLinePositionSpan(start, end).ToRange(); - public static Range GetZeroWidthRange(this SourceText text, int position) + public static LspRange GetZeroWidthRange(this SourceText text, int position) => text.GetLinePosition(position).ToZeroWidthRange(); public static bool IsValidPosition(this SourceText text, Position position) @@ -36,7 +36,7 @@ public static bool TryGetAbsoluteIndex(this SourceText text, Position position, public static int GetRequiredAbsoluteIndex(this SourceText text, Position position) => text.GetRequiredAbsoluteIndex(position.Line, position.Character); - public static TextSpan GetTextSpan(this SourceText text, Range range) + public static TextSpan GetTextSpan(this SourceText text, LspRange range) => text.GetTextSpan(range.Start.Line, range.Start.Character, range.End.Line, range.End.Character); public static bool TryGetSourceLocation(this SourceText text, Position position, out SourceLocation location) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs index ad3dcf3e744..95a6ef118a7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs @@ -11,14 +11,14 @@ namespace Microsoft.VisualStudio.LanguageServer.Protocol; internal static partial class LspExtensions { - public static Range GetRange(this SyntaxNode node, RazorSourceDocument source) + public static LspRange GetRange(this SyntaxNode node, RazorSourceDocument source) { var linePositionSpan = node.GetLinePositionSpan(source); return LspFactory.CreateRange(linePositionSpan); } - public static Range? GetRangeWithoutWhitespace(this SyntaxNode node, RazorSourceDocument source) + public static LspRange? GetRangeWithoutWhitespace(this SyntaxNode node, RazorSourceDocument source) { var tokens = node.GetTokens(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs index 182a0c45a79..e57f55c8e25 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs @@ -10,7 +10,7 @@ internal static class LspFactory { private static readonly Position s_defaultPosition = new(0, 0); - private static readonly Range s_defaultRange = new() + private static readonly LspRange s_defaultRange = new() { Start = s_defaultPosition, End = s_defaultPosition @@ -18,7 +18,7 @@ internal static class LspFactory private static readonly Position s_undefinedPosition = new(-1, -1); - private static readonly Range s_undefinedRange = new() + private static readonly LspRange s_undefinedRange = new() { Start = s_undefinedPosition, End = s_undefinedPosition @@ -47,7 +47,7 @@ public static Position DefaultPosition /// Returns a for starting line 0 and character 0, /// and ending line 0 and character 0. /// - public static Range DefaultRange + public static LspRange DefaultRange { get { @@ -81,7 +81,7 @@ public static Position UndefinedPosition } } - public static Range UndefinedRange + public static LspRange UndefinedRange { get { @@ -113,24 +113,24 @@ public static Position CreatePosition(LinePosition linePosition) public static Position CreatePosition((int line, int character) position) => CreatePosition(position.line, position.character); - public static Range CreateRange(int startLine, int startCharacter, int endLine, int endCharacter) + public static LspRange CreateRange(int startLine, int startCharacter, int endLine, int endCharacter) => startLine == endLine && startCharacter == endCharacter ? CreateZeroWidthRange(startLine, startCharacter) : CreateRange(CreatePosition(startLine, startCharacter), CreatePosition(endLine, endCharacter)); - public static Range CreateRange(Position start, Position end) + public static LspRange CreateRange(Position start, Position end) => new() { Start = start, End = end }; - public static Range CreateRange(LinePosition start, LinePosition end) + public static LspRange CreateRange(LinePosition start, LinePosition end) => CreateRange(start.Line, start.Character, end.Line, end.Character); - public static Range CreateRange((int line, int character) start, (int line, int character) end) + public static LspRange CreateRange((int line, int character) start, (int line, int character) end) => CreateRange(start.line, start.character, end.line, end.character); - public static Range CreateRange(LinePositionSpan span) + public static LspRange CreateRange(LinePositionSpan span) => CreateRange(span.Start, span.End); - public static Range CreateZeroWidthRange(int line, int character) + public static LspRange CreateZeroWidthRange(int line, int character) => (line, character) switch { (0, 0) => DefaultRange, @@ -138,28 +138,28 @@ public static Range CreateZeroWidthRange(int line, int character) _ => CreateZeroWidthRange(CreatePosition(line, character)) }; - public static Range CreateZeroWidthRange(Position position) + public static LspRange CreateZeroWidthRange(Position position) => CreateRange(position, position); - public static Range CreateZeroWidthRange(LinePosition position) + public static LspRange CreateZeroWidthRange(LinePosition position) => CreateRange(position, position); - public static Range CreateZeroWidthRange((int line, int character) position) + public static LspRange CreateZeroWidthRange((int line, int character) position) => CreateRange(position, position); - public static Range CreateSingleLineRange(int line, int character, int length) + public static LspRange CreateSingleLineRange(int line, int character, int length) => CreateRange(line, character, line, character + length); - public static Range CreateSingleLineRange(Position start, int length) + public static LspRange CreateSingleLineRange(Position start, int length) => CreateRange(start, CreatePosition(start.Line, start.Character + length)); - public static Range CreateSingleLineRange(LinePosition start, int length) + public static LspRange CreateSingleLineRange(LinePosition start, int length) => CreateSingleLineRange(start.Line, start.Character, length); - public static Range CreateSingleLineRange((int line, int character) start, int length) + public static LspRange CreateSingleLineRange((int line, int character) start, int length) => CreateRange(CreatePosition(start), CreatePosition(start.line, start.character + length)); - public static TextEdit CreateTextEdit(Range range, string newText) + public static TextEdit CreateTextEdit(LspRange range, string newText) => new() { Range = range, NewText = newText }; public static TextEdit CreateTextEdit(LinePositionSpan span, string newText) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs index b4b892e4671..6f6c27b574f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/CodeActions/VSCodeActionParams.cs @@ -21,7 +21,7 @@ internal class VSCodeActionParams [JsonPropertyName("range")] [DataMember(Name = "range")] - public required Range Range { get; set; } + public required LspRange Range { get; set; } [JsonPropertyName("context")] [DataMember(Name = "context")] diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs index cfafecfbd05..880ae17e051 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanResponse.cs @@ -8,5 +8,5 @@ namespace Microsoft.CodeAnalysis.Razor.Protocol.Debugging; internal class RazorBreakpointSpanResponse { [JsonPropertyName("range")] - public required Range Range { get; init; } + public required LspRange Range { get; init; } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs index fee959c6efa..d222c5325e1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs @@ -25,7 +25,7 @@ internal record DelegatedPositionParams( internal record DelegatedInlayHintParams( [property: JsonPropertyName("identifier")] TextDocumentIdentifierAndVersion Identifier, - [property: JsonPropertyName("projectedRange")] Range ProjectedRange, + [property: JsonPropertyName("projectedRange")] LspRange ProjectedRange, [property: JsonPropertyName("projectedKind")] RazorLanguageKind ProjectedKind) : IDelegatedParams; internal record DelegatedInlayHintResolveParams( @@ -35,7 +35,7 @@ internal record DelegatedInlayHintResolveParams( internal record DelegatedValidateBreakpointRangeParams( [property: JsonPropertyName("identifier")] TextDocumentIdentifierAndVersion Identifier, - [property: JsonPropertyName("projectedRange")] Range ProjectedRange, + [property: JsonPropertyName("projectedRange")] LspRange ProjectedRange, [property: JsonPropertyName("projectedKind")] RazorLanguageKind ProjectedKind) : IDelegatedParams; internal record DelegatedOnAutoInsertParams( diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs index 8692fa83020..f82ea528651 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentMapping/RazorMapToDocumentRangesResponse.cs @@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; internal class RazorMapToDocumentRangesResponse { [JsonPropertyName("ranges")] - public required Range[] Ranges { get; init; } + public required LspRange[] Ranges { get; init; } [JsonPropertyName("hostDocumentVersion")] public int? HostDocumentVersion { get; init; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs index 9e3916a3254..603c3a5c336 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentPresentation/IPresentationParams.cs @@ -6,7 +6,7 @@ namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentPresentation; internal interface IPresentationParams { TextDocumentIdentifier TextDocument { get; set; } - Range Range { get; set; } + LspRange Range { get; set; } } internal interface IRazorPresentationParams : IPresentationParams diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs index f6f7239723d..10fe9e269f9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/SemanticTokensRangesParams.cs @@ -8,5 +8,5 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; internal class SemanticTokensRangesParams : SemanticTokensParams { [JsonPropertyName("ranges")] - public required Range[] Ranges { get; set; } + public required LspRange[] Ranges { get; set; } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs index f78eaae24c4..8316dc109be 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs @@ -9,5 +9,5 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; internal abstract class LSPBreakpointSpanProvider { - public abstract Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); + public abstract Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs index e636426102a..94db2e3d18e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs @@ -71,7 +71,7 @@ public async Task RewriteAsync_CSharp_AdjustsListRange() Assert.Equal(expectedRange, rewrittenCompletionList.ItemDefaults.EditRange); } - private static VSInternalCompletionList GenerateCompletionList(Range textEditRange) + private static VSInternalCompletionList GenerateCompletionList(LspRange textEditRange) { return new VSInternalCompletionList() { From 8d45e984b99d1456cf81c94508834452f630d186 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:07:43 +1000 Subject: [PATCH 008/223] Introduce extern alias where necessary to reference Roslyn types --- .../Completion/CompletionListOptimizer.cs | 4 +++- .../Completion/RazorCompletionItemResolver.cs | 4 +++- .../Definition/DefinitionEndpoint.cs | 10 +++++---- .../RazorTranslateDiagnosticsService.cs | 6 +++-- .../FindAllReferencesEndpoint.cs | 4 +++- .../Hover/HoverService.cs | 4 +++- .../Implementation/ImplementationEndpoint.cs | 8 ++++--- .../MapCode/MapCodeEndpoint.cs | 4 +++- .../SignatureHelp/SignatureHelpEndpoint.cs | 4 +++- .../DefaultVSLSPTagHelperTooltipFactory.cs | 6 +++-- .../Tooltip/VSLSPTagHelperTooltipFactory.cs | 4 +++- ...DefaultVSLSPTagHelperTooltipFactoryTest.cs | 4 +++- .../DefinitionEndpointDelegationTest.cs | 10 +++++---- .../RazorDiagnosticsPublisherTest.cs | 6 +++-- .../Hover/HoverServiceTest.cs | 5 +++-- ...tingEndpointTestBase.TestLanguageServer.cs | 22 ++++++++++--------- 16 files changed, 68 insertions(+), 37 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs index 5147c57c251..2930882a7d2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListOptimizer.cs @@ -1,9 +1,11 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System.Collections.Generic; using System.Linq; -using AliasedVSCommitCharacters = Microsoft.VisualStudio.LanguageServer.Protocol.SumType; +using AliasedVSCommitCharacters = RLSP::Roslyn.LanguageServer.Protocol.SumType; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs index c216ae10c6d..10caf85c23d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionItemResolver.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Linq; using System.Threading; @@ -8,7 +10,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.Completion; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index 8082873a320..2ad9e1f829e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Linq; using System.Threading; @@ -17,10 +19,10 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], - Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; +using DefinitionResult = RLSP::Roslyn.LanguageServer.Protocol.SumType< + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation, + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation[], + RLSP::Roslyn.LanguageServer.Protocol.DocumentLink[]>; using SyntaxKind = Microsoft.AspNetCore.Razor.Language.SyntaxKind; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs index f386fc9f19d..eb39e4e3440 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -16,8 +18,8 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; -using DiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; +using Diagnostic = RLSP::Roslyn.LanguageServer.Protocol.Diagnostic; +using DiagnosticSeverity = RLSP::Roslyn.LanguageServer.Protocol.DiagnosticSeverity; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs index 4d857727aeb..200dc902f69 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/FindAllReferences/FindAllReferencesEndpoint.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.Linq; @@ -14,7 +16,7 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.FindAllReferences; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs index 651010b0a12..f3989b6e031 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -17,7 +19,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Tooltip; using Microsoft.VisualStudio.Editor.Razor; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs index 293b5652077..9d798be08b6 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Threading; using System.Threading.Tasks; @@ -11,9 +13,9 @@ using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; -using ImplementationResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.Location[], - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalReferenceItem[]>; +using ImplementationResult = RLSP::Roslyn.LanguageServer.Protocol.SumType< + RLSP::Roslyn.LanguageServer.Protocol.Location[], + RLSP::Roslyn.LanguageServer.Protocol.VSInternalReferenceItem[]>; namespace Microsoft.AspNetCore.Razor.LanguageServer.Implementation; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs index 47567f00ee5..b9dffd35e71 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -22,7 +24,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Location = Microsoft.VisualStudio.LanguageServer.Protocol.Location; +using Location = RLSP::Roslyn.LanguageServer.Protocol.Location; using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.AspNetCore.Razor.LanguageServer.MapCode; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs index f06cde3cf74..d3bdec59c84 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; @@ -13,7 +15,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.SignatureHelp; -using SignatureHelp = VisualStudio.LanguageServer.Protocol.SignatureHelp; +using SignatureHelp = RLSP::Roslyn.LanguageServer.Protocol.SignatureHelp; [RazorLanguageServerEndpoint(Methods.TextDocumentSignatureHelpName)] internal sealed class SignatureHelpEndpoint( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultVSLSPTagHelperTooltipFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultVSLSPTagHelperTooltipFactory.cs index 176f774ffa1..8843a67f808 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultVSLSPTagHelperTooltipFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultVSLSPTagHelperTooltipFactory.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -13,8 +15,8 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.Core.Imaging; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Core.Imaging; +using RLSP::Roslyn.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/VSLSPTagHelperTooltipFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/VSLSPTagHelperTooltipFactory.cs index f6ea104b830..7b5b9647080 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/VSLSPTagHelperTooltipFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/VSLSPTagHelperTooltipFactory.cs @@ -1,13 +1,15 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Text.Adornments; namespace Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultVSLSPTagHelperTooltipFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultVSLSPTagHelperTooltipFactoryTest.cs index 30e3a398773..5053fa9aba6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultVSLSPTagHelperTooltipFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/DefaultVSLSPTagHelperTooltipFactoryTest.cs @@ -3,6 +3,8 @@ #nullable disable +extern alias RLSP; + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -11,7 +13,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Tooltip; -using Microsoft.VisualStudio.Text.Adornments; +using RLSP::Roslyn.Text.Adornments; using Xunit; using Xunit.Abstractions; using static Microsoft.AspNetCore.Razor.LanguageServer.Tooltip.DefaultVSLSPTagHelperTooltipFactory; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs index bc913d0cbca..a71df407a27 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Collections.Generic; using System.IO; @@ -12,10 +14,10 @@ using Microsoft.CodeAnalysis.Text; using Xunit; using Xunit.Abstractions; -using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], - Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; +using DefinitionResult = RLSP::Roslyn.LanguageServer.Protocol.SumType< + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation, + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation[], + RLSP::Roslyn.LanguageServer.Protocol.DocumentLink[]>; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs index 9011fd45176..0a0cd140b7b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +extern alias RLSP; + using System; using System.Linq; using System.Threading; @@ -21,8 +23,8 @@ using Moq; using Xunit; using Xunit.Abstractions; -using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; -using DiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; +using Diagnostic = RLSP::Roslyn.LanguageServer.Protocol.Diagnostic; +using DiagnosticSeverity = RLSP::Roslyn.LanguageServer.Protocol.DiagnosticSeverity; using RazorDiagnosticFactory = Microsoft.AspNetCore.Razor.Language.RazorDiagnosticFactory; namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index 3c358abc519..fe9c7d04014 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -3,6 +3,7 @@ #nullable disable +extern alias RLSP; using System; using System.Linq; using System.Threading; @@ -22,8 +23,8 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.Text.Adornments; using Moq; +using RLSP::Roslyn.Text.Adornments; using Xunit; using Xunit.Abstractions; using static Microsoft.AspNetCore.Razor.LanguageServer.Tooltip.DefaultVSLSPTagHelperTooltipFactory; @@ -1012,7 +1013,7 @@ public async Task SendRequestAsync(string method, Position = hoverParams.ProjectedPosition }; - var result = await _csharpServer.ExecuteRequestAsync( + var result = await _csharpServer.ExecuteRequestAsync( Methods.TextDocumentHoverName, hoverRequest, _cancellationToken); return result; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs index 1f260dac179..f7df2e2ca37 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.TestLanguageServer.cs @@ -3,6 +3,8 @@ #nullable disable +extern alias RLSP; + using System; using System.Threading; using System.Threading.Tasks; @@ -14,14 +16,14 @@ using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; using Microsoft.CodeAnalysis.Razor.Protocol.Folding; using Xunit; -using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], - Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; -using ImplementationResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.Location[], - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalReferenceItem[]>; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using DefinitionResult = RLSP::Roslyn.LanguageServer.Protocol.SumType< + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation, + RLSP::Roslyn.LanguageServer.Protocol.VSInternalLocation[], + RLSP::Roslyn.LanguageServer.Protocol.DocumentLink[]>; +using ImplementationResult = RLSP::Roslyn.LanguageServer.Protocol.SumType< + RLSP::Roslyn.LanguageServer.Protocol.Location[], + RLSP::Roslyn.LanguageServer.Protocol.VSInternalReferenceItem[]>; +using LspSignatureHelp = RLSP::Roslyn.LanguageServer.Protocol.SignatureHelp; namespace Microsoft.AspNetCore.Razor.LanguageServer; @@ -269,7 +271,7 @@ private Task HandleImplementationAsync(T @params) _cancellationToken); } - private Task HandleSignatureHelpAsync(T @params) + private Task HandleSignatureHelpAsync(T @params) { var delegatedParams = Assert.IsType(@params); var delegatedRequest = new SignatureHelpParams() @@ -282,7 +284,7 @@ private Task HandleImplementationAsync(T @params) Position = delegatedParams.ProjectedPosition, }; - return _csharpServer.ExecuteRequestAsync( + return _csharpServer.ExecuteRequestAsync( Methods.TextDocumentSignatureHelpName, delegatedRequest, _cancellationToken); From bbb5adbab1c47c42482010bb6ff48efa8d922e55 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:08:13 +1000 Subject: [PATCH 009/223] Move Lsp helpers into the right namespace --- .../Extensions/LspExtensions_LinePosition.cs | 2 +- .../Extensions/LspExtensions_LinePositionSpan.cs | 2 +- .../Extensions/LspExtensions_Position.cs | 2 +- .../Extensions/LspExtensions_Range.cs | 2 +- .../Extensions/LspExtensions_RazorSyntaxTree.cs | 2 +- .../Extensions/LspExtensions_SourceText.cs | 2 +- .../Extensions/LspExtensions_SumTypes.cs | 2 +- .../Extensions/LspExtensions_SyntaxNode.cs | 2 +- .../Extensions/LspExtensions_TextChange.cs | 2 +- .../Extensions/LspExtensions_TextDocumentIdentifier.cs | 2 +- .../Extensions/LspExtensions_VSInternalClientCapabilities.cs | 2 +- .../Extensions/LspExtensions_VSProjectContext.cs | 2 +- .../Extensions/LspExtensions_WorkspaceEdit.cs | 2 +- .../Extensions/LspFactory.cs | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs index 38050f87ca5..9e48d992ea0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePosition.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs index 66422294e98..456a3f911a1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_LinePositionSpan.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs index 5156ecc9c3e..efa8366d6d4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Position.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs index 0a5a07f8583..d2becba878c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Range.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs index 0316dfc4624..fa4d5f9b090 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_RazorSyntaxTree.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs index 086c5312dd0..c41691fc67b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SourceText.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs index 7da5906093f..4a349e70091 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SumTypes.cs @@ -5,7 +5,7 @@ using System.Linq; using Microsoft.AspNetCore.Razor; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs index 95a6ef118a7..9cde6abc263 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_SyntaxNode.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs index 36077f4b831..91c400b9eff 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextChange.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs index 9029bc33fdd..f08c33b7ad7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_TextDocumentIdentifier.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs index f1e3a5e0373..0d8e0aab7c3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSInternalClientCapabilities.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs index 8bd3e97e1e4..9e678758b4f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_VSProjectContext.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Razor.ProjectSystem; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs index 6178287c63e..f27a8842657 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_WorkspaceEdit.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs index e57f55c8e25..1b82ab8653b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.VisualStudio.LanguageServer.Protocol; +namespace Roslyn.LanguageServer.Protocol; internal static class LspFactory { From e4537e0611bab17c15cdf2cc8f4d9154947ac807 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:10:01 +1000 Subject: [PATCH 010/223] Adjust namespaces and factory method names --- .../MapCode/Mappers/InsertMapper.cs | 5 ++--- .../Protocol/DelegatedTypes.cs | 1 + .../DocumentHighlight/RemoteDocumentHighlight.cs | 10 ++++------ .../Remote/IRemoteSignatureHelpService.cs | 6 ++---- .../RemoteDocumentHighlightService.cs | 7 +++---- .../FoldingRanges/RemoteFoldingRangeService.cs | 2 +- .../ProjectSystem/DocumentContextFactory.cs | 2 +- .../CohostDocumentHighlightPresentationEndpoint.cs | 2 +- .../LanguageClient/RazorDocumentOptionsService.cs | 2 +- src/Razor/src/rzls/LspLogger.cs | 2 +- .../DocumentContextFactoryTest.cs | 2 +- .../Semantic/RazorSemanticTokensLegendServiceTest.cs | 2 +- .../RazorToolingIntegrationTestBase.cs | 3 ++- .../LanguageServer/CSharpTestLspServerHelpers.cs | 2 +- .../LanguageServer/LanguageServerTestBase.cs | 2 +- .../LanguageServer/TestClientCapabilitiesService.cs | 2 +- .../TestRazorSemanticTokensLegendService.cs | 2 +- .../Cohost/CohostDocumentHighlightEndpointTest.cs | 2 +- .../Cohost/CohostFoldingRangeEndpointTest.cs | 2 +- .../Cohost/CohostLinkedEditingRangeEndpointTest.cs | 2 +- .../Cohost/CohostSignatureHelpEndpointTest.cs | 2 +- .../Cohost/CohostUriPresentationEndpointTest.cs | 2 +- .../Debugging/DefaultRazorBreakpointResolverTest.cs | 4 ++-- .../DefaultRazorProximityExpressionResolverTest.cs | 2 +- .../Debugging/TestLSPBreakpointSpanProvider.cs | 4 ++-- .../DefaultLSPDocumentMappingProviderTest.cs | 2 +- .../LanguageClient/RazorCustomMessageTargetTest.cs | 2 +- .../LanguageClient/RazorLSPSpanMappingServiceTest.cs | 4 ++-- .../LanguageClient/TestDocumentManager.cs | 2 +- .../LanguageClient/TestRazorLSPSpanMappingService.cs | 2 +- .../RazorLanguageService_IVsLanguageDebugInfoTest.cs | 2 +- 31 files changed, 42 insertions(+), 46 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs index edd26152e62..9f77fb752f9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.MapCode.Mappers; @@ -13,7 +12,7 @@ internal static class InsertMapper public static int? GetInsertionPoint( SyntaxNode documentRoot, SourceText sourceText, - LSP.Location focusArea) + Location focusArea) { // If there's an specific focus area, or caret provided, we should try to insert as close as possible. // As long as the focused area is not empty. @@ -34,7 +33,7 @@ internal static class InsertMapper private static bool TryGetFocusedInsertionPoint( SyntaxNode documentRoot, SourceText sourceText, - LSP.Location focusArea, + Location focusArea, out int insertionPoint) { // If there's an specific focus area, or caret provided, we should try to insert as close as possible. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs index d222c5325e1..3dd7e4bb4e7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs @@ -10,6 +10,7 @@ namespace Microsoft.CodeAnalysis.Razor.Protocol; +using Location = Roslyn.LanguageServer.Protocol.Location; internal record DelegatedSpellCheckParams( [property: JsonPropertyName("identifier")] TextDocumentIdentifierAndVersion Identifier); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs index 2dbe5a47bf8..8f6ef190cd8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentHighlight/RemoteDocumentHighlight.cs @@ -3,9 +3,7 @@ using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Text; -using static Roslyn.LanguageServer.Protocol.LspExtensions; -using RoslynDocumentHighlight = Roslyn.LanguageServer.Protocol.DocumentHighlight; -using VsDocumentHighlight = Microsoft.VisualStudio.LanguageServer.Protocol.DocumentHighlight; +using LspDocumentHighlight = Roslyn.LanguageServer.Protocol.DocumentHighlight; namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentHighlight; @@ -14,10 +12,10 @@ internal readonly record struct RemoteDocumentHighlight( [property: DataMember(Order = 0)] LinePositionSpan Span, [property: DataMember(Order = 1)] DocumentHighlightKind Kind) { - public static RemoteDocumentHighlight FromRoslynDocumentHighlight(RoslynDocumentHighlight highlight) - => new(highlight.Range.ToLinePositionSpan(), (DocumentHighlightKind)highlight.Kind); + public static RemoteDocumentHighlight FromLspDocumentHighlight(LspDocumentHighlight highlight) + => new(highlight.Range.ToLinePositionSpan(), highlight.Kind); - public static VsDocumentHighlight ToVsDocumentHighlight(RemoteDocumentHighlight highlight) + public static LspDocumentHighlight ToLspDocumentHighlight(RemoteDocumentHighlight highlight) => new() { Range = LspExtensions.ToRange(highlight.Span), diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSignatureHelpService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSignatureHelpService.cs index 82163933eef..f8c4b384d01 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSignatureHelpService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSignatureHelpService.cs @@ -4,13 +4,11 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Roslyn.LanguageServer.Protocol; +using LspSignatureHelp = Roslyn.LanguageServer.Protocol.SignatureHelp; namespace Microsoft.CodeAnalysis.Razor.Remote; -using SignatureHelp = Roslyn.LanguageServer.Protocol.SignatureHelp; - internal interface IRemoteSignatureHelpService : IRemoteJsonService { - ValueTask GetSignatureHelpAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, Position linePosition, CancellationToken cancellationToken); + ValueTask GetSignatureHelpAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, Position linePosition, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs index f2d62ed9ed2..426e81fd249 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentHighlight/RemoteDocumentHighlightService.cs @@ -14,8 +14,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using static Microsoft.VisualStudio.LanguageServer.Protocol.LspExtensions; -using static Roslyn.LanguageServer.Protocol.LspExtensions; +using Roslyn.LanguageServer.Protocol; using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -80,8 +79,8 @@ private async ValueTask GetHighlightsAsync( { if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, highlight.Range.ToLinePositionSpan(), out var mappedRange)) { - highlight.Range = Roslyn.LanguageServer.Protocol.LspExtensions.ToRange(mappedRange); - results.Add(RemoteDocumentHighlight.FromRoslynDocumentHighlight(highlight)); + highlight.Range = mappedRange.ToRange(); + results.Add(RemoteDocumentHighlight.FromLspDocumentHighlight(highlight)); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/FoldingRanges/RemoteFoldingRangeService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/FoldingRanges/RemoteFoldingRangeService.cs index 5fed4a0a437..e6e9b214039 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/FoldingRanges/RemoteFoldingRangeService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/FoldingRanges/RemoteFoldingRangeService.cs @@ -11,7 +11,7 @@ using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; namespace Microsoft.CodeAnalysis.Remote.Razor; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextFactory.cs index a23e018bcd1..39b3f530699 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextFactory.cs @@ -5,7 +5,7 @@ using System.Composition; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs index 9dc3095ef81..4461d08211e 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs @@ -70,7 +70,7 @@ internal class CohostDocumentHighlightEndpoint( // If we got a response back, then either Razor or C# wants to do something with this, so we're good to go if (csharpResult.Result is { } highlights) { - return highlights.Select(RemoteDocumentHighlight.ToVsDocumentHighlight).ToArray(); + return highlights.Select(RemoteDocumentHighlight.ToLspDocumentHighlight).ToArray(); } if (csharpResult.StopHandling) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorDocumentOptionsService.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorDocumentOptionsService.cs index dd97a0de2e6..e1c36a7c57e 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorDocumentOptionsService.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorDocumentOptionsService.cs @@ -8,10 +8,10 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Api; -using Microsoft.CodeAnalysis.Formatting; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Razor.Settings; using Microsoft.VisualStudio.Razor.Settings; +using FormattingOptions = Microsoft.CodeAnalysis.Formatting.FormattingOptions; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/src/rzls/LspLogger.cs b/src/Razor/src/rzls/LspLogger.cs index 0f032ed436f..5e86435a8fd 100644 --- a/src/Razor/src/rzls/LspLogger.cs +++ b/src/Razor/src/rzls/LspLogger.cs @@ -5,8 +5,8 @@ using System.Threading; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Threading; +using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs index 31394f347d2..9d84aea0076 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs @@ -125,7 +125,7 @@ await _projectManager.UpdateAsync(updater => }); // Act - Assert.True(factory.TryCreate(uri, new VisualStudio.LanguageServer.Protocol.VSProjectContext { Id = hostProject.Key.Id }, out var documentContext)); + Assert.True(factory.TryCreate(uri, new VSProjectContext { Id = hostProject.Key.Id }, out var documentContext)); // Assert Assert.Equal(uri, documentContext.Uri); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensLegendServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensLegendServiceTest.cs index caea278d09c..f4ae741cf15 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensLegendServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokensLegendServiceTest.cs @@ -15,7 +15,7 @@ public class RazorSemanticTokensLegendServiceTest(ITestOutputHelper testOutput) [Fact] public void RazorModifiers_MustStartAfterRoslyn() { - var clientCapabilitiesService = new TestClientCapabilitiesService(new VisualStudio.LanguageServer.Protocol.VSInternalClientCapabilities()); + var clientCapabilitiesService = new TestClientCapabilitiesService(new VSInternalClientCapabilities()); var service = new RazorSemanticTokensLegendService(clientCapabilitiesService); var expected = Math.Pow(2, RazorSemanticTokensAccessor.GetTokenModifiers().Length); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs index d473acb5ccc..183059cb0ef 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs @@ -20,6 +20,7 @@ using Xunit; using Xunit.Abstractions; using Xunit.Sdk; +using Diagnostic = Microsoft.CodeAnalysis.Diagnostic; namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests; @@ -280,7 +281,7 @@ protected static CompileToAssemblyResult CompileToAssembly(CompileToCSharpResult var diagnostics = compilation .GetDiagnostics() - .Where(d => d.Severity != DiagnosticSeverity.Hidden); + .Where(d => d.Severity != CodeAnalysis.DiagnosticSeverity.Hidden); if (diagnostics.Any() && throwOnFailure) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs index ddae8ddf089..a2bc4d4c283 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs @@ -20,7 +20,7 @@ using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Composition; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs index e7e0f6e87e2..94e468b717a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs @@ -23,7 +23,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.CommonLanguageServerProtocol.Framework; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs index f3dd0cb02d6..e7c1af358c4 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Test; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs index 95def5825fc..11e8fb3ce75 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.AspNetCore.Razor.LanguageServer.Test; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs index ce044474c00..76732cd08df 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs index 08ad6977496..ac3223d035b 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs @@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs index cd2c7baddaa..b47b38da824 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.Razor.LinkedEditingRange; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs index 276e1de71a1..bbbf89e86ee 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.Razor.Settings; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.Settings; using Xunit; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs index 0ca41897540..177069acf8c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs index fac2bc3b725..4111423ef10 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs @@ -9,13 +9,13 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.Editor; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; using Moq; using Xunit; using Xunit.Abstractions; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Roslyn.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs index b107a2fb3fc..ab5942e4f27 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs @@ -11,10 +11,10 @@ using Microsoft.AspNetCore.Razor.Test.Common.Editor; using Microsoft.AspNetCore.Razor.Threading; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; using Moq; +using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs index d3d3e64669f..bb5323c0524 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs @@ -10,8 +10,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Threading; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using Roslyn.LanguageServer.Protocol; +using LspRange = Roslyn.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs index 742509d06af..3cd1a5a489c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/DefaultLSPDocumentMappingProviderTest.cs @@ -11,7 +11,7 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; using Moq; using Xunit; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs index 419fa70db8a..ee46d9348b9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs @@ -18,7 +18,7 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Razor.Snippets; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs index 639a3f16a58..d77b5f1c0a8 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs @@ -13,12 +13,12 @@ using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; using Moq; using Xunit; using Xunit.Abstractions; -using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspRange = Roslyn.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs index 9c3a2717d15..4c93d3b3488 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs @@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs index 3b46d91e9c7..36022330fd0 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs @@ -11,7 +11,7 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs index 45058bebe8d..463bf0e743a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs @@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.Editor; using Microsoft.VisualStudio.Editor; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.TextManager.Interop; From 606777980aaa62f1294498e64594db052d0973d3 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:10:23 +1000 Subject: [PATCH 011/223] Adjust visibility on a couple of things --- .../Formatting_NetFx/FormattingTestBase.cs | 4 ++-- .../LanguageServer/CSharpTestLspServer.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index d4a09040768..8a58ab622e9 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -151,7 +151,7 @@ private protected async Task RunOnTypeFormattingTestAsync( } } - protected async Task RunCodeActionFormattingTestAsync( + private protected async Task RunCodeActionFormattingTestAsync( string input, TextEdit[] codeActionEdits, string expected, @@ -206,7 +206,7 @@ protected async Task RunCodeActionFormattingTestAsync( AssertEx.EqualOrDiff(expected, actual); } - protected static TextEdit Edit(int startLine, int startChar, int endLine, int endChar, string newText) + private protected static TextEdit Edit(int startLine, int startChar, int endLine, int endChar, string newText) => LspFactory.CreateTextEdit(startLine, startChar, endLine, endChar, newText); private static SourceText ApplyEdits(SourceText source, TextEdit[] edits) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs index f3559f2fd8d..8830418e46d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs @@ -172,7 +172,7 @@ static DidOpenTextDocumentParams CreateDidOpenTextDocumentParams(Uri uri, string }; } - public async Task ReplaceTextAsync(Uri documentUri, params (LspRange Range, string Text)[] changes) + internal async Task ReplaceTextAsync(Uri documentUri, params (LspRange Range, string Text)[] changes) { var didChangeParams = CreateDidChangeTextDocumentParams( documentUri, From be5f7352e289285cb02036f1e86fe778d5fd2d8f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:10:57 +1000 Subject: [PATCH 012/223] Fix issues with ContainedLanguage being dependent on VS types --- .../InternalAPI.Unshipped.txt | 1 + .../VisualStudioTextChange.cs | 23 +++++++++----- .../RazorCustomMessageTarget_Completion.cs | 31 +++++++++++++++++-- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/InternalAPI.Unshipped.txt b/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/InternalAPI.Unshipped.txt index 36eda715446..dee1afd5aa3 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/InternalAPI.Unshipped.txt +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/InternalAPI.Unshipped.txt @@ -4,6 +4,7 @@ Microsoft.VisualStudio.LanguageServer.ContainedLanguage.DefaultLSPDocumentSynchr Microsoft.VisualStudio.LanguageServer.ContainedLanguage.DefaultLSPRequestInvoker.DefaultLSPRequestInvoker(Microsoft.VisualStudio.LanguageServer.Client.ILanguageServiceBroker2! languageServiceBroker) -> void Microsoft.VisualStudio.LanguageServer.ContainedLanguage.LSPDocumentSnapshot.TryGetAllVirtualDocumentsAsArray(out System.Collections.Immutable.ImmutableArray virtualDocuments) -> bool Microsoft.VisualStudio.LanguageServer.ContainedLanguage.MessageInterception.DefaultInterceptorManager.DefaultInterceptorManager(System.Collections.Generic.IEnumerable!>! lazyInterceptors, System.Collections.Generic.IEnumerable!>! lazyGenericInterceptors) -> void +Microsoft.VisualStudio.LanguageServer.ContainedLanguage.VisualStudioTextChange.VisualStudioTextChange(int startLineNumber, int startCharacter, int endLineNumber, int endCharacter, Microsoft.VisualStudio.Text.ITextSnapshot! textSnapshot, string! newText) -> void override Microsoft.VisualStudio.LanguageServer.ContainedLanguage.DefaultLSPDocument.SetVirtualDocuments(System.Collections.Generic.IReadOnlyList! virtualDocuments) -> void override Microsoft.VisualStudio.LanguageServer.ContainedLanguage.DefaultLSPDocument.UpdateVirtualDocument(TVirtualDocument! virtualDocument, System.Collections.Generic.IReadOnlyList! changes, int hostDocumentVersion, object? state) -> Microsoft.VisualStudio.LanguageServer.ContainedLanguage.LSPDocumentSnapshot! override Microsoft.VisualStudio.LanguageServer.ContainedLanguage.DefaultLSPDocumentFactory.TryRefreshVirtualDocuments(Microsoft.VisualStudio.LanguageServer.ContainedLanguage.LSPDocument! document) -> bool diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/VisualStudioTextChange.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/VisualStudioTextChange.cs index 83571783783..ba7e1931154 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/VisualStudioTextChange.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/VisualStudioTextChange.cs @@ -16,16 +16,25 @@ public VisualStudioTextChange(int oldStart, int oldLength, string newText) } public VisualStudioTextChange(TextEdit textEdit, ITextSnapshot textSnapshot) + : this( + textEdit.Range.Start.Line, + textEdit.Range.Start.Character, + textEdit.Range.End.Line, + textEdit.Range.End.Character, + textSnapshot, + textEdit.NewText) { - var startRange = textEdit.Range.Start; - var startLine = textSnapshot.GetLineFromLineNumber(startRange.Line); - var startAbsoluteIndex = startLine.Start + startRange.Character; - var endRange = textEdit.Range.End; - var endLine = textSnapshot.GetLineFromLineNumber(endRange.Line); - var endAbsoluteIndex = endLine.Start + endRange.Character; + } + + public VisualStudioTextChange(int startLineNumber, int startCharacter, int endLineNumber, int endCharacter, ITextSnapshot textSnapshot, string newText) + { + var startLine = textSnapshot.GetLineFromLineNumber(startLineNumber); + var startAbsoluteIndex = startLine.Start + startCharacter; + var endLine = textSnapshot.GetLineFromLineNumber(endLineNumber); + var endAbsoluteIndex = endLine.Start + endCharacter; var length = endAbsoluteIndex - startAbsoluteIndex; OldSpan = new Span(startAbsoluteIndex, length); - NewText = textEdit.NewText; + NewText = newText; } public Span OldSpan { get; } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs index 168ea5cf15c..51cf32b9b0f 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Completion; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; @@ -108,7 +109,13 @@ internal partial class RazorCustomMessageTarget { await _joinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - var provisionalChange = new VisualStudioTextChange(provisionalTextEdit, virtualDocumentSnapshot.Snapshot); + var provisionalChange = new VisualStudioTextChange( + provisionalTextEdit.Range.Start.Line, + provisionalTextEdit.Range.Start.Character, + provisionalTextEdit.Range.End.Line, + provisionalTextEdit.Range.End.Character, + virtualDocumentSnapshot.Snapshot, + provisionalTextEdit.NewText); UpdateVirtualDocument(provisionalChange, request.ProjectedKind, request.Identifier.Version, hostDocumentUri, virtualDocumentSnapshot.Uri); // We want the delegation to continue on the captured context because we're currently on the `main` thread and we need to get back to the @@ -163,7 +170,13 @@ internal partial class RazorCustomMessageTarget if (provisionalTextEdit is not null) { var revertedProvisionalTextEdit = BuildRevertedEdit(provisionalTextEdit); - var revertedProvisionalChange = new VisualStudioTextChange(revertedProvisionalTextEdit, virtualDocumentSnapshot.Snapshot); + var revertedProvisionalChange = new VisualStudioTextChange( + revertedProvisionalTextEdit.Range.Start.Line, + revertedProvisionalTextEdit.Range.Start.Character, + revertedProvisionalTextEdit.Range.End.Line, + revertedProvisionalTextEdit.Range.End.Character, + virtualDocumentSnapshot.Snapshot, + revertedProvisionalTextEdit.NewText); UpdateVirtualDocument(revertedProvisionalChange, request.ProjectedKind, request.Identifier.Version, hostDocumentUri, virtualDocumentSnapshot.Uri); } } @@ -312,7 +325,19 @@ private void UpdateVirtualDocument( public Task GetFormattingOptionsAsync(TextDocumentIdentifierAndVersion document, CancellationToken _) { var formattingOptions = _formattingOptionsProvider.GetOptions(document.TextDocumentIdentifier.Uri); - return Task.FromResult(formattingOptions); + + if (formattingOptions is null) + { + return SpecializedTasks.Null(); + } + + var roslynFormattingOptions = new FormattingOptions() + { + TabSize = formattingOptions.TabSize, + InsertSpaces = formattingOptions.InsertSpaces, + OtherOptions = formattingOptions.OtherOptions, + }; + return Task.FromResult(roslynFormattingOptions); } private void AddSnippetCompletions(DelegatedCompletionParams request, ref PooledArrayBuilder builder) From a21fd27e2e7b74ae205a0387186d057cc7326325 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:11:08 +1000 Subject: [PATCH 013/223] Roslyn types are immutable --- .../Diagnostics/DocumentPullDiagnosticsEndpoint.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index 79c3464a9b9..8bb28230e3a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -42,8 +42,10 @@ public DocumentPullDiagnosticsEndpoint( public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities) { serverCapabilities.SupportsDiagnosticRequests = true; - serverCapabilities.DiagnosticProvider ??= new(); - serverCapabilities.DiagnosticProvider.DiagnosticKinds = [VSInternalDiagnosticKind.Syntax]; + serverCapabilities.DiagnosticProvider ??= new() + { + DiagnosticKinds = [VSInternalDiagnosticKind.Syntax] + }; } public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagnosticsParams request) From 8725bba9501d86b9f84b12a8e1994c28ba323274 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:11:28 +1000 Subject: [PATCH 014/223] Cohost signature help now only has to return a single type --- .../Cohost/CohostSignatureHelpEndpoint.cs | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs index 1015b78c820..c5357ed5bb4 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostSignatureHelpEndpoint.cs @@ -16,9 +16,6 @@ using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.LanguageClient.Extensions; using Microsoft.VisualStudio.Razor.Settings; -using static Roslyn.LanguageServer.Protocol.LspExtensions; -using LspFactory = Roslyn.LanguageServer.Protocol.LspFactory; -using RoslynSignatureHelp = Roslyn.LanguageServer.Protocol.SignatureHelp; namespace Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; @@ -35,7 +32,7 @@ internal class CohostSignatureHelpEndpoint( IHtmlDocumentSynchronizer htmlDocumentSynchronizer, LSPRequestInvoker requestInvoker, ILoggerFactory loggerFactory) - : AbstractRazorCohostDocumentRequestHandler?>, IDynamicRegistrationProvider + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider { private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; @@ -70,10 +67,10 @@ internal class CohostSignatureHelpEndpoint( // NOTE: The use of SumType here is a little odd, but it allows us to return Roslyn LSP types from the Roslyn call, and VS LSP types from the Html // call. It works because both sets of types are attributed the right way, so the Json ends up looking the same and the client doesn't // care. Ideally eventually we will be able to move all of this to just Roslyn LSP types, but we might have to wait for Web Tools - protected override Task?> HandleRequestAsync(SignatureHelpParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + protected override Task HandleRequestAsync(SignatureHelpParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); - private async Task?> HandleRequestAsync(SignatureHelpParams request, TextDocument razorDocument, CancellationToken cancellationToken) + private async Task HandleRequestAsync(SignatureHelpParams request, TextDocument razorDocument, CancellationToken cancellationToken) { // Return nothing if "Parameter Information" option is disabled unless signature help is invoked explicitly via command as opposed to typing or content change if (request.Context is { TriggerKind: not SignatureHelpTriggerKind.Invoked } && @@ -82,10 +79,10 @@ internal class CohostSignatureHelpEndpoint( return null; } - var data = await _remoteServiceInvoker.TryInvokeAsync( + var data = await _remoteServiceInvoker.TryInvokeAsync( razorDocument.Project.Solution, (service, solutionInfo, cancellationToken) => - service.GetSignatureHelpAsync(solutionInfo, razorDocument.Id, LspFactory.CreatePosition(request.Position.ToLinePosition()), cancellationToken), + service.GetSignatureHelpAsync(solutionInfo, razorDocument.Id, request.Position, cancellationToken), cancellationToken) .ConfigureAwait(false); @@ -130,17 +127,7 @@ internal readonly struct TestAccessor(CohostSignatureHelpEndpoint instance) return null; } - if (signatureHelp.TryGetFirst(out var sigHelp1)) - { - return sigHelp1.Signatures.Select(s => s.Label).ToArray(); - } - else if (signatureHelp.TryGetSecond(out var sigHelp2)) - { - return sigHelp2.Signatures.Select(s => s.Label).ToArray(); - } - - Assumed.Unreachable(); - return null; + return signatureHelp.Signatures.Select(s => s.Label).ToArray(); } } } From bd720ba804f2a7958d233df50e229b9afb1dcf82 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 30 Jul 2024 14:11:47 +1000 Subject: [PATCH 015/223] Project file tweaks --- .../Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj | 2 -- .../Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj index 6422f8cc5b6..1f4c0f6ef87 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj @@ -30,8 +30,6 @@ <_PublishedFiles Include="$(PublishDir)**\Microsoft.AspNetCore.*" /> <_PublishedFiles Include="$(PublishDir)**\Microsoft.Extensions.ObjectPool.dll" /> - <_PublishedFiles Include="$(PublishDir)**\Microsoft.VisualStudio.LanguageServer.Protocol.*" /> - <_PublishedFiles Remove="@(_PublishedFiles)" Condition="'%(Extension)' == '.pdb'" /> <_PublishedFiles Remove="@(_PublishedFiles)" Condition="'%(Extension)' == '.xml'" /> diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj index aecc781879e..abc3fd8035e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj @@ -38,6 +38,10 @@ + + + + + + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index 96ab62a6804..dc5abd3716c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,25 +53,25 @@ 9.0.0-beta.24572.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 - 4.14.0-1.25071.1 + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev + 4.14.0-dev <_MicrosoftWebToolsPackageVersion>17.11.11-preview-0001 - <_MicrosoftVisualStudioShellPackagesVersion>17.12.39557-preview.2.1 - <_MicrosoftVisualStudioPackagesVersion>17.12.145-preview + <_MicrosoftVisualStudioShellPackagesVersion>17.13.40008 + <_MicrosoftVisualStudioPackagesVersion>17.13.226 <_VisualStudioLanguageServerProtocolVersion>17.12.1-preview <_MicrosoftExtensionsPackageVersion>8.0.0 <_BasicReferenceAssembliesVersion>1.7.2 @@ -17,7 +17,7 @@ <_RoslynDiagnosticAnalyzersPackageVersion>3.11.0-beta1.24508.2 <_MicrosoftVisualStudioLanguageServicesPackageVersion>$(MicrosoftVisualStudioLanguageServicesPackageVersion) <_XunitPackageVersion>2.9.2 - <_MicrosoftBuildPackageVersion>17.12.0-preview-24426-07 + <_MicrosoftBuildPackageVersion>17.13.9 @@ -27,7 +27,7 @@ - + @@ -56,7 +56,6 @@ - @@ -85,14 +84,14 @@ - + - + diff --git a/NuGet.config b/NuGet.config index ba68d9f51e0..b5e83791aff 100644 --- a/NuGet.config +++ b/NuGet.config @@ -24,9 +24,6 @@ - - - - - - - - - diff --git a/eng/Versions.props b/eng/Versions.props index 5c7641e6ef4..7f81b58ab37 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,25 +53,25 @@ 9.0.0-beta.25111.5 1.0.0-beta.23475.1 1.0.0-beta.23475.1 - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev - 4.14.0-dev + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 + 4.14.0-2.25123.16 - - - + https://github.com/dotnet/roslyn - 5970c1a8588cc6bac346d9ad3eebb41321713ab0 + dcc8ef293ae1da2efc03956e3ecdb824c18e5bf3 From bcfc36c6e765b8977333f0a60ed5a5f9e7bbbc90 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 24 Mar 2025 14:41:23 -0700 Subject: [PATCH 035/223] GeneratedOutputSource: Hold output in WeakReference This change brings back the behavior to hold the generated RazorCodeDocument produced by a document snapshot in a WeakReference. This avoids memory retention problems when document snapshots are rooted in the Roslyn workspace by the DynamicFileInfo system. --- .../Sources/GeneratedOutputSource.cs | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs index 218a6b5b305..79beb362a83 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -13,12 +14,21 @@ internal sealed class GeneratedOutputSource { private readonly SemaphoreSlim _gate = new(initialCount: 1); - private RazorCodeDocument? _output; + // Hold the output in a WeakReference to avoid memory leaks in the case of a long-lived + // document snapshots. In particular, the DynamicFileInfo system results in the Roslyn + // workspace holding onto document snapshots. + private WeakReference? _output; public bool TryGetValue([NotNullWhen(true)] out RazorCodeDocument? result) { - result = _output; - return result is not null; + var output = _output; + if (output is null) + { + result = null; + return false; + } + + return output.TryGetTarget(out result); } public async ValueTask GetValueAsync(DocumentSnapshot document, CancellationToken cancellationToken) @@ -39,11 +49,20 @@ public async ValueTask GetValueAsync(DocumentSnapshot documen var projectEngine = project.ProjectEngine; var compilerOptions = project.CompilerOptions; - _output = await CompilationHelpers + result = await CompilationHelpers .GenerateCodeDocumentAsync(document, projectEngine, compilerOptions, cancellationToken) .ConfigureAwait(false); - return _output; + if (_output is null) + { + _output = new WeakReference(result); + } + else + { + _output.SetTarget(result); + } + + return result; } } } From fef1b1135c4d0f163983b9d340a1a857191da624 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 24 Mar 2025 15:48:38 -0700 Subject: [PATCH 036/223] Make DocumentSnapshot own GeneratedOutputSource instead of DocumentState Now that GeneratedOutputSource holds its RazorCodeDocument in a WeakReference, there's not much point in keeping it on DocumentState. Instead, it can move to DocumentSnapshot, which is really more appropriate since GeneratedOutputSource needed a DocumentSnapshot to perform computation. --- .../ProjectSystem/DocumentSnapshot.cs | 20 +- .../ProjectSystem/DocumentState.cs | 18 +- .../ProjectSystem/ProjectState.cs | 6 +- .../Sources/GeneratedOutputSource.cs | 9 +- .../ProjectSystem/DocumentStateTest.cs | 96 --------- .../ProjectStateGeneratedOutputTest.cs | 195 ------------------ 6 files changed, 24 insertions(+), 320 deletions(-) delete mode 100644 src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateGeneratedOutputTest.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs index 9a31327616c..17799b0211c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs @@ -7,15 +7,25 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.ProjectSystem.Legacy; +using Microsoft.CodeAnalysis.Razor.ProjectSystem.Sources; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; -internal sealed class DocumentSnapshot(ProjectSnapshot project, DocumentState state) : IDocumentSnapshot, ILegacyDocumentSnapshot, IDesignTimeCodeGenerator +internal sealed class DocumentSnapshot : IDocumentSnapshot, ILegacyDocumentSnapshot, IDesignTimeCodeGenerator { - public ProjectSnapshot Project { get; } = project; + private readonly GeneratedOutputSource _generatedOutputSource; - private readonly DocumentState _state = state; + public ProjectSnapshot Project { get; } + + private readonly DocumentState _state; + + public DocumentSnapshot(ProjectSnapshot project, DocumentState state) + { + Project = project; + _state = state; + _generatedOutputSource = new(this); + } public HostDocument HostDocument => _state.HostDocument; @@ -40,10 +50,10 @@ public ValueTask GetTextVersionAsync(CancellationToken cancellatio => _state.GetTextVersionAsync(cancellationToken); public bool TryGetGeneratedOutput([NotNullWhen(true)] out RazorCodeDocument? result) - => _state.TryGetGeneratedOutput(out result); + => _generatedOutputSource.TryGetValue(out result); public ValueTask GetGeneratedOutputAsync(CancellationToken cancellationToken) - => _state.GetGeneratedOutputAsync(this, cancellationToken); + => _generatedOutputSource.GetValueAsync(cancellationToken); public IDocumentSnapshot WithText(SourceText text) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs index 91ff97c3e46..e2f589905ef 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs @@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem.Sources; using Microsoft.CodeAnalysis.Text; @@ -16,14 +15,12 @@ internal sealed partial class DocumentState public int Version { get; } private readonly ITextAndVersionSource _textAndVersionSource; - private readonly GeneratedOutputSource _generatedOutputSource; private DocumentState(HostDocument hostDocument, ITextAndVersionSource textAndVersionSource) { HostDocument = hostDocument; Version = 1; _textAndVersionSource = textAndVersionSource; - _generatedOutputSource = new(); } private DocumentState(DocumentState oldState, ITextAndVersionSource textAndVersionSource) @@ -31,7 +28,6 @@ private DocumentState(DocumentState oldState, ITextAndVersionSource textAndVersi HostDocument = oldState.HostDocument; Version = oldState.Version + 1; _textAndVersionSource = textAndVersionSource; - _generatedOutputSource = new(); } public static DocumentState Create(HostDocument hostDocument, SourceText text) @@ -46,12 +42,6 @@ private static ConstantTextAndVersionSource CreateTextAndVersionSource(SourceTex private static LoadableTextAndVersionSource CreateTextAndVersionSource(TextLoader textLoader) => new(textLoader); - public bool TryGetGeneratedOutput([NotNullWhen(true)] out RazorCodeDocument? result) - => _generatedOutputSource.TryGetValue(out result); - - public ValueTask GetGeneratedOutputAsync(DocumentSnapshot document, CancellationToken cancellationToken) - => _generatedOutputSource.GetValueAsync(document, cancellationToken); - public bool TryGetTextAndVersion([NotNullWhen(true)] out TextAndVersion? result) => _textAndVersionSource.TryGetValue(out result); @@ -110,13 +100,7 @@ async ValueTask GetTextVersionCoreAsync(CancellationToken cancella } } - public DocumentState WithConfigurationChange() - => new(this, _textAndVersionSource); - - public DocumentState WithImportsChange() - => new(this, _textAndVersionSource); - - public DocumentState WithProjectWorkspaceStateChange() + public DocumentState UpdateVersion() => new(this, _textAndVersionSource); public DocumentState WithText(SourceText text, VersionStamp textVersion) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs index eb308e9f6b8..35b05d94492 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs @@ -259,7 +259,7 @@ public ProjectState WithHostProject(HostProject hostProject) return this; } - var documents = UpdateDocuments(static x => x.WithConfigurationChange()); + var documents = UpdateDocuments(static x => x.UpdateVersion()); // If the host project has changed then we need to recompute the imports map var importsToRelatedDocuments = BuildImportsMap(documents.Values, ProjectEngine); @@ -277,7 +277,7 @@ public ProjectState WithProjectWorkspaceState(ProjectWorkspaceState projectWorks return this; } - var documents = UpdateDocuments(static x => x.WithProjectWorkspaceStateChange()); + var documents = UpdateDocuments(static x => x.UpdateVersion()); return new(this, HostProject, projectWorkspaceState, documents, ImportsToRelatedDocuments, retainProjectEngine: true); } @@ -378,7 +378,7 @@ private ImmutableDictionary UpdateRelatedDocumentsIfNeces return documents; } - var updates = relatedDocuments.Select(x => KeyValuePair.Create(x, documents[x].WithImportsChange())); + var updates = relatedDocuments.Select(x => KeyValuePair.Create(x, documents[x].UpdateVersion())); return documents.SetItems(updates); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs index 79beb362a83..796ec7742ee 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs @@ -10,8 +10,9 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem.Sources; -internal sealed class GeneratedOutputSource +internal sealed class GeneratedOutputSource(DocumentSnapshot document) { + private readonly DocumentSnapshot _document = document; private readonly SemaphoreSlim _gate = new(initialCount: 1); // Hold the output in a WeakReference to avoid memory leaks in the case of a long-lived @@ -31,7 +32,7 @@ public bool TryGetValue([NotNullWhen(true)] out RazorCodeDocument? result) return output.TryGetTarget(out result); } - public async ValueTask GetValueAsync(DocumentSnapshot document, CancellationToken cancellationToken) + public async ValueTask GetValueAsync(CancellationToken cancellationToken) { if (TryGetValue(out var result)) { @@ -45,12 +46,12 @@ public async ValueTask GetValueAsync(DocumentSnapshot documen return result; } - var project = document.Project; + var project = _document.Project; var projectEngine = project.ProjectEngine; var compilerOptions = project.CompilerOptions; result = await CompilationHelpers - .GenerateCodeDocumentAsync(document, projectEngine, compilerOptions, cancellationToken) + .GenerateCodeDocumentAsync(_document, projectEngine, compilerOptions, cancellationToken) .ConfigureAwait(false); if (_output is null) diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DocumentStateTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DocumentStateTest.cs index 1162177b1f8..abbd343b4da 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DocumentStateTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DocumentStateTest.cs @@ -61,100 +61,4 @@ public async Task DocumentState_WithTextLoader_CreatesNewState() var text = await state.GetTextAsync(DisposalToken); Assert.Same(_text, text); } - - [Fact] - public void DocumentState_WithConfigurationChange_CachesSnapshotText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithText(_text, VersionStamp.Create()); - - // Act - var state = original.WithConfigurationChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } - - [Fact] - public async Task DocumentState_WithConfigurationChange_CachesLoadedText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithTextLoader(_textLoader); - - await original.GetTextAsync(DisposalToken); - - // Act - var state = original.WithConfigurationChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } - - [Fact] - public void DocumentState_WithImportsChange_CachesSnapshotText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithText(_text, VersionStamp.Create()); - - // Act - var state = original.WithImportsChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } - - [Fact] - public async Task DocumentState_WithImportsChange_CachesLoadedText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithTextLoader(_textLoader); - - await original.GetTextAsync(DisposalToken); - - // Act - var state = original.WithImportsChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } - - [Fact] - public void DocumentState_WithProjectWorkspaceStateChange_CachesSnapshotText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithText(_text, VersionStamp.Create()); - - // Act - var state = original.WithProjectWorkspaceStateChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } - - [Fact] - public async Task DocumentState_WithProjectWorkspaceStateChange_CachesLoadedText() - { - // Arrange - var original = DocumentState.Create(_hostDocument, EmptyTextLoader.Instance) - .WithTextLoader(_textLoader); - - await original.GetTextAsync(DisposalToken); - - // Act - var state = original.WithProjectWorkspaceStateChange(); - - // Assert - Assert.True(state.TryGetText(out _)); - Assert.True(state.TryGetTextVersion(out _)); - } } diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateGeneratedOutputTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateGeneratedOutputTest.cs deleted file mode 100644 index 00e59121da3..00000000000 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateGeneratedOutputTest.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Collections.Immutable; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.ProjectSystem; -using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; - -public class ProjectStateGeneratedOutputTest : WorkspaceTestBase -{ - private readonly HostDocument _hostDocument; - private readonly HostProject _hostProject; - private readonly HostProject _hostProjectWithConfigurationChange; - private readonly ImmutableArray _someTagHelpers; - - public ProjectStateGeneratedOutputTest(ITestOutputHelper testOutput) - : base(testOutput) - { - _hostProject = TestProjectData.SomeProject with { Configuration = FallbackRazorConfiguration.MVC_2_0 }; - _hostProjectWithConfigurationChange = TestProjectData.SomeProject with { Configuration = FallbackRazorConfiguration.MVC_1_0 }; - - _someTagHelpers = ImmutableArray.Create( - TagHelperDescriptorBuilder.Create("Test1", "TestAssembly").Build()); - - _hostDocument = TestProjectData.SomeProjectFile1; - } - - protected override void ConfigureProjectEngine(RazorProjectEngineBuilder builder) - { - builder.SetImportFeature(new TestImportProjectFeature(HierarchicalImports.Legacy)); - } - - [Fact] - public async Task AddDocument_CachesOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.AddEmptyDocument(TestProjectData.AnotherProjectFile1); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.Same(output, newOutput); - } - - [Fact] - public async Task AddDocument_Import_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.AddEmptyDocument(TestProjectData.SomeProjectImportFile); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - [Fact] - public async Task WithDocumentText_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument) - .AddEmptyDocument(TestProjectData.SomeProjectImportFile); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.WithDocumentText(_hostDocument.FilePath, TestMocks.CreateTextLoader("@using System")); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - [Fact] - public async Task WithDocumentText_Import_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument) - .AddEmptyDocument(TestProjectData.SomeProjectImportFile); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.WithDocumentText(TestProjectData.SomeProjectImportFile.FilePath, TestMocks.CreateTextLoader("@using System")); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - [Fact] - public async Task RemoveDocument_Import_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument) - .AddEmptyDocument(TestProjectData.SomeProjectImportFile); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.RemoveDocument(TestProjectData.SomeProjectImportFile.FilePath); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - [Fact] - public async Task WithProjectWorkspaceState_CachesOutput_EvenWhenNewerProjectWorkspaceState() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.WithProjectWorkspaceState(ProjectWorkspaceState.Default); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.Same(output, newOutput); - } - - [Fact] - public async Task WithProjectWorkspaceState_TagHelperChange_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.WithProjectWorkspaceState(ProjectWorkspaceState.Create(_someTagHelpers)); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - [Fact] - public async Task WithHostProject_DoesNotCacheOutput() - { - // Arrange - var state = ProjectState - .Create(_hostProject, CompilerOptions, ProjectEngineFactoryProvider) - .AddEmptyDocument(_hostDocument); - - var output = await GetGeneratedOutputAsync(state, _hostDocument); - - // Act - var newState = state.WithHostProject(_hostProjectWithConfigurationChange); - var newOutput = await GetGeneratedOutputAsync(newState, _hostDocument); - - // Assert - Assert.NotSame(output, newOutput); - } - - private ValueTask GetGeneratedOutputAsync(ProjectState project, HostDocument hostDocument) - { - var document = project.Documents[hostDocument.FilePath]; - - var projectSnapshot = new ProjectSnapshot(project); - var documentSnapshot = new DocumentSnapshot(projectSnapshot, document); - - return documentSnapshot.GetGeneratedOutputAsync(DisposalToken); - } -} From ca595e14aba45afafa32baa0fa119a7ff0178286 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 24 Mar 2025 16:53:12 -0700 Subject: [PATCH 037/223] BackgroundDocumentGenerator: Stop forcing compilation The BackgroundDocumentGenerator doesn't need to force compilation before updating the DynamicFileInfo system with a document snapshot. When the Roslyn workspace receives the DynamicFileInfo, compilation will occur through the TextLoader. --- .../DynamicFiles/BackgroundDocumentGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/BackgroundDocumentGenerator.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/BackgroundDocumentGenerator.cs index 176ee3622eb..4019de0e859 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/BackgroundDocumentGenerator.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/BackgroundDocumentGenerator.cs @@ -86,11 +86,11 @@ public void Dispose() protected Task WaitUntilCurrentBatchCompletesAsync() => _workQueue.WaitUntilCurrentBatchCompletesAsync(); - protected virtual async Task ProcessDocumentAsync(DocumentSnapshot document, CancellationToken cancellationToken) + protected virtual Task ProcessDocumentAsync(DocumentSnapshot document, CancellationToken cancellationToken) { - await document.GetGeneratedOutputAsync(cancellationToken).ConfigureAwait(false); - UpdateFileInfo(document); + + return Task.CompletedTask; } public virtual void EnqueueIfNecessary(DocumentKey documentKey) From 18f87c243046c70da7d820f8532f255cea695943 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 24 Mar 2025 16:54:46 -0700 Subject: [PATCH 038/223] RazorDynamicFileInfoProvider: A bit of clean up --- .../RazorDynamicFileInfoProvider.cs | 185 +++++++----------- 1 file changed, 66 insertions(+), 119 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/RazorDynamicFileInfoProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/RazorDynamicFileInfoProvider.cs index 83738b06df1..057a4b8fbf9 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/RazorDynamicFileInfoProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/DynamicFiles/RazorDynamicFileInfoProvider.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -68,15 +69,8 @@ public void UpdateLSPFileInfo(Uri documentUri, IDynamicDocumentContainer documen { Debug.Assert(!_languageServerFeatureOptions.UseRazorCohostServer, "Should never be called in cohosting"); - if (documentUri is null) - { - throw new ArgumentNullException(nameof(documentUri)); - } - - if (documentContainer is null) - { - throw new ArgumentNullException(nameof(documentContainer)); - } + ArgHelper.ThrowIfNull(documentUri); + ArgHelper.ThrowIfNull(documentContainer); // This endpoint is only called in LSP cases when the file is open(ed) // We report diagnostics are supported to Roslyn in this case @@ -109,10 +103,7 @@ public void UpdateFileInfo(ProjectKey projectKey, IDynamicDocumentContainer docu { Debug.Assert(!_languageServerFeatureOptions.UseRazorCohostServer, "Should never be called in cohosting"); - if (documentContainer is null) - { - throw new ArgumentNullException(nameof(documentContainer)); - } + ArgHelper.ThrowIfNull(documentContainer); // This endpoint is called either when: // 1. LSP: File is closed @@ -123,8 +114,7 @@ public void UpdateFileInfo(ProjectKey projectKey, IDynamicDocumentContainer docu // There's a possible race condition here where we're processing an update // and the project is getting unloaded. So if we don't find an entry we can // just ignore it. - var projectId = TryFindProjectIdForProjectKey(projectKey); - if (projectId is null) + if (!TryFindProjectIdForProjectKey(projectKey, out var projectId)) { return; } @@ -147,46 +137,35 @@ public void PromoteBackgroundDocument(Uri documentUri, IRazorDocumentPropertiesS { Debug.Assert(!_languageServerFeatureOptions.UseRazorCohostServer, "Should never be called in cohosting"); - if (documentUri is null) - { - throw new ArgumentNullException(nameof(documentUri)); - } - - if (propertiesService is null) - { - throw new ArgumentNullException(nameof(propertiesService)); - } + ArgHelper.ThrowIfNull(documentUri); + ArgHelper.ThrowIfNull(propertiesService); var filePath = GetProjectSystemFilePath(documentUri); - foreach (var associatedKvp in GetAllKeysForPath(filePath)) + foreach (var (key, entry) in GetAllKeysForPath(filePath)) { - var associatedKey = associatedKvp.Key; - var associatedEntry = associatedKvp.Value; - - var projectId = associatedKey.ProjectId; - var projectKey = TryFindProjectKeyForProjectId(projectId); - if (projectKey is not ProjectKey key) + var projectId = key.ProjectId; + if (!TryFindProjectKeyForProjectId(projectId, out var projectKey)) { Debug.Fail("Could not find project key for project id. This should never happen."); continue; } - var filename = _filePathService.GetRazorCSharpFilePath(key, associatedKey.FilePath); + var filename = _filePathService.GetRazorCSharpFilePath(projectKey, key.FilePath); // To promote the background document, we just need to add the passed in properties service to // the dynamic file info. The properties service contains the client name and allows the C# // server to recognize the document. - var documentServiceProvider = associatedEntry.Current.DocumentServiceProvider; + var documentServiceProvider = entry.Current.DocumentServiceProvider; var excerptService = documentServiceProvider.GetService(); var spanMappingService = documentServiceProvider.GetService(); var mappingService = documentServiceProvider.GetService(); var emptyContainer = new PromotedDynamicDocumentContainer( - documentUri, propertiesService, excerptService, spanMappingService, mappingService, associatedEntry.Current.TextLoader); + documentUri, propertiesService, excerptService, spanMappingService, mappingService, entry.Current.TextLoader); - lock (associatedEntry.Lock) + lock (entry.Lock) { - associatedEntry.Current = new RazorDynamicFileInfo( - filename, associatedEntry.Current.SourceCodeKind, associatedEntry.Current.TextLoader, _factory.Create(emptyContainer)); + entry.Current = new RazorDynamicFileInfo( + filename, entry.Current.SourceCodeKind, entry.Current.TextLoader, _factory.Create(emptyContainer)); } } @@ -217,8 +196,7 @@ public void SuppressDocument(DocumentKey documentKey) // There's a possible race condition here where we're processing an update // and the project is getting unloaded. So if we don't find an entry we can // just ignore it. - var projectId = TryFindProjectIdForProjectKey(documentKey.ProjectKey); - if (projectId is null) + if (!TryFindProjectIdForProjectKey(documentKey.ProjectKey, out var projectId)) { return; } @@ -250,25 +228,17 @@ public void SuppressDocument(DocumentKey documentKey) return SpecializedTasks.Null(); } - if (projectFilePath is null) - { - throw new ArgumentNullException(nameof(projectFilePath)); - } - - if (filePath is null) - { - throw new ArgumentNullException(nameof(filePath)); - } + ArgHelper.ThrowIfNull(projectFilePath); + ArgHelper.ThrowIfNull(filePath); // We are activated for all Roslyn projects that have a .cshtml or .razor file, but they are not necessarily // C# projects that we expect. - var projectKey = TryFindProjectKeyForProjectId(projectId); - if (projectKey is not { } razorProjectKey) + if (!TryFindProjectKeyForProjectId(projectId, out var projectKey)) { return SpecializedTasks.Null(); } - _fallbackProjectManager.DynamicFileAdded(projectId, razorProjectKey, projectFilePath, filePath, cancellationToken); + _fallbackProjectManager.DynamicFileAdded(projectId, projectKey, projectFilePath, filePath, cancellationToken); var key = new Key(projectId, filePath); var entry = _entries.GetOrAdd(key, _createEmptyEntry); @@ -280,23 +250,15 @@ public Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projectFileP { Debug.Assert(!_languageServerFeatureOptions.UseRazorCohostServer, "Should never be called in cohosting"); - if (projectFilePath is null) - { - throw new ArgumentNullException(nameof(projectFilePath)); - } - - if (filePath is null) - { - throw new ArgumentNullException(nameof(filePath)); - } + ArgHelper.ThrowIfNull(projectFilePath); + ArgHelper.ThrowIfNull(filePath); - var projectKey = TryFindProjectKeyForProjectId(projectId); - if (projectKey is not { } razorProjectKey) + if (!TryFindProjectKeyForProjectId(projectId, out var projectKey)) { return Task.CompletedTask; } - _fallbackProjectManager.DynamicFileRemoved(projectId, razorProjectKey, projectFilePath, filePath, cancellationToken); + _fallbackProjectManager.DynamicFileRemoved(projectId, projectKey, projectFilePath, filePath, cancellationToken); // ---------------------------------------------------------- NOTE & CAUTION -------------------------------------------------------------- // @@ -330,8 +292,6 @@ public static string GetProjectSystemFilePath(Uri uri) return uri.AbsolutePath; } - public TestAccessor GetTestAccessor() => new(this); - private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args) { Debug.Assert(!_languageServerFeatureOptions.UseRazorCohostServer, "Should never be called in cohosting"); @@ -352,7 +312,7 @@ private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args) { var removedProject = args.Older.AssumeNotNull(); - if (TryFindProjectIdForProjectKey(removedProject.Key) is { } projectId) + if (TryFindProjectIdForProjectKey(removedProject.Key, out var projectId)) { foreach (var documentFilePath in removedProject.DocumentFilePaths) { @@ -366,56 +326,61 @@ private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args) } } - private ProjectId? TryFindProjectIdForProjectKey(ProjectKey key) + private bool TryFindProjectIdForProjectKey(ProjectKey key, [NotNullWhen(true)] out ProjectId? projectId) { var workspace = _workspaceProvider.GetWorkspace(); if (workspace.CurrentSolution.TryGetProject(key, out var project)) { - return project.Id; + projectId = project.Id; + return true; } - return null; + projectId = null; + return false; } - private ProjectKey? TryFindProjectKeyForProjectId(ProjectId projectId) + private bool TryFindProjectKeyForProjectId(ProjectId projectId, out ProjectKey projectKey) { var workspace = _workspaceProvider.GetWorkspace(); - return workspace.CurrentSolution.GetProject(projectId) is { Language: LanguageNames.CSharp } project - ? project.ToProjectKey() - : null; + if (workspace.CurrentSolution.GetProject(projectId) is { Language: LanguageNames.CSharp } project) + { + projectKey = project.ToProjectKey(); + return true; + } + + projectKey = default; + return false; } private RazorDynamicFileInfo CreateEmptyInfo(Key key) { - var projectKey = TryFindProjectKeyForProjectId(key.ProjectId).AssumeNotNull(); + Assumed.True(TryFindProjectKeyForProjectId(key.ProjectId, out var projectKey)); + var filename = _filePathService.GetRazorCSharpFilePath(projectKey, key.FilePath); var textLoader = new EmptyTextLoader(filename); + return new RazorDynamicFileInfo(filename, SourceCodeKind.Regular, textLoader, _factory.CreateEmpty()); } private RazorDynamicFileInfo CreateInfo(Key key, IDynamicDocumentContainer document) { - var projectKey = TryFindProjectKeyForProjectId(key.ProjectId).AssumeNotNull(); + Assumed.True(TryFindProjectKeyForProjectId(key.ProjectId, out var projectKey)); + var filename = _filePathService.GetRazorCSharpFilePath(projectKey, key.FilePath); var textLoader = document.GetTextLoader(filename); + return new RazorDynamicFileInfo(filename, SourceCodeKind.Regular, textLoader, _factory.Create(document)); } // Using a separate handle to the 'current' file info so that can allow Roslyn to send // us the add/remove operations, while we process the update operations. - private class Entry + private sealed class Entry(RazorDynamicFileInfo current) { - public Entry(RazorDynamicFileInfo current) - { - Current = current; - Lock = new object(); - } - - public RazorDynamicFileInfo Current { get; set; } + public RazorDynamicFileInfo Current { get; set; } = current; - public object Lock { get; } + public object Lock { get; } = new object(); public override string ToString() { @@ -426,28 +391,17 @@ public override string ToString() } } - private readonly struct Key : IEquatable + private readonly struct Key(ProjectId projectId, string filePath) : IEquatable { - public readonly ProjectId ProjectId; - public readonly string FilePath; - - public Key(ProjectId projectId, string filePath) - { - ProjectId = projectId; - FilePath = filePath; - } + public readonly ProjectId ProjectId = projectId; + public readonly string FilePath = filePath; public bool Equals(Key other) - { - return - ProjectId.Equals(other.ProjectId) && - FilePathComparer.Instance.Equals(FilePath, other.FilePath); - } + => ProjectId.Equals(other.ProjectId) && + FilePathComparer.Instance.Equals(FilePath, other.FilePath); public override bool Equals(object? obj) - { - return obj is Key other && Equals(other); - } + => obj is Key other && Equals(other); public override int GetHashCode() { @@ -458,22 +412,18 @@ public override int GetHashCode() } } - private class EmptyTextLoader : TextLoader + private class EmptyTextLoader(string filePath) : TextLoader { - private readonly string _filePath; - private readonly VersionStamp _version; + // Providing an encoding here is important for debuggability. Without this edit-and-continue + // won't work for projects with Razor files. + private static readonly SourceText s_emptyText = SourceText.From("", Encoding.UTF8); - public EmptyTextLoader(string filePath) - { - _filePath = filePath; - _version = VersionStamp.Default; // Version will never change so this can be reused. - } + private readonly string _filePath = filePath; public override Task LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) { - // Providing an encoding here is important for debuggability. Without this edit-and-continue - // won't work for projects with Razor files. - return Task.FromResult(TextAndVersion.Create(SourceText.From("", Encoding.UTF8), _version, _filePath)); + var version = VersionStamp.Default; // Version will never change so this can be reused. + return Task.FromResult(TextAndVersion.Create(s_emptyText, version, _filePath)); } } @@ -512,14 +462,11 @@ public void SetSupportsDiagnostics(bool value) public IRazorMappingService? GetMappingService() => _mappingService; } - public class TestAccessor - { - private readonly RazorDynamicFileInfoProvider _provider; + public TestAccessor GetTestAccessor() => new(this); - public TestAccessor(RazorDynamicFileInfoProvider provider) - { - _provider = provider; - } + public class TestAccessor(RazorDynamicFileInfoProvider provider) + { + private readonly RazorDynamicFileInfoProvider _provider = provider; public async Task GetDynamicFileInfoAsync(ProjectId projectId, string filePath, CancellationToken cancellationToken) { From 24ba58a09b6c664753e298d8829b75a0ece23788 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Sat, 22 Mar 2025 05:39:06 -0700 Subject: [PATCH 039/223] ProjectSnapshot: Set capacity and don't create map until needed ProjectSnapshot.TryGetDocument(...) turns out to be a significant source of dictionary growth. However, we always know the number of documents in a particular ProjectSnapshot from its ProjectState, so we can set the capacity up front. --- .../ProjectSystem/ProjectSnapshot.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs index 07ba138b574..6c8ee99348a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs @@ -20,7 +20,7 @@ internal sealed class ProjectSnapshot(ProjectState state) : IProjectSnapshot, IL private readonly ProjectState _state = state; private readonly object _gate = new(); - private readonly Dictionary _filePathToDocumentMap = new(FilePathNormalizingComparer.Instance); + private Dictionary? _filePathToDocumentMap; public HostProject HostProject => _state.HostProject; public RazorCompilerOptions CompilerOptions => _state.CompilerOptions; @@ -53,8 +53,12 @@ public bool ContainsDocument(string filePath) // ImmutableDictionary<,>, which has O(log n) lookup. So, checking _filePathToDocumentMap // first is faster if the DocumentSnapshot has already been created. - return _filePathToDocumentMap.ContainsKey(filePath) || - _state.Documents.ContainsKey(filePath); + if (_filePathToDocumentMap is not null && _filePathToDocumentMap.ContainsKey(filePath)) + { + return true; + } + + return _state.Documents.ContainsKey(filePath); } } @@ -63,7 +67,8 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out DocumentSnap lock (_gate) { // Have we already seen this document? If so, return it! - if (_filePathToDocumentMap.TryGetValue(filePath, out var snapshot)) + if (_filePathToDocumentMap is not null && + _filePathToDocumentMap.TryGetValue(filePath, out var snapshot)) { document = snapshot; return true; @@ -78,6 +83,8 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out DocumentSnap // If we have DocumentState, go ahead and create a new DocumentSnapshot. snapshot = new DocumentSnapshot(this, state); + + _filePathToDocumentMap ??= new(capacity: _state.Documents.Count, FilePathNormalizingComparer.Instance); _filePathToDocumentMap.Add(filePath, snapshot); document = snapshot; From a34f723efe9140cdc823a217f4545c0ef4310deb Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 26 Mar 2025 15:02:26 +1100 Subject: [PATCH 040/223] Move file to the right folder --- .../Protocol/{Competion => Completion}/CompletionPositionInfo.cs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/{Competion => Completion}/CompletionPositionInfo.cs (100%) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Competion/CompletionPositionInfo.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/CompletionPositionInfo.cs similarity index 100% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Competion/CompletionPositionInfo.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/CompletionPositionInfo.cs From 6c44d91ab4b8481b29cb44546a8e04ba40e30732 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 26 Mar 2025 15:02:43 +1100 Subject: [PATCH 041/223] Strongly type to our own completion list type to ensure correct serialization of completion items --- .../RazorCompletionBenchmark.cs | 4 +- .../Completion/CompletionListProvider.cs | 8 ++-- .../DelegatedCompletionListProvider.cs | 6 +-- .../Completion/RazorCompletionEndpoint.cs | 4 +- .../Completion/CompletionListMerger.cs | 12 ++--- .../Completion/CompletionListOptimizer.cs | 10 ++--- .../Delegation/DelegatedCompletionHelper.cs | 12 ++--- .../DesignTimeHelperResponseRewriter.cs | 6 +-- .../HtmlCommitCharacterResponseRewriter.cs | 4 +- ...legatedCSharpCompletionResponseRewriter.cs | 4 +- .../Delegation/SnippetResponseRewriter.cs | 6 +-- .../Delegation/TextEditResponseRewriter.cs | 8 ++-- .../Completion/RazorCompletionListProvider.cs | 8 ++-- .../VSInternalCompletionListExtensions.cs | 2 +- .../RazorVSInternalCompletionList.cs | 45 +++++++++++++++++++ .../Remote/IRemoteCompletionService.cs | 2 +- .../Completion/RemoteCompletionService.cs | 14 +++--- .../CohostDocumentCompletionEndpoint.cs | 26 +++++------ .../RazorCustomMessageTarget_Completion.cs | 17 +++---- .../Snippets/SnippetCompletionItemProvider.cs | 4 +- .../Completion/CompletionListProviderTest.cs | 20 ++++----- .../RazorCompletionResolveEndpointTest.cs | 10 ++--- .../Completion/CompletionListMergerTest.cs | 12 ++--- .../Completion/CompletionListOptimizerTest.cs | 4 +- 24 files changed, 145 insertions(+), 103 deletions(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorVSInternalCompletionList.cs diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs index 8b714529df7..738bbd9412a 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs @@ -151,7 +151,7 @@ public TestDelegatedCompletionListProvider( { } - public override ValueTask GetCompletionListAsync( + public override ValueTask GetCompletionListAsync( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, @@ -160,6 +160,6 @@ public TestDelegatedCompletionListProvider( RazorCompletionOptions completionOptions, Guid correlationId, CancellationToken cancellationToken) - => new(new VSInternalCompletionList()); + => new(new RazorVSInternalCompletionList() { Items = [] }); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs index 6aa68a99199..adaf720c506 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs @@ -22,7 +22,7 @@ internal class CompletionListProvider( private readonly DelegatedCompletionListProvider _delegatedCompletionListProvider = delegatedCompletionListProvider; private readonly CompletionTriggerAndCommitCharacters _triggerAndCommitCharacters = triggerAndCommitCharacters; - public ValueTask GetCompletionListAsync( + public ValueTask GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, DocumentContext documentContext, @@ -49,7 +49,7 @@ internal class CompletionListProvider( : default; } - private async Task GetCompletionListCoreAsync( + private async Task GetCompletionListCoreAsync( int absoluteIndex, VSInternalCompletionContext completionContext, DocumentContext documentContext, @@ -65,7 +65,7 @@ internal class CompletionListProvider( var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); // First we delegate to get completion items from the individual language server - VSInternalCompletionList? delegatedCompletionList = null; + RazorVSInternalCompletionList? delegatedCompletionList = null; HashSet? existingItems = null; if (isDelegationTrigger) @@ -90,7 +90,7 @@ internal class CompletionListProvider( } // Now we get the Razor completion list, using information from the actual language server if necessary - VSInternalCompletionList? razorCompletionList = null; + RazorVSInternalCompletionList? razorCompletionList = null; if (isRazorTrigger) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs index c0adcf0d286..4e67a2cb513 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs @@ -40,7 +40,7 @@ public DelegatedCompletionListProvider( } // virtual for tests - public virtual ValueTask GetCompletionListAsync( + public virtual ValueTask GetCompletionListAsync( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, @@ -91,7 +91,7 @@ public DelegatedCompletionListProvider( cancellationToken)); } - private async Task GetDelegatedCompletionListAsync( + private async Task GetDelegatedCompletionListAsync( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, @@ -114,7 +114,7 @@ public DelegatedCompletionListProvider( correlationId); var delegatedResponse = await _clientConnection - .SendRequestAsync( + .SendRequestAsync( LanguageServerConstants.RazorCompletionEndpointName, delegatedParams, cancellationToken) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs index ee8fcee93ad..d5c4242e62c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs @@ -21,7 +21,7 @@ internal class RazorCompletionEndpoint( CompletionTriggerAndCommitCharacters triggerAndCommitCharacters, ITelemetryReporter telemetryReporter, RazorLSPOptionsMonitor optionsMonitor) - : IRazorRequestHandler, ICapabilitiesProvider + : IRazorRequestHandler, ICapabilitiesProvider { private readonly CompletionListProvider _completionListProvider = completionListProvider; private readonly CompletionTriggerAndCommitCharacters _triggerAndCommitCharacters = triggerAndCommitCharacters; @@ -49,7 +49,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(CompletionParams request return request.TextDocument; } - public async Task HandleRequestAsync(CompletionParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) + public async Task HandleRequestAsync(CompletionParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) { if (request.Context is not VSInternalCompletionContext completionContext || requestContext.DocumentContext is not { } documentContext) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListMerger.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListMerger.cs index 3ab515a9925..1073b73b7a0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListMerger.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListMerger.cs @@ -19,7 +19,7 @@ internal static class CompletionListMerger [return: NotNullIfNotNull(nameof(razorCompletionList))] [return: NotNullIfNotNull(nameof(delegatedCompletionList))] - public static VSInternalCompletionList? Merge(VSInternalCompletionList? razorCompletionList, VSInternalCompletionList? delegatedCompletionList) + public static RazorVSInternalCompletionList? Merge(RazorVSInternalCompletionList? razorCompletionList, RazorVSInternalCompletionList? delegatedCompletionList) { if (razorCompletionList is null) { @@ -46,7 +46,7 @@ internal static class CompletionListMerger // We don't fully support merging edit ranges currently. Razor doesn't currently use them so delegated completion lists always win. var mergedItemDefaultsEditRange = razorCompletionList.ItemDefaults?.EditRange ?? delegatedCompletionList.ItemDefaults?.EditRange; - var mergedCompletionList = new VSInternalCompletionList() + var mergedCompletionList = new RazorVSInternalCompletionList() { CommitCharacters = mergedCommitCharacters, Data = mergedData, @@ -141,7 +141,7 @@ private static void TrySplitJsonElement(object data, ref PooledArrayBuilder? completionItemsToStopInheriting; - VSInternalCompletionList? completionListToStopInheriting; + RazorVSInternalCompletionList? completionListToStopInheriting; // Decide which completion list has more items that benefit from "inheriting" commit characters. if (inheritableCommitCharacterCompletionsA.Length >= inheritableCommitCharacterCompletionsB.Length) @@ -205,7 +205,7 @@ private static void EnsureMergeableCommitCharacters(VSInternalCompletionList com } } - private static ImmutableArray GetCompletionsThatDoNotSpecifyCommitCharacters(VSInternalCompletionList completionList) + private static ImmutableArray GetCompletionsThatDoNotSpecifyCommitCharacters(RazorVSInternalCompletionList completionList) { using var inheritableCompletions = new PooledArrayBuilder(); for (var i = 0; i < completionList.Items.Length; i++) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListOptimizer.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListOptimizer.cs index d4fa42bfcbc..4e09baf97c9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListOptimizer.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/CompletionListOptimizer.cs @@ -9,19 +9,17 @@ namespace Microsoft.CodeAnalysis.Razor.Completion; internal static class CompletionListOptimizer { - public static VSInternalCompletionList Optimize(VSInternalCompletionList completionList, VSInternalCompletionSetting? completionCapability) + public static RazorVSInternalCompletionList Optimize(RazorVSInternalCompletionList completionList, VSInternalCompletionSetting? completionCapability) { if (completionCapability is not null) { completionList = OptimizeCommitCharacters(completionList, completionCapability); } - // We wrap the pre-existing completion list with an optimized completion list to better control serialization/deserialization - var optimizedCompletionList = new OptimizedVSCompletionList(completionList); - return optimizedCompletionList; + return completionList; } - private static VSInternalCompletionList OptimizeCommitCharacters(VSInternalCompletionList completionList, VSInternalCompletionSetting completionCapability) + private static RazorVSInternalCompletionList OptimizeCommitCharacters(RazorVSInternalCompletionList completionList, VSInternalCompletionSetting completionCapability) { var completionListCapability = completionCapability.CompletionList; if (completionListCapability?.CommitCharacters != true) @@ -34,7 +32,7 @@ private static VSInternalCompletionList OptimizeCommitCharacters(VSInternalCompl return completionList; } - private static VSInternalCompletionList PromoteVSCommonCommitCharactersOntoList(VSInternalCompletionList completionList) + private static RazorVSInternalCompletionList PromoteVSCommonCommitCharactersOntoList(RazorVSInternalCompletionList completionList) { (AliasedVSCommitCharacters VsCommitCharacters, List AssociatedCompletionItems)? mostUsedCommitCharacterToItems = null; var commitCharacterMap = new Dictionary>(AliasedVSCommitCharactersComparer.Instance); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DelegatedCompletionHelper.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DelegatedCompletionHelper.cs index bfc8de69c0a..c3d4632f800 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DelegatedCompletionHelper.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DelegatedCompletionHelper.cs @@ -92,8 +92,8 @@ internal static class DelegatedCompletionHelper /// /// Possibly modified completion response. /// - public static VSInternalCompletionList RewriteCSharpResponse( - VSInternalCompletionList? delegatedResponse, + public static RazorVSInternalCompletionList RewriteCSharpResponse( + RazorVSInternalCompletionList? delegatedResponse, int absoluteIndex, RazorCodeDocument codeDocument, Position projectedPosition, @@ -105,7 +105,7 @@ public static VSInternalCompletionList RewriteCSharpResponse( // list. When a user is typing quickly, the delegated request from the first keystroke will fail to synchronize, // so if we return a "complete" list then the query won't re-query us for completion once the typing stops/slows // so we'd only ever return Razor completion items. - return new VSInternalCompletionList() { IsIncomplete = true, Items = [] }; + return new RazorVSInternalCompletionList() { IsIncomplete = true, Items = [] }; } var rewrittenResponse = delegatedResponse; @@ -123,8 +123,8 @@ public static VSInternalCompletionList RewriteCSharpResponse( return rewrittenResponse; } - public static VSInternalCompletionList RewriteHtmlResponse( - VSInternalCompletionList? delegatedResponse, + public static RazorVSInternalCompletionList RewriteHtmlResponse( + RazorVSInternalCompletionList? delegatedResponse, RazorCompletionOptions completionOptions) { if (delegatedResponse?.Items is null) @@ -133,7 +133,7 @@ public static VSInternalCompletionList RewriteHtmlResponse( // list. When a user is typing quickly, the delegated request from the first keystroke will fail to synchronize, // so if we return a "complete" list then the query won't re-query us for completion once the typing stops/slows // so we'd only ever return Razor completion items. - return new VSInternalCompletionList() { IsIncomplete = true, Items = [] }; + return new RazorVSInternalCompletionList() { IsIncomplete = true, Items = [] }; } var rewrittenResponse = s_delegatedHtmlCompletionResponseRewriter.Rewrite( diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DesignTimeHelperResponseRewriter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DesignTimeHelperResponseRewriter.cs index 76b84a0caa4..4825fd47673 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DesignTimeHelperResponseRewriter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/DesignTimeHelperResponseRewriter.cs @@ -29,8 +29,8 @@ internal class DesignTimeHelperResponseRewriter : IDelegatedCSharpCompletionResp "BuildRenderTree" }.ToFrozenSet(); - public VSInternalCompletionList Rewrite( - VSInternalCompletionList completionList, + public RazorVSInternalCompletionList Rewrite( + RazorVSInternalCompletionList completionList, RazorCodeDocument codeDocument, int hostDocumentIndex, Position projectedPosition, @@ -53,7 +53,7 @@ public VSInternalCompletionList Rewrite( // from the completion list. If the current identifier does start with a double underscore (e.g. "__ab[||]"), // we only trim out common design time helpers from the completion list. - using var _ = ListPool.GetPooledObject(out var filteredItems); + using var _ = ListPool.GetPooledObject(out var filteredItems); var items = completionList.Items; filteredItems.SetCapacityIfLarger(items.Length); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs index 9c3b0a28ac8..1c2bbff2389 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/HtmlCommitCharacterResponseRewriter.cs @@ -8,8 +8,8 @@ namespace Microsoft.CodeAnalysis.Razor.Completion.Delegation; internal class HtmlCommitCharacterResponseRewriter { - public VSInternalCompletionList Rewrite( - VSInternalCompletionList completionList, + public RazorVSInternalCompletionList Rewrite( + RazorVSInternalCompletionList completionList, RazorCompletionOptions completionOptions) { if (completionOptions.CommitElementsWithSpace) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/IDelegatedCSharpCompletionResponseRewriter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/IDelegatedCSharpCompletionResponseRewriter.cs index 12164b395fd..bd623a77cef 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/IDelegatedCSharpCompletionResponseRewriter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/IDelegatedCSharpCompletionResponseRewriter.cs @@ -7,8 +7,8 @@ namespace Microsoft.CodeAnalysis.Razor.Completion.Delegation; internal interface IDelegatedCSharpCompletionResponseRewriter { - VSInternalCompletionList Rewrite( - VSInternalCompletionList completionList, + RazorVSInternalCompletionList Rewrite( + RazorVSInternalCompletionList completionList, RazorCodeDocument codeDocument, int hostDocumentIndex, Position projectedPosition, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/SnippetResponseRewriter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/SnippetResponseRewriter.cs index bf47392ba69..3abf03ecb8a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/SnippetResponseRewriter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/SnippetResponseRewriter.cs @@ -14,14 +14,14 @@ namespace Microsoft.CodeAnalysis.Razor.Completion.Delegation; /// internal class SnippetResponseRewriter : IDelegatedCSharpCompletionResponseRewriter { - public VSInternalCompletionList Rewrite( - VSInternalCompletionList completionList, + public RazorVSInternalCompletionList Rewrite( + RazorVSInternalCompletionList completionList, RazorCodeDocument codeDocument, int hostDocumentIndex, Position projectedPosition, RazorCompletionOptions completionOptionsn) { - using var items = new PooledArrayBuilder(completionList.Items.Length); + using var items = new PooledArrayBuilder(completionList.Items.Length); foreach (var item in completionList.Items) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/TextEditResponseRewriter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/TextEditResponseRewriter.cs index 106f7ec9c18..e7d83891b47 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/TextEditResponseRewriter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/Delegation/TextEditResponseRewriter.cs @@ -7,8 +7,8 @@ namespace Microsoft.CodeAnalysis.Razor.Completion.Delegation; internal class TextEditResponseRewriter : IDelegatedCSharpCompletionResponseRewriter { - public VSInternalCompletionList Rewrite( - VSInternalCompletionList completionList, + public RazorVSInternalCompletionList Rewrite( + RazorVSInternalCompletionList completionList, RazorCodeDocument codeDocument, int hostDocumentIndex, Position projectedPosition, @@ -35,10 +35,10 @@ public VSInternalCompletionList Rewrite( return completionList; } - private static VSInternalCompletionList TranslateTextEdits( + private static RazorVSInternalCompletionList TranslateTextEdits( Position hostDocumentPosition, Position projectedPosition, - VSInternalCompletionList completionList) + RazorVSInternalCompletionList completionList) { // The TextEdit positions returned to us from the C#/HTML language servers are positions correlating to the virtual document. // We need to translate these positions to apply to the Razor document instead. Performance is a big concern here, so we want to diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/RazorCompletionListProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/RazorCompletionListProvider.cs index eaa56dfed14..3a6b37195c4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/RazorCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/RazorCompletionListProvider.cs @@ -30,7 +30,7 @@ internal class RazorCompletionListProvider( }; // virtual for tests - public virtual VSInternalCompletionList? GetCompletionList( + public virtual RazorVSInternalCompletionList? GetCompletionList( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, @@ -84,11 +84,11 @@ internal class RazorCompletionListProvider( } // Internal for benchmarking and testing - internal static VSInternalCompletionList CreateLSPCompletionList( + internal static RazorVSInternalCompletionList CreateLSPCompletionList( ImmutableArray razorCompletionItems, VSInternalClientCapabilities clientCapabilities) { - using var items = new PooledArrayBuilder(); + using var items = new PooledArrayBuilder(); foreach (var razorCompletionItem in razorCompletionItems) { @@ -98,7 +98,7 @@ internal static VSInternalCompletionList CreateLSPCompletionList( } } - var completionList = new VSInternalCompletionList() + var completionList = new RazorVSInternalCompletionList() { Items = items.ToArray(), IsIncomplete = false, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/VSInternalCompletionListExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/VSInternalCompletionListExtensions.cs index 9b0e25b7fa5..c0b12459007 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/VSInternalCompletionListExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Completion/VSInternalCompletionListExtensions.cs @@ -13,7 +13,7 @@ internal static class VSInternalCompletionListExtensions private const string ResultIdKey = "_resultId"; public static void SetResultId( - this VSInternalCompletionList completionList, + this RazorVSInternalCompletionList completionList, int resultId, VSInternalCompletionSetting? completionSetting) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorVSInternalCompletionList.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorVSInternalCompletionList.cs new file mode 100644 index 00000000000..bcd55e061d8 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Completion/RazorVSInternalCompletionList.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using Microsoft.CodeAnalysis.Razor.Protocol; + +namespace Roslyn.LanguageServer.Protocol; + +/// +/// A subclass of the LSP protocol that ensures correct serialization between LSP servers. +/// +/// +/// This is the same as the LSP protocol except that it strongly types the property, +/// because our custom message target gets handled by a JsonRpc connection set up by the editor, that has no Roslyn converters. +/// +internal class RazorVSInternalCompletionList : VSInternalCompletionList +{ + public RazorVSInternalCompletionList() + { + } + + [SetsRequiredMembers] + public RazorVSInternalCompletionList(VSInternalCompletionList completionList) + { + this.Data = completionList.Data; + this.CommitCharacters = completionList.CommitCharacters; + this.ContinueCharacters = completionList.ContinueCharacters; + this.IsIncomplete = completionList.IsIncomplete; + this.Items = JsonHelpers.ConvertAll(completionList.Items); + this.ItemDefaults = completionList.ItemDefaults; + this.SuggestionMode = completionList.SuggestionMode; + } + + /// + /// The completion items. + /// + [JsonPropertyName("items")] + [JsonRequired] + public new required VSInternalCompletionItem[] Items + { + get => (VSInternalCompletionItem[])base.Items; + set => base.Items = value; + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteCompletionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteCompletionService.cs index 8a949d326f7..9ed8c840bb3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteCompletionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteCompletionService.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Completion; using Microsoft.CodeAnalysis.Razor.Protocol.Completion; -using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; namespace Microsoft.CodeAnalysis.Razor.Remote; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs index 0dabec3176e..325d4743cba 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -extern alias RLSP; - using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -17,7 +15,7 @@ using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -119,7 +117,7 @@ private async ValueTask GetCompletionAsync( var codeDocument = await documentSnapshot.GetGeneratedOutputAsync(cancellationToken).ConfigureAwait(false); - VSInternalCompletionList? csharpCompletionList = null; + RazorVSInternalCompletionList? csharpCompletionList = null; if (isCSharpTrigger) { var mappedPosition = documentPositionInfo.Position; @@ -144,7 +142,7 @@ private async ValueTask GetCompletionAsync( } } - VSInternalCompletionList? razorCompletionList = null; + RazorVSInternalCompletionList? razorCompletionList = null; if (isRazorTrigger) { @@ -167,7 +165,7 @@ private async ValueTask GetCompletionAsync( return Response.Results(mergedCompletionList); } - private async ValueTask GetCSharpCompletionAsync( + private async ValueTask GetCSharpCompletionAsync( SourceGeneratedDocument generatedDocument, RazorCodeDocument codeDocument, int documentIndex, @@ -199,7 +197,7 @@ private async ValueTask GetCompletionAsync( // list. When a user is typing quickly, the delegated request from the first keystroke will fail to synchronize, // so if we return a "complete" list then the query won't re-query us for completion once the typing stops/slows // so we'd only ever return Razor completion items. - return new VSInternalCompletionList() + return new RazorVSInternalCompletionList() { Items = [], IsIncomplete = true @@ -207,7 +205,7 @@ private async ValueTask GetCompletionAsync( } var rewrittenResponse = DelegatedCompletionHelper.RewriteCSharpResponse( - completionList, + new(completionList), documentIndex, codeDocument, mappedPosition, diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentCompletionEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentCompletionEndpoint.cs index 99a9a053a20..ebbd4f7e869 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentCompletionEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentCompletionEndpoint.cs @@ -20,7 +20,7 @@ using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Razor.Snippets; -using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; @@ -39,7 +39,7 @@ internal sealed class CohostDocumentCompletionEndpoint( LanguageServerFeatureOptions languageServerFeatureOptions, LSPRequestInvoker requestInvoker, ILoggerFactory loggerFactory) - : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider { private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; @@ -75,10 +75,10 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(CompletionParams request) => request.TextDocument?.ToRazorTextDocumentIdentifier(); - protected override Task HandleRequestAsync(CompletionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + protected override Task HandleRequestAsync(CompletionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); - private async Task HandleRequestAsync(CompletionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + private async Task HandleRequestAsync(CompletionParams request, TextDocument razorDocument, CancellationToken cancellationToken) { if (request.Context is null || JsonHelpers.Convert(request.Context) is not { } completionContext) @@ -126,7 +126,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie // First of all, see if we in HTML and get HTML completions before calling OOP to get Razor completions. // Razor completion provider needs a set of existing HTML item labels. - VSInternalCompletionList? htmlCompletionList = null; + RazorVSInternalCompletionList? htmlCompletionList = null; var razorCompletionOptions = new RazorCompletionOptions( SnippetsSupported: true, // always true in non-legacy Razor, always false in legacy Razor AutoInsertAttributeQuotes: clientSettings.AdvancedSettings.AutoInsertAttributeQuotes, @@ -169,7 +169,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie return null; } - VSInternalCompletionList? combinedCompletionList = null; + RazorVSInternalCompletionList? combinedCompletionList = null; if (data.Result is { } oopCompletionList) { combinedCompletionList = htmlCompletionList is { Items: [_, ..] } @@ -195,7 +195,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie return combinedCompletionList; } - private async Task GetHtmlCompletionListAsync( + private async Task GetHtmlCompletionListAsync( CompletionParams request, TextDocument razorDocument, RazorCompletionOptions razorCompletionOptions, @@ -211,7 +211,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie _logger.LogDebug($"Resolving auto-insertion edit for {htmlDocument.Uri}"); - var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( htmlDocument.Buffer, Methods.TextDocumentCompletionName, RazorLSPConstants.HtmlLanguageServerName, @@ -223,13 +223,13 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie return rewrittenResponse; } - private VSInternalCompletionList? AddSnippets( - VSInternalCompletionList? completionList, + private RazorVSInternalCompletionList? AddSnippets( + RazorVSInternalCompletionList? completionList, RazorLanguageKind languageKind, VSInternalCompletionInvokeKind invokeKind, string? triggerCharacter) { - using var builder = new PooledArrayBuilder(); + using var builder = new PooledArrayBuilder(); _snippetCompletionItemProvider.AddSnippetCompletions( languageKind, invokeKind, @@ -251,7 +251,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie // Create or update final completion list if (completionList is null) { - completionList = new VSInternalCompletionList { IsIncomplete = true, Items = builder.ToArray() }; + completionList = new RazorVSInternalCompletionList { IsIncomplete = true, Items = builder.ToArray() }; } else { @@ -265,7 +265,7 @@ public ImmutableArray GetRegistrations(VSInternalClientCapabilitie internal readonly struct TestAccessor(CohostDocumentCompletionEndpoint instance) { - public Task HandleRequestAsync( + public Task HandleRequestAsync( CompletionParams request, TextDocument razorDocument, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs index ac1ebe9e1af..fc793f96407 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs @@ -60,7 +60,7 @@ internal partial class RazorCustomMessageTarget } [JsonRpcMethod(LanguageServerConstants.RazorCompletionEndpointName, UseSingleObjectParameterDeserialization = true)] - public async Task ProvideCompletionsAsync( + public async Task ProvideCompletionsAsync( DelegatedCompletionParams request, CancellationToken cancellationToken) { @@ -127,10 +127,10 @@ internal partial class RazorCustomMessageTarget { var textBuffer = virtualDocumentSnapshot.Snapshot.TextBuffer; var lspMethodName = Methods.TextDocumentCompletion.Name; - ReinvocationResponse? response; + ReinvocationResponse? response; using (_telemetryReporter.TrackLspRequest(lspMethodName, languageServerName, TelemetryThresholds.CompletionSubLSPTelemetryThreshold, request.CorrelationId)) { - response = await _requestInvoker.ReinvokeRequestOnServerAsync( + response = await _requestInvoker.ReinvokeRequestOnServerAsync( textBuffer, lspMethodName, languageServerName, @@ -139,7 +139,7 @@ internal partial class RazorCustomMessageTarget } var completionList = response?.Response; - using var builder = new PooledArrayBuilder(); + using var builder = new PooledArrayBuilder(); if (completionList is not null) { @@ -147,8 +147,9 @@ internal partial class RazorCustomMessageTarget } else { - completionList = new VSInternalCompletionList() + completionList = new RazorVSInternalCompletionList() { + Items = [], // If we don't get a response from the delegated server, we have to make sure to return an incomplete completion // list. When a user is typing quickly, the delegated request from the first keystroke will fail to synchronize, // so if we return a "complete" list then the query won't re-query us for completion once the typing stops/slows @@ -240,7 +241,7 @@ private void UpdateVirtualDocument( } [JsonRpcMethod(LanguageServerConstants.RazorCompletionResolveEndpointName, UseSingleObjectParameterDeserialization = true)] - public async Task ProvideResolvedCompletionItemAsync(DelegatedCompletionItemResolveParams request, CancellationToken cancellationToken) + public async Task ProvideResolvedCompletionItemAsync(DelegatedCompletionItemResolveParams request, CancellationToken cancellationToken) { // Check if we're completing a snippet item that we provided if (SnippetCompletionData.TryParse(request.CompletionItem.Data, out var snippetCompletionData) && @@ -294,7 +295,7 @@ private void UpdateVirtualDocument( } var textBuffer = virtualDocumentSnapshot.Snapshot.TextBuffer; - var response = await _requestInvoker.ReinvokeRequestOnServerAsync( + var response = await _requestInvoker.ReinvokeRequestOnServerAsync( textBuffer, Methods.TextDocumentCompletionResolve.Name, languageServerName, @@ -319,7 +320,7 @@ private void UpdateVirtualDocument( TabSize = formattingOptions.TabSize, InsertSpaces = formattingOptions.InsertSpaces, // Options come from the VS protocol DLL, which uses Dict for options, but Roslyn is more strongly typed. - OtherOptions = formattingOptions.OtherOptions.ToDictionary(k => k.Key, v => v.Value switch + OtherOptions = formattingOptions.OtherOptions?.ToDictionary(k => k.Key, v => v.Value switch { bool b => b, int i => i, diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Snippets/SnippetCompletionItemProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Snippets/SnippetCompletionItemProvider.cs index 937c120bc87..87bd371969b 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Snippets/SnippetCompletionItemProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Snippets/SnippetCompletionItemProvider.cs @@ -24,7 +24,7 @@ public void AddSnippetCompletions( RazorLanguageKind projectedKind, VSInternalCompletionInvokeKind invokeKind, string? triggerCharacter, - ref PooledArrayBuilder builder) + ref PooledArrayBuilder builder) { // Temporary fix: snippets are broken in CSharp. We're investigating // but this is very disruptive. This quick fix unblocks things. @@ -53,7 +53,7 @@ public void AddSnippetCompletions( } builder.AddRange(snippets - .Select(s => new CompletionItem() + .Select(s => new VSInternalCompletionItem() { Label = s.Shortcut, Detail = s.Description, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs index 18d638fea94..dec7d6f9b75 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs @@ -21,8 +21,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion; public class CompletionListProviderTest : LanguageServerTestBase { - private readonly VSInternalCompletionList _completionList1; - private readonly VSInternalCompletionList _completionList2; + private readonly RazorVSInternalCompletionList _completionList1; + private readonly RazorVSInternalCompletionList _completionList2; private readonly RazorCompletionListProvider _razorCompletionProvider; private readonly DelegatedCompletionListProvider _delegatedCompletionProvider; private readonly VSInternalCompletionContext _completionContext; @@ -34,8 +34,8 @@ public class CompletionListProviderTest : LanguageServerTestBase public CompletionListProviderTest(ITestOutputHelper testOutput) : base(testOutput) { - _completionList1 = new VSInternalCompletionList() { Items = [] }; - _completionList2 = new VSInternalCompletionList() { Items = [] }; + _completionList1 = new RazorVSInternalCompletionList() { Items = [] }; + _completionList2 = new RazorVSInternalCompletionList() { Items = [] }; _razorCompletionProvider = new TestRazorCompletionListProvider(_completionList1, LoggerFactory); _delegatedCompletionProvider = new TestDelegatedCompletionListProvider(_completionList2); _completionContext = new VSInternalCompletionContext(); @@ -80,15 +80,15 @@ public async Task MultipleCompletionLists_DifferentCommitCharacters_OnlyCallsApp private class TestDelegatedCompletionListProvider : DelegatedCompletionListProvider { - private readonly VSInternalCompletionList _completionList; + private readonly RazorVSInternalCompletionList _completionList; - public TestDelegatedCompletionListProvider(VSInternalCompletionList completionList) + public TestDelegatedCompletionListProvider(RazorVSInternalCompletionList completionList) : base(null, null, null, null) { _completionList = completionList; } - public override ValueTask GetCompletionListAsync( + public override ValueTask GetCompletionListAsync( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, @@ -104,17 +104,17 @@ public override ValueTask GetCompletionListAsync( private class TestRazorCompletionListProvider : RazorCompletionListProvider { - private readonly VSInternalCompletionList _completionList; + private readonly RazorVSInternalCompletionList _completionList; public TestRazorCompletionListProvider( - VSInternalCompletionList completionList, + RazorVSInternalCompletionList completionList, ILoggerFactory loggerFactory) : base(completionFactsService: null, completionListCache: null, loggerFactory) { _completionList = completionList; } - public override VSInternalCompletionList GetCompletionList( + public override RazorVSInternalCompletionList GetCompletionList( RazorCodeDocument codeDocument, int absoluteIndex, VSInternalCompletionContext completionContext, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs index 29b763e3b59..149953f55b5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionResolveEndpointTest.cs @@ -72,7 +72,7 @@ public async Task Handle_EvictedCachedCompletionItem_NoChange() { // Arrange var completionItem = new VSInternalCompletionItem() { Label = "Test" }; - var completionList = new VSInternalCompletionList() { Items = [completionItem] }; + var completionList = new RazorVSInternalCompletionList() { Items = [completionItem] }; completionList.SetResultId(1337, completionSetting: null); var parameters = ConvertToBridgedItem(completionItem); var requestContext = CreateRazorRequestContext(documentContext: null); @@ -89,7 +89,7 @@ public async Task Handle_CachedCompletionItem_Resolves() { // Arrange var completionItem = new VSInternalCompletionItem() { Label = "Test" }; - var completionList = new VSInternalCompletionList() { Items = [completionItem] }; + var completionList = new RazorVSInternalCompletionList() { Items = [completionItem] }; var resultId = _completionListCache.Add(completionList, StrictMock.Of()); completionList.SetResultId(resultId, completionSetting: null); var parameters = ConvertToBridgedItem(completionItem); @@ -110,7 +110,7 @@ public async Task Handle_MultipleResultIdsIgnoresEvictedResultIds_Resolves() // Arrange await InitializeAsync(); var completionItem = new VSInternalCompletionItem() { Label = "Test" }; - var completionList = new VSInternalCompletionList() { Items = [completionItem] }; + var completionList = new RazorVSInternalCompletionList() { Items = [completionItem] }; completionList.SetResultId(/* Invalid */ 1337, completionSetting: null); var resultId = _completionListCache.Add(completionList, StrictMock.Of()); completionList.SetResultId(resultId, completionSetting: null); @@ -132,13 +132,13 @@ public async Task Handle_MergedCompletionListFindsProperCompletionList_Resolves( // Arrange await InitializeAsync(); var completionSetting = new VSInternalCompletionSetting() { CompletionList = new VSInternalCompletionListSetting() { Data = true } }; - var completionList1 = new VSInternalCompletionList() { Items = [] }; + var completionList1 = new RazorVSInternalCompletionList() { Items = [] }; var completion1Context = StrictMock.Of(); var resultId1 = _completionListCache.Add(completionList1, completion1Context); completionList1.SetResultId(resultId1, completionSetting); var completionItem = new VSInternalCompletionItem() { Label = "Test" }; - var completionList2 = new VSInternalCompletionList() { Items = [completionItem] }; + var completionList2 = new RazorVSInternalCompletionList() { Items = [completionItem] }; var completion2Context = StrictMock.Of(); var resultId2 = _completionListCache.Add(completionList2, completion2Context); completionList2.SetResultId(resultId2, completionSetting); diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs index 2e83e3c19bb..64bf88008ff 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs @@ -13,9 +13,9 @@ public class CompletionListMergerTest : ToolingTestBase private readonly VSInternalCompletionItem _completionItem1; private readonly VSInternalCompletionItem _completionItem2; private readonly VSInternalCompletionItem _completionItem3; - private readonly VSInternalCompletionList _completionListWith1; - private readonly VSInternalCompletionList _completionListWith2; - private readonly VSInternalCompletionList _completionListWith13; + private readonly RazorVSInternalCompletionList _completionListWith1; + private readonly RazorVSInternalCompletionList _completionListWith2; + private readonly RazorVSInternalCompletionList _completionListWith13; public CompletionListMergerTest(ITestOutputHelper testOutput) : base(testOutput) @@ -35,17 +35,17 @@ public CompletionListMergerTest(ITestOutputHelper testOutput) Label = "CompletionItem3" }; - _completionListWith1 = new VSInternalCompletionList() + _completionListWith1 = new RazorVSInternalCompletionList() { Items = [_completionItem1] }; - _completionListWith2 = new VSInternalCompletionList() + _completionListWith2 = new RazorVSInternalCompletionList() { Items = [_completionItem2] }; - _completionListWith13 = new VSInternalCompletionList() + _completionListWith13 = new RazorVSInternalCompletionList() { Items = [_completionItem1, _completionItem3] }; diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs index 7b99d5e7943..90d2a70f3a3 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs @@ -14,7 +14,7 @@ public void Convert_CommitCharactersTrue_RemovesCommitCharactersFromItems() { // Arrange var commitCharacters = new[] { "<" }; - var completionList = new VSInternalCompletionList() + var completionList = new RazorVSInternalCompletionList() { Items = new[] { @@ -50,7 +50,7 @@ public void Convert_CommitCharactersFalse_DoesNotTouchCommitCharacters() { // Arrange var commitCharacters = new[] { "<" }; - var completionList = new VSInternalCompletionList() + var completionList = new RazorVSInternalCompletionList() { Items = [ new VSInternalCompletionItem() From 34974809d809db22ba5208475eeb3a9c4a1f3f20 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 26 Mar 2025 17:07:42 +1100 Subject: [PATCH 042/223] Remove unused usings --- .../LanguageServer/CSharpTestLspServerHelpers.cs | 1 - .../LanguageServer/TestClientCapabilitiesService.cs | 1 - .../LanguageServer/TestRazorSemanticTokensLegendService.cs | 1 - .../Cohost/CohostDocumentCompletionEndpointTest.cs | 1 - .../Cohost/CohostDocumentHighlightEndpointTest.cs | 1 - .../Cohost/CohostDocumentPullDiagnosticsTest.cs | 1 - .../Cohost/CohostDocumentSymbolEndpointTest.cs | 2 -- .../Cohost/CohostEndpointTest.cs | 1 - .../Cohost/CohostEndpointTestBase.cs | 3 +-- .../Cohost/CohostFindAllReferencesEndpointTest.cs | 1 - .../Cohost/CohostFoldingRangeEndpointTest.cs | 1 - .../Cohost/CohostGoToDefinitionEndpointTest.cs | 1 - .../Cohost/CohostHoverEndpointTest.cs | 1 - .../Cohost/CohostInlayHintEndpointTest.cs | 1 - .../Cohost/CohostInlineCompletionEndpointTest.cs | 1 - .../Cohost/CohostLinkedEditingRangeEndpointTest.cs | 1 - .../Cohost/CohostOnAutoInsertEndpointTest.cs | 1 - .../Cohost/CohostOnTypeFormattingEndpointTest.cs | 1 - .../Cohost/CohostRangeFormattingEndpointTest.cs | 1 - .../Cohost/CohostRenameEndpointTest.cs | 1 - .../Cohost/CohostSignatureHelpEndpointTest.cs | 2 -- .../Cohost/CohostTextPresentationEndpointTest.cs | 1 - .../Cohost/CohostUriPresentationEndpointTest.cs | 2 -- .../Cohost/CohostValidateBreakableRangeEndpointTest.cs | 1 - .../Cohost/FormattingTestBase.cs | 1 - .../Cohost/HoverAssertions.cs | 3 +-- .../Cohost/RazorComponentDefinitionServiceTest.cs | 1 - .../Debugging/RazorProximityExpressionResolverTest.cs | 1 - .../DocumentMapping/LSPDocumentMappingProviderTest.cs | 1 - .../LanguageClient/RazorCustomMessageTargetTest.cs | 1 - .../LanguageClient/TestDocumentManager.cs | 1 - .../LanguageClient/TestRazorLSPSpanMappingService.cs | 1 - .../RazorLanguageService_IVsLanguageDebugInfoTest.cs | 1 - .../Telemetry/TelemetryReporterTests.cs | 1 - 34 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs index b8d021241c7..07e57ceec27 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs @@ -18,7 +18,6 @@ using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Composition; -using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs index e7c1af358c4..56b25ce496f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Razor.Protocol; -using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Test; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs index 11e8fb3ce75..8688dee484c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.AspNetCore.Razor.LanguageServer.Test; -using Roslyn.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs index b388f948d6f..dc44894154d 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs @@ -13,7 +13,6 @@ using Microsoft.VisualStudio.ProjectSystem; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Razor.Snippets; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs index 76732cd08df..e34c2fcf89a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs index e64e4188598..67d28afd215 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Razor.Settings; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs index 2525728f5ed..990b4c1fbd2 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs @@ -5,10 +5,8 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; -using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs index 0cf089879c1..1e36d9f0b1e 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs @@ -18,7 +18,6 @@ using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Threading; using Newtonsoft.Json.Linq; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; using VSLSP = Microsoft.VisualStudio.LanguageServer.Protocol; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs index 1131200c192..21a1a8a625c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs @@ -23,9 +23,8 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.NET.Sdk.Razor.SourceGenerators; using Microsoft.VisualStudio.Composition; -using Roslyn.LanguageServer.Protocol; -using Xunit; using Roslyn.Test.Utilities; +using Xunit; using Xunit.Abstractions; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs index 786dbc5e5ff..326e8771fdf 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Text.Adornments; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs index 151ece4e5f4..54678b02fd3 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index 91329aacc51..3d29bb9373a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; using TextDocument = Microsoft.CodeAnalysis.TextDocument; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs index 9164ee09a0a..a960115c999 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs index e1f2b1b5209..b729c60db64 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlineCompletionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlineCompletionEndpointTest.cs index 773e8c71d3c..b08aae7776f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlineCompletionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlineCompletionEndpointTest.cs @@ -16,7 +16,6 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Razor.Snippets; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs index 220f4149ce5..2633656ecd7 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis.Razor.LinkedEditingRange; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs index 0aa745c70db..e9cd6f55686 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.Settings; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs index 1caecd9a13f..d97ae78b6a9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs @@ -11,7 +11,6 @@ using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Threading; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs index 03871d03406..8dad7731e6a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs @@ -11,7 +11,6 @@ using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Threading; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs index 48a4a72d797..e1215b0130f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs index 97083089045..dfbe7cc41cb 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs @@ -3,12 +3,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; -using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Settings; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; using Microsoft.VisualStudio.Razor.Settings; using Xunit; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs index b0d97f6a95c..aa8f6ef4d5b 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs index 7ec28e71f4a..4d93b5b5d4e 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs @@ -3,10 +3,8 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Testing; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostValidateBreakableRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostValidateBreakableRangeEndpointTest.cs index 16ba6e4fff1..40b26622249 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostValidateBreakableRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostValidateBreakableRangeEndpointTest.cs @@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/FormattingTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/FormattingTestBase.cs index 9959c42859c..09bb8bf301a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/FormattingTestBase.cs @@ -14,7 +14,6 @@ using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.Razor.Settings; using Microsoft.VisualStudio.Threading; -using Roslyn.LanguageServer.Protocol; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HoverAssertions.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HoverAssertions.cs index 5267e679d39..c8b4decc986 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HoverAssertions.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HoverAssertions.cs @@ -10,7 +10,6 @@ using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.Razor.Tooltip; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Roslyn.Text.Adornments; using Xunit; @@ -79,7 +78,7 @@ public static Action Run(string text, string? classificationT Assert.Equal(text, run.Text); }; - public static Action ClassName (string text) + public static Action ClassName(string text) => Run(text, ClassificationTypeNames.ClassName); public static Action Keyword(string text) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs index 64f8fd9a8d5..936fee3656c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs @@ -9,7 +9,6 @@ using Microsoft.CodeAnalysis.Razor.GoToDefinition; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs index f687b0ebd6f..b3129ae4af9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs @@ -16,7 +16,6 @@ using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; using Moq; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs index f8813482118..bd942f66daa 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; using Moq; using Xunit; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs index c88f25507e3..869454e06f0 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs @@ -24,7 +24,6 @@ using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Threading; using Moq; -using Roslyn.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs index 4c93d3b3488..a18c30c2337 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs index 36022330fd0..71929d39ac0 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs @@ -11,7 +11,6 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; -using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping; namespace Microsoft.VisualStudio.Razor.LanguageClient; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs index 589fe3e69ba..47c5b81fd03 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.Editor; using Microsoft.VisualStudio.Editor; -using Roslyn.LanguageServer.Protocol; using Microsoft.VisualStudio.Razor.Debugging; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.TextManager.Interop; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs index 16fb711b951..2e37fe2dc58 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs @@ -13,7 +13,6 @@ using Microsoft.VisualStudio.Editor.Razor.Test.Shared; using Microsoft.VisualStudio.Telemetry; using Microsoft.VisualStudio.Telemetry.Metrics; -using Roslyn.LanguageServer.Protocol; using StreamJsonRpc; using Xunit; using Xunit.Abstractions; From 54571484f027924cc3ee83f702bb79bce3b7a061 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 26 Mar 2025 17:43:30 +1100 Subject: [PATCH 043/223] Fix tests and random cleanup --- .../Definition/DefinitionEndpoint.cs | 4 ++-- .../Implementation/ImplementationEndpoint.cs | 2 +- .../MapCode/Mappers/InsertMapper.cs | 4 ++-- .../Extensions/LspExtensions_Location.cs | 2 +- .../Extensions/LspFactory.cs | 8 ++++---- ...ustomMessageTarget_TextDocumentPosition.cs | 12 ++++++------ ...legatedCompletionItemResolverTest.NetFx.cs | 14 +++++++------- .../DelegatedCompletionListProviderTest.cs | 4 ++-- .../DesignTimeHelperResponseRewriterTest.cs | 9 +++------ ...HtmlCommitCharacterResponseRewriterTest.cs | 19 ++++++++----------- .../Delegation/ResponseRewriterTestBase.cs | 4 ++-- .../Delegation/SnippetResponseRewriterTest.cs | 17 ++++++----------- .../TestDelegatedCompletionListProvider.cs | 12 ++++++------ .../TextEditResponseRewriterTest.cs | 6 ++---- .../MapCode/MapCodeTest.cs | 4 ++-- .../CohostDocumentCompletionEndpointTest.cs | 6 +++--- .../Cohost/CohostEndpointTest.cs | 11 ++--------- .../CohostFindAllReferencesEndpointTest.cs | 12 ++++++------ .../Cohost/CohostFoldingRangeEndpointTest.cs | 4 ++-- .../CohostGoToDefinitionEndpointTest.cs | 13 ++++++------- .../Cohost/CohostRenameEndpointTest.cs | 2 +- 21 files changed, 74 insertions(+), 95 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index 6a773b256fe..3b4546eea3d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -107,11 +107,11 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V var result = response.GetValueOrDefault().Value; // Not using .TryGetXXX because this does the null check for us too - if (result is Location location) + if (result is LspLocation location) { (location.Uri, location.Range) = await _documentMappingService.MapToHostDocumentUriAndRangeAsync(location.Uri, location.Range, cancellationToken).ConfigureAwait(false); } - else if (result is Location[] locations) + else if (result is LspLocation[] locations) { foreach (var loc in locations) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs index 98021680a84..6fbb28ffcf0 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Implementation/ImplementationEndpoint.cs @@ -64,7 +64,7 @@ protected async override Task HandleDelegatedResponseAsync var result = delegatedResponse.Value; // Not using .TryGetXXX because this does the null check for us too - if (result is Location[] locations) + if (result is LspLocation[] locations) { foreach (var loc in locations) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs index 9f77fb752f9..189751b9038 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/Mappers/InsertMapper.cs @@ -12,7 +12,7 @@ internal static class InsertMapper public static int? GetInsertionPoint( SyntaxNode documentRoot, SourceText sourceText, - Location focusArea) + LspLocation focusArea) { // If there's an specific focus area, or caret provided, we should try to insert as close as possible. // As long as the focused area is not empty. @@ -33,7 +33,7 @@ internal static class InsertMapper private static bool TryGetFocusedInsertionPoint( SyntaxNode documentRoot, SourceText sourceText, - Location focusArea, + LspLocation focusArea, out int insertionPoint) { // If there's an specific focus area, or caret provided, we should try to insert as close as possible. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Location.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Location.cs index 0a48b15525d..999eae90ccc 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Location.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspExtensions_Location.cs @@ -7,6 +7,6 @@ namespace Roslyn.LanguageServer.Protocol; internal static partial class LspExtensions { - public static void Deconstruct(this Location position, out Uri uri, out LspRange range) + public static void Deconstruct(this LspLocation position, out Uri uri, out LspRange range) => (uri, range) = (position.Uri, position.Range); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs index b1f3aa011d1..1e565f32e3a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LspFactory.cs @@ -160,16 +160,16 @@ public static LspRange CreateSingleLineRange(LinePosition start, int length) public static LspRange CreateSingleLineRange((int line, int character) start, int length) => CreateRange(CreatePosition(start), CreatePosition(start.line, start.character + length)); - public static Location CreateLocation(string filePath, LinePositionSpan span) + public static LspLocation CreateLocation(string filePath, LinePositionSpan span) => CreateLocation(CreateFilePathUri(filePath), CreateRange(span)); - public static Location CreateLocation(Uri uri, LinePositionSpan span) + public static LspLocation CreateLocation(Uri uri, LinePositionSpan span) => CreateLocation(uri, CreateRange(span)); - public static Location CreateLocation(string filePath, LspRange range) + public static LspLocation CreateLocation(string filePath, LspRange range) => CreateLocation(CreateFilePathUri(filePath), range); - public static Location CreateLocation(Uri uri, LspRange range) + public static LspLocation CreateLocation(Uri uri, LspRange range) => new() { Uri = uri, Range = range }; public static DocumentLink CreateDocumentLink(Uri target, LspRange range) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs index 6a5e740bf5a..86fa205d7eb 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs @@ -13,8 +13,8 @@ internal partial class RazorCustomMessageTarget // These handlers do different jobs, but all take a DelegatedPositionParams and in turn request a TextDocumentPositionParams [JsonRpcMethod(CustomMessageNames.RazorDefinitionEndpointName, UseSingleObjectParameterDeserialization = true)] - public Task DefinitionAsync(DelegatedPositionParams request, CancellationToken cancellationToken) - => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentDefinitionName, cancellationToken); + public Task DefinitionAsync(DelegatedPositionParams request, CancellationToken cancellationToken) + => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentDefinitionName, cancellationToken); [JsonRpcMethod(CustomMessageNames.RazorDocumentHighlightEndpointName, UseSingleObjectParameterDeserialization = true)] public Task DocumentHighlightAsync(DelegatedPositionParams request, CancellationToken cancellationToken) @@ -25,12 +25,12 @@ internal partial class RazorCustomMessageTarget => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentHoverName, cancellationToken); [JsonRpcMethod(CustomMessageNames.RazorImplementationEndpointName, UseSingleObjectParameterDeserialization = true)] - public Task> ImplementationAsync(DelegatedPositionParams request, CancellationToken cancellationToken) - => DelegateTextDocumentPositionAndProjectContextAsync>(request, Methods.TextDocumentImplementationName, cancellationToken); + public Task> ImplementationAsync(DelegatedPositionParams request, CancellationToken cancellationToken) + => DelegateTextDocumentPositionAndProjectContextAsync>(request, Methods.TextDocumentImplementationName, cancellationToken); [JsonRpcMethod(CustomMessageNames.RazorSignatureHelpEndpointName, UseSingleObjectParameterDeserialization = true)] - public Task SignatureHelpAsync(DelegatedPositionParams request, CancellationToken cancellationToken) - => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentSignatureHelpName, cancellationToken); + public Task SignatureHelpAsync(DelegatedPositionParams request, CancellationToken cancellationToken) + => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentSignatureHelpName, cancellationToken); private async Task DelegateTextDocumentPositionAndProjectContextAsync(DelegatedPositionParams request, string methodName, CancellationToken cancellationToken) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs index e482c764d7d..2949638130a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs @@ -91,7 +91,7 @@ public async Task ResolveAsync_CanNotFindCompletionItem_Noops() var optionsMonitor = TestRazorLSPOptionsMonitor.Create(); var resolver = new DelegatedCompletionItemResolver(_documentContextFactory, _formattingService.GetValue(), optionsMonitor, server); var item = new VSInternalCompletionItem(); - var notContainingCompletionList = new VSInternalCompletionList(); + var notContainingCompletionList = new RazorVSInternalCompletionList() { Items = [] }; var originalRequestContext = StrictMock.Of(); // Act @@ -110,7 +110,7 @@ public async Task ResolveAsync_UnknownRequestContext_Noops() var optionsMonitor = TestRazorLSPOptionsMonitor.Create(); var resolver = new DelegatedCompletionItemResolver(_documentContextFactory, _formattingService.GetValue(), optionsMonitor, server); var item = new VSInternalCompletionItem(); - var containingCompletionList = new VSInternalCompletionList() { Items = [item] }; + var containingCompletionList = new RazorVSInternalCompletionList() { Items = [item] }; var originalRequestContext = StrictMock.Of(); // Act @@ -133,7 +133,7 @@ public async Task ResolveAsync_UsesItemsData() { Data = expectedData, }; - var containingCompletionList = new VSInternalCompletionList() { Items = [item], Data = new object() }; + var containingCompletionList = new RazorVSInternalCompletionList() { Items = [item], Data = new object() }; var originalRequestContext = new DelegatedCompletionResolutionContext(_csharpCompletionParams, new object()); // Act @@ -152,7 +152,7 @@ public async Task ResolveAsync_InheritsOriginalCompletionListData() var optionsMonitor = TestRazorLSPOptionsMonitor.Create(); var resolver = new DelegatedCompletionItemResolver(_documentContextFactory, _formattingService.GetValue(), optionsMonitor, server); var item = new VSInternalCompletionItem(); - var containingCompletionList = new VSInternalCompletionList() { Items = [item], Data = new object() }; + var containingCompletionList = new RazorVSInternalCompletionList() { Items = [item], Data = new object() }; var expectedData = new object(); var originalRequestContext = new DelegatedCompletionResolutionContext(_csharpCompletionParams, expectedData); @@ -216,7 +216,7 @@ public async Task ResolveAsync_Html_Resolves() var optionsMonitor = TestRazorLSPOptionsMonitor.Create(); var resolver = new DelegatedCompletionItemResolver(_documentContextFactory, _formattingService.GetValue(), optionsMonitor, server); var item = new VSInternalCompletionItem(); - var containingCompletionList = new VSInternalCompletionList() { Items = [item] }; + var containingCompletionList = new RazorVSInternalCompletionList() { Items = [item] }; var originalRequestContext = new DelegatedCompletionResolutionContext(_htmlCompletionParams, new object()); // Act @@ -243,7 +243,7 @@ private async Task ResolveCompletionItemAsync(string c cursorPosition, codeDocument, csharpServer); var originalRequestContext = new DelegatedCompletionResolutionContext(csharpCompletionParams, containingCompletionList.Data); - var item = (VSInternalCompletionItem)containingCompletionList.Items.FirstOrDefault(item => item.Label == itemToResolve); + var item = containingCompletionList.Items.FirstOrDefault(item => item.Label == itemToResolve); if (item is null) { @@ -277,7 +277,7 @@ private async Task CreateCSharpServerAsync(RazorCodeDocumen return csharpServer; } - private async Task<(VSInternalCompletionList, DelegatedCompletionParams)> GetCompletionListAndOriginalParamsAsync( + private async Task<(RazorVSInternalCompletionList, DelegatedCompletionParams)> GetCompletionListAndOriginalParamsAsync( int cursorPosition, RazorCodeDocument codeDocument, CSharpTestLspServer csharpServer) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs index ceb98d7363b..ec8e5597772 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs @@ -355,7 +355,7 @@ await completionProvider.GetCompletionListAsync( Assert.True(requestSent); } - private async Task GetCompletionListAsync(string content, CompletionTriggerKind triggerKind) + private async Task GetCompletionListAsync(string content, CompletionTriggerKind triggerKind) { TestFileMarkupParser.GetPosition(content, out var output, out var cursorPosition); var codeDocument = CreateCodeDocument(output); @@ -366,7 +366,7 @@ private async Task GetCompletionListAsync(string conte CompletionProvider = new CompletionOptions { ResolveProvider = true, - TriggerCharacters = new[] { " ", "(", "=", "#", ".", "<", "[", "{", "\"", "/", ":", "~" } + TriggerCharacters = [" ", "(", "=", "#", ".", "<", "[", "{", "\"", "/", ":", "~"] } }; await using var csharpServer = await CSharpTestLspServerHelpers.CreateCSharpLspServerAsync( diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs index 4988e43ed66..cebdd13b008 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DesignTimeHelperResponseRewriterTest.cs @@ -79,12 +79,9 @@ public async Task RewriteAsync_AlwaysRemovesRazorHelpers() Assert.Equal("__helper", item.Label); } - private static VSInternalCompletionList GenerateCompletionList(params string[] itemLabels) - { - var items = itemLabels.Select(label => new VSInternalCompletionItem() { Label = label }).ToArray(); - return new VSInternalCompletionList() + private static RazorVSInternalCompletionList GenerateCompletionList(params string[] itemLabels) + => new() { - Items = items + Items = [.. itemLabels.Select(label => new VSInternalCompletionItem() { Label = label })] }; - } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs index ba9cf268372..40cdf54b883 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/HtmlCommitCharacterResponseRewriterTest.cs @@ -142,17 +142,15 @@ public async Task RewriteAsync_ItemCommitCharacters_RemovesSpace(bool useVSTypes }); } - private static VSInternalCompletionList GenerateCompletionList(bool useDefaultCommitCharacters, bool useVSTypes, params string[] itemLabels) - { - var items = itemLabels.Select(label => new VSInternalCompletionItem() - { - Kind = CompletionItemKind.Element, - Label = label, - CommitCharacters = useDefaultCommitCharacters ? null : new string[] { " ", ">" } - }).ToArray(); - return new VSInternalCompletionList() + private static RazorVSInternalCompletionList GenerateCompletionList(bool useDefaultCommitCharacters, bool useVSTypes, params string[] itemLabels) + => new() { - Items = items, + Items = [.. itemLabels.Select(label => new VSInternalCompletionItem() + { + Kind = CompletionItemKind.Element, + Label = label, + CommitCharacters = useDefaultCommitCharacters ? null : [" ", ">"] + })], CommitCharacters = (useDefaultCommitCharacters, useVSTypes) switch { (true, true) => new VSInternalCommitCharacter[] { new() { Character = " " }, new() { Character = ">" } }, @@ -160,5 +158,4 @@ private static VSInternalCompletionList GenerateCompletionList(bool useDefaultCo _ => null } }; - } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs index 53dd54b7fd3..3d4feda1227 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs @@ -22,7 +22,7 @@ private protected ResponseRewriterTestBase( private protected Task GetRewrittenCompletionListAsync( int absoluteIndex, string documentContent, - VSInternalCompletionList initialCompletionList) + RazorVSInternalCompletionList initialCompletionList) { var razorCompletionOptions = new RazorCompletionOptions( SnippetsSupported: true, @@ -35,7 +35,7 @@ private protected Task GetRewrittenCompletionListAsync private protected async Task GetRewrittenCompletionListAsync( int absoluteIndex, string documentContent, - VSInternalCompletionList initialCompletionList, + RazorVSInternalCompletionList initialCompletionList, RazorCompletionOptions razorCompletionOptions) { const string FilePath = "C:/path/to/file.cshtml"; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs index 15443a7a614..06bc5f45cfe 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/SnippetResponseRewriterTest.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; @@ -109,18 +108,14 @@ public async Task RewriteAsync_DoesNotChangeIfSnippetLabel() ); } - private static VSInternalCompletionList GenerateCompletionList(params (string? Label, CompletionItemKind Kind)[] itemsData) - { - var items = itemsData.Select(itemData => new VSInternalCompletionItem() + private static RazorVSInternalCompletionList GenerateCompletionList(params (string? Label, CompletionItemKind Kind)[] itemsData) + => new RazorVSInternalCompletionList() + { + Items = [.. itemsData.Select(itemData => new VSInternalCompletionItem() { Label = itemData.Label!, SortText = itemData.Label, - Kind = itemData.Kind}) - .ToArray(); - - return new VSInternalCompletionList() - { - Items = items + Kind = itemData.Kind + })] }; - } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs index 4f4bcc5a02b..9104a1cb986 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TestDelegatedCompletionListProvider.cs @@ -50,12 +50,12 @@ public static TestDelegatedCompletionListProvider Create( } public static TestDelegatedCompletionListProvider Create( - VSInternalCompletionList delegatedCompletionList, + RazorVSInternalCompletionList delegatedCompletionList, ILoggerFactory loggerFactory) { - delegatedCompletionList ??= new VSInternalCompletionList() + delegatedCompletionList ??= new RazorVSInternalCompletionList() { - Items = Array.Empty(), + Items = [], }; var requestResponseFactory = new StaticCompletionRequestResponseFactory(delegatedCompletionList); var provider = new TestDelegatedCompletionListProvider(requestResponseFactory, loggerFactory); @@ -74,10 +74,10 @@ public static TestDelegatedCompletionListProvider CreateWithNullResponse( private class StaticCompletionRequestResponseFactory : CompletionRequestResponseFactory { - private readonly VSInternalCompletionList _completionResponse; + private readonly RazorVSInternalCompletionList _completionResponse; private DelegatedCompletionParams _delegatedParams; - public StaticCompletionRequestResponseFactory(VSInternalCompletionList completionResponse) + public StaticCompletionRequestResponseFactory(RazorVSInternalCompletionList completionResponse) { _completionResponse = completionResponse; } @@ -125,7 +125,7 @@ public override async Task OnDelegationAsync(object parameters) } }; - var delegatedCompletionList = await _csharpServer.ExecuteRequestAsync( + var delegatedCompletionList = await _csharpServer.ExecuteRequestAsync( Methods.TextDocumentCompletionName, csharpCompletionParams, _cancellationToken); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs index 5d224baebc1..233f5ac0e74 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/TextEditResponseRewriterTest.cs @@ -71,9 +71,8 @@ public async Task RewriteAsync_CSharp_AdjustsListRange() Assert.Equal(expectedRange, rewrittenCompletionList.ItemDefaults.EditRange); } - private static VSInternalCompletionList GenerateCompletionList(LspRange textEditRange) - { - return new VSInternalCompletionList() + private static RazorVSInternalCompletionList GenerateCompletionList(LspRange textEditRange) + => new() { Items = [ new VSInternalCompletionItem() @@ -83,5 +82,4 @@ private static VSInternalCompletionList GenerateCompletionList(LspRange textEdit } ] }; - } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs index b802a808ea2..04a5d0d0b7a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs @@ -274,7 +274,7 @@ private async Task VerifyCodeMappingAsync( string[] codeToMap, string expectedCode, string razorFilePath = RazorFilePath, - Location[][]? locations = null) + LspLocation[][]? locations = null) { // Arrange TestFileMarkupParser.GetPositionAndSpans(originalCode, out var output, out int cursorPosition, out ImmutableArray spans); @@ -310,7 +310,7 @@ private async Task VerifyCodeMappingAsync( FocusLocations = locations ?? [ [ - new Location + new LspLocation { Range = sourceText.GetZeroWidthRange(cursorPosition), Uri = new Uri(razorFilePath) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs index dc44894154d..ffa8bebefab 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs @@ -556,16 +556,16 @@ private async Task VerifyCompletionListAsync( // If delegatedItemLabels wasn't supplied, supply our own to ensure delegation isn't happening and causing a false positive result delegatedItemLabels ??= [InvalidLabel]; - var response = new VSInternalCompletionList() + var response = new RazorVSInternalCompletionList() { - Items = delegatedItemLabels.Select((label) => new VSInternalCompletionItem() + Items = [.. delegatedItemLabels.Select((label) => new VSInternalCompletionItem() { Label = label, CommitCharacters = delegatedItemCommitCharacters, // If test specifies not to commit with space, set kind to element since we remove space // commit from elements only. Otherwise test doesn't care, so set to None Kind = !commitElementsWithSpace ? CompletionItemKind.Element : CompletionItemKind.None, - }).ToArray(), + })], IsIncomplete = true }; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs index 1e36d9f0b1e..af30eaf5e66 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTest.cs @@ -66,7 +66,7 @@ public void RegistrationsProvideFilter() // First we verify that the MEF composition above is correct, otherwise this test will be invalid var actualProviders = typeof(CohostLinkedEditingRangeEndpoint).Assembly.GetTypes().Where(t => !t.IsInterface && typeof(IDynamicRegistrationProvider).IsAssignableFrom(t)).ToList(); - Assert.Equal(actualProviders.OrderBy(a => a.Name).Select(r => r.Name).ToArray(), providers.OrderBy(e => e.GetType().Name).Select(r => r.GetType().Name).ToArray()); + Assert.Equal([.. actualProviders.OrderBy(a => a.Name).Select(r => r.Name)], [.. providers.OrderBy(e => e.GetType().Name).Select(r => r.GetType().Name)]); var clientCapabilities = new VSInternalClientCapabilities() { @@ -115,14 +115,7 @@ public void RegistrationsProvideFilter() Assert.Fail($"Did not get any registrations from {endpoint.GetType().Name}. Client capabilities might be wrong?"); } - foreach (var registration in registrations) - { - var options = registration.RegisterOptions as ITextDocumentRegistrationOptions; - if (options is null) - { - Assert.Fail($"Could not convert registration options from {endpoint.GetType().Name} to {nameof(ITextDocumentRegistrationOptions)}. It was {registration.RegisterOptions?.GetType().Name}"); - } - } + Assert.All(registrations, registration => Assert.IsAssignableFrom(registration)); } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs index 326e8771fdf..f27321f9bd8 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs @@ -97,7 +97,7 @@ private async Task VerifyFindAllReferencesAsync(TestCode input, bool supportsVSE return c; }); - var document = CreateProjectAndRazorDocument(input.Text, additionalFiles: additionalFiles.Select(f => (f.fileName, f.testCode.Text)).ToArray()); + var document = CreateProjectAndRazorDocument(input.Text, additionalFiles: [.. additionalFiles.Select(f => (f.fileName, f.testCode.Text))]); var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(input.Position); @@ -150,10 +150,10 @@ private async Task VerifyFindAllReferencesAsync(TestCode input, bool supportsVSE } else { - var additionalFile = Assert.Single(additionalFiles.Where(f => FilePathNormalizingComparer.Instance.Equals(f.fileName, location.Uri.AbsolutePath))); - var text = SourceText.From(additionalFile.testCode.Text); + var (fileName, testCode) = Assert.Single(additionalFiles.Where(f => FilePathNormalizingComparer.Instance.Equals(f.fileName, location.Uri.AbsolutePath))); + var text = SourceText.From(testCode.Text); matchedText = text.Lines[location.Range.Start.Line].ToString(); - Assert.Single(additionalFile.testCode.Spans.Where(s => text.GetRange(s).Equals(location.Range))); + Assert.Single(testCode.Spans.Where(s => text.GetRange(s).Equals(location.Range))); } if (result.TryGetFirst(out var referenceItem)) @@ -173,10 +173,10 @@ private static string GetText(VSInternalReferenceItem referenceItem) return referenceItem.Text.AssumeNotNull().ToString(); } - private static Location GetLocation(SumType r) + private static LspLocation GetLocation(SumType r) { return r.TryGetFirst(out var refItem) - ? refItem.Location ?? Assumed.Unreachable() + ? refItem.Location ?? Assumed.Unreachable() : r.Second; } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs index 54678b02fd3..140beef099b 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs @@ -261,9 +261,9 @@ private static string GenerateTestInput(SourceText inputText, ImmutableArray p.index)) + foreach (var (index, isStart) in markerPositions.OrderByDescending(p => p.index)) { - actual.Insert(marker.index, GetMarker(marker.index, marker.isStart, htmlSpans)); + actual.Insert(index, GetMarker(index, isStart, htmlSpans)); } static string GetMarker(int index, bool isStart, ImmutableArray htmlSpans) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index 3d29bb9373a..d92c14c09f3 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -217,10 +217,9 @@ public async Task Html() var document = CreateProjectAndRazorDocument(input.Text); var inputText = await document.GetTextAsync(DisposalToken); - var htmlResponse = new SumType?(new Location[] + var htmlResponse = new SumType?(new LspLocation[] { - new Location - { + new() { Uri = new Uri(document.CreateUri(), document.Name + FeatureOptions.HtmlVirtualDocumentSuffix), Range = inputText.GetRange(input.Span), }, @@ -232,7 +231,7 @@ public async Task Html() private static string FileName(string projectRelativeFileName) => Path.Combine(TestProjectData.SomeProjectPath, projectRelativeFileName); - private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = null, SumType? htmlResponse = null) + private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = null, SumType? htmlResponse = null) { var document = CreateProjectAndRazorDocument(input.Text, fileKind); var result = await GetGoToDefinitionResultCoreAsync(document, input, htmlResponse); @@ -250,15 +249,15 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = Assert.Equal(document.CreateUri(), location.Uri); } - private async Task?> GetGoToDefinitionResultAsync( + private async Task?> GetGoToDefinitionResultAsync( TestCode input, string? fileKind = null, params (string fileName, string contents)[]? additionalFiles) { var document = CreateProjectAndRazorDocument(input.Text, fileKind, additionalFiles); return await GetGoToDefinitionResultCoreAsync(document, input, htmlResponse: null); } - private async Task?> GetGoToDefinitionResultCoreAsync( - TextDocument document, TestCode input, SumType? htmlResponse) + private async Task?> GetGoToDefinitionResultCoreAsync( + TextDocument document, TestCode input, SumType? htmlResponse) { var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(input.Position); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs index e1215b0130f..ea00ccd4de7 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs @@ -223,7 +223,7 @@ private static string ProcessRazorDocumentEdits(SourceText inputText, Uri razorD { foreach (var edit in textDocumentEdit.Edits) { - inputText = inputText.WithChanges(inputText.GetTextChange(((TextEdit)edit))); + inputText = inputText.WithChanges(inputText.GetTextChange((TextEdit)edit)); } } } From 10b9be86694ff9630dc59cd1a6200b8eb979b0d1 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 27 Mar 2025 17:56:06 +1100 Subject: [PATCH 044/223] Send previous version through with a C# document update request --- .../GeneratedDocumentPublisher.cs | 5 +++-- .../Protocol/UpdateBufferRequest.cs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs index 5f92664284e..368f9fc89d2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs @@ -98,10 +98,11 @@ public void PublishCSharp(ProjectKey projectKey, string filePath, SourceText sou { HostDocumentFilePath = filePath, ProjectKeyId = projectKey.Id, - Changes = textChanges.Select(static t => t.ToRazorTextChange()).ToArray(), + Changes = [.. textChanges.Select(static t => t.ToRazorTextChange())], HostDocumentVersion = hostDocumentVersion, + PreviousHostDocumentVersion = previouslyPublishedData.HostDocumentVersion, PreviousWasEmpty = previouslyPublishedData.SourceText.Length == 0, - Checksum = Convert.ToBase64String(sourceText.GetChecksum().ToArray()), + Checksum = Convert.ToBase64String([.. sourceText.GetChecksum()]), ChecksumAlgorithm = sourceText.ChecksumAlgorithm, SourceEncodingCodePage = sourceText.Encoding?.CodePage }; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/UpdateBufferRequest.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/UpdateBufferRequest.cs index 41da2755228..20d919e88c4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/UpdateBufferRequest.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/UpdateBufferRequest.cs @@ -11,6 +11,9 @@ internal sealed class UpdateBufferRequest [JsonPropertyName("hostDocumentVersion")] public int? HostDocumentVersion { get; set; } + [JsonPropertyName("previousHostDocumentVersion")] + public int? PreviousHostDocumentVersion { get; set; } + [JsonPropertyName("projectKeyId")] public string? ProjectKeyId { get; set; } From 5ed8029f5128f58ffc5cfd36b7ee698fcc9e2d06 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 27 Mar 2025 17:56:25 +1100 Subject: [PATCH 045/223] Make sure the server state is in agreeance with the client by "waiting" for the right version --- ...rCustomMessageTarget_UpdateCSharpBuffer.cs | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs index 47b797d2ef0..ccdcd2f67d2 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.VisualStudio.LanguageServer.Protocol; using StreamJsonRpc; namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; @@ -37,7 +38,8 @@ internal async Task UpdateCSharpBufferCoreAsync(UpdateBufferRequest request, Can return; } - var hostDocumentUri = new Uri(request.HostDocumentFilePath); + var identifier = CreateTextDocumentIdentifier(request); + var hostDocumentUri = identifier.Uri; _logger.LogDebug($"UpdateCSharpBuffer for {request.HostDocumentVersion} of {hostDocumentUri} in {request.ProjectKeyId}"); @@ -74,6 +76,18 @@ request.ProjectKeyId is not null && } } + // First we need to make sure we're synced to the previous version, or the changes won't apply properly. This should no-op in most cases, as this + // is (almost) the only thing that actually moves documents forward, we're really just validating we're in a good state. + // The other thing that updates documents is provisional completion, so this sync point also neatly waits for the provisional + // edit to be reverted, so things don't get confused. + if (request.PreviousHostDocumentVersion is { } previousVersion && + await TrySynchronizeVirtualDocumentAsync(previousVersion, identifier, cancellationToken, rejectOnNewerParallelRequest: false) is { } synchronizedResult && + !synchronizedResult.Synchronized) + { + Debug.Fail($"Roslyn and Razor are probably going to be out of sync now"); + _logger.LogError($"Request to update C# buffer from {previousVersion} to {request.HostDocumentVersion} failed because the server is out of sync. Server version is {synchronizedResult.VirtualSnapshot?.HostDocumentSyncVersion}"); + } + foreach (var virtualDocument in virtualDocuments) { if (virtualDocument.ProjectKey.Equals(new ProjectKey(request.ProjectKeyId))) @@ -120,6 +134,24 @@ request.ProjectKeyId is not null && state: request.PreviousWasEmpty); } + private static TextDocumentIdentifier CreateTextDocumentIdentifier(UpdateBufferRequest request) + { + var hostDocumentUri = new Uri(request.HostDocumentFilePath); + if (request.ProjectKeyId is { } id) + { + return new VSTextDocumentIdentifier + { + Uri = hostDocumentUri, + ProjectContext = new VSProjectContext + { + Id = id, + } + }; + } + + return new TextDocumentIdentifier { Uri = hostDocumentUri }; + } + private int GetLineCountOfVirtualDocument(Uri hostDocumentUri, CSharpVirtualDocumentSnapshot virtualDocument) { if (_documentManager.TryGetDocument(hostDocumentUri, out var newDocSnapshot) && From 54889c7b72c892be9ddb80b9662ca4c4dfa017c6 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 27 Mar 2025 17:56:49 +1100 Subject: [PATCH 046/223] When doing provisional completion, set a different version number other requests wait for us to revert --- .../Endpoints/RazorCustomMessageTarget_Completion.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs index bc3ebe07147..1e4e72d1c8f 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_Completion.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Completion; using Microsoft.CodeAnalysis.Razor.Workspaces.Telemetry; @@ -109,7 +110,11 @@ internal partial class RazorCustomMessageTarget await _joinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var provisionalChange = new VisualStudioTextChange(provisionalTextEdit, virtualDocumentSnapshot.Snapshot); - UpdateVirtualDocument(provisionalChange, request.ProjectedKind, request.Identifier.Version, hostDocumentUri, virtualDocumentSnapshot.Uri); + // We update to a negative version number so that if a request comes in for v6, it won't see our modified document. We revert the version back + // later, don't worry. + UpdateVirtualDocument(provisionalChange, request.ProjectedKind, -1 * request.Identifier.Version, hostDocumentUri, virtualDocumentSnapshot.Uri); + + _logger.LogDebug($"Updated for provisional completion to version -{request.Identifier.Version} of {virtualDocumentSnapshot!.Uri}."); // We want the delegation to continue on the captured context because we're currently on the `main` thread and we need to get back to the // main thread in order to update the virtual buffer with the reverted text edit. @@ -163,6 +168,8 @@ internal partial class RazorCustomMessageTarget { if (provisionalTextEdit is not null) { + _logger.LogDebug($"Reverting the update for provisional completion back to {request.Identifier.Version} of {virtualDocumentSnapshot!.Uri}."); + var revertedProvisionalTextEdit = BuildRevertedEdit(provisionalTextEdit); var revertedProvisionalChange = new VisualStudioTextChange(revertedProvisionalTextEdit, virtualDocumentSnapshot.Snapshot); UpdateVirtualDocument(revertedProvisionalChange, request.ProjectedKind, request.Identifier.Version, hostDocumentUri, virtualDocumentSnapshot.Uri); From cc6e58bb919ae955c8ae701708908bb2531bdd7a Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 27 Mar 2025 20:38:29 +1100 Subject: [PATCH 047/223] Add an integration test that hopefully can find and prevent disco colors --- .../CompletionIntegrationTests.cs | 99 ++++++++++++++----- .../EditorInProcess_Classification.cs | 35 +++++++ 2 files changed, 107 insertions(+), 27 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs index 23cd73aeb66..6455b425f18 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs @@ -294,33 +294,6 @@ protected override void OnAfterRender(bool firstRender) commitChar: '\t'); } - private async Task VerifyTypeAndCommitCompletionAsync(string input, string output, string search, string[] stringsToType, char? commitChar = null, string? expectedSelectedItemLabel = null) - { - await TestServices.SolutionExplorer.AddFileAsync( - RazorProjectConstants.BlazorProjectName, - "Test.razor", - input, - open: true, - ControlledHangMitigatingCancellationToken); - - await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); - - await TestServices.Editor.PlaceCaretAsync(search, charsOffset: 1, ControlledHangMitigatingCancellationToken); - foreach (var stringToType in stringsToType) - { - TestServices.Input.Send(stringToType); - } - - if (expectedSelectedItemLabel is not null) - { - await CommitCompletionAndVerifyAsync(output, expectedSelectedItemLabel, commitChar); - } - else - { - await CommitCompletionAndVerifyAsync(output, commitChar); - } - } - [IdeFact] public async Task SnippetCompletion_DoesntCommitOnSpace() { @@ -477,6 +450,78 @@ public enum MyEnum """); } + [IdeFact, WorkItem("https://github.com/dotnet/razor/issues/11385")] + public async Task ProvisionalCompletion_DoesntBreakSemanticTokens() + { + await TestServices.SolutionExplorer.AddFileAsync( + RazorProjectConstants.BlazorProjectName, + "Test.razor", + """ + @page "/counter" + + Counter + +

Counter

+ +

Current count: @currentCount

+ + @DateTime + + + + @code { + private int currentCount = 0; + + public void IncrementCount() + { + currentCount++; + } + } + """, + open: true, + ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.PlaceCaretAsync("@DateTime", charsOffset: 1, ControlledHangMitigatingCancellationToken); + + await Task.Delay(500, HangMitigatingCancellationToken); + + TestServices.Input.Send("."); + TestServices.Input.Send("n"); + + Assert.NotNull(await TestServices.Editor.OpenCompletionSessionAndWaitForItemAsync(TimeSpan.FromSeconds(10), "Now", HangMitigatingCancellationToken)); + + await TestServices.Editor.ValidateNoDiscoColorsAsync(HangMitigatingCancellationToken); + } + + private async Task VerifyTypeAndCommitCompletionAsync(string input, string output, string search, string[] stringsToType, char? commitChar = null, string? expectedSelectedItemLabel = null) + { + await TestServices.SolutionExplorer.AddFileAsync( + RazorProjectConstants.BlazorProjectName, + "Test.razor", + input, + open: true, + ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.PlaceCaretAsync(search, charsOffset: 1, ControlledHangMitigatingCancellationToken); + foreach (var stringToType in stringsToType) + { + TestServices.Input.Send(stringToType); + } + + if (expectedSelectedItemLabel is not null) + { + await CommitCompletionAndVerifyAsync(output, expectedSelectedItemLabel, commitChar); + } + else + { + await CommitCompletionAndVerifyAsync(output, commitChar); + } + } + private async Task CommitCompletionAndVerifyAsync(string expected, char? commitChar = null) { var session = await TestServices.Editor.WaitForCompletionSessionAsync(HangMitigatingCancellationToken); diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Classification.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Classification.cs index 2ec7e310e94..b4fa629f3b2 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Classification.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Classification.cs @@ -135,9 +135,44 @@ private static IEnumerable GetClassifications(IClassifier cl var selectionSpan = new SnapshotSpan(textView.TextSnapshot, new Span(0, textView.TextSnapshot.Length)); var classifiedSpans = classifier.GetClassificationSpans(selectionSpan); + + ValidateNoDiscoColors(classifiedSpans); + return classifiedSpans; } + /// + /// Validates that we aren't seeing disco colors in the editor + /// + /// + /// This actually just calls because we always check for disco colors + /// when getting classifications, but this makes for a more discoverable API. + /// + public Task> ValidateNoDiscoColorsAsync(CancellationToken cancellationToken) + => GetClassificationsAsync(cancellationToken); + + private static void ValidateNoDiscoColors(IList classifiedSpans) + { + // We never expect a word to have a classification change in the middle of it, so we can check for disco colors + // by making sure that each span either doesn't start with a letter or digit, or comes after something that isn't + // a letter or digit. + SnapshotSpan? previousSpan = null; + foreach (var span in classifiedSpans) + { + if (span.Span.IsEmpty) + { + continue; + } + + if (previousSpan is { } previous) + { + Assert.False(previous.End.Position == span.Span.Start.Position - 1 && char.IsLetterOrDigit(span.Span.Start.GetChar()) && char.IsLetterOrDigit(previous.End.GetChar()), $"Disco colors detected: {previous.GetText()}{span.Span.GetText()} has classification {span.ClassificationType.Classification} starting at character {previous.Length}"); + } + + previousSpan = span.Span; + } + } + private async Task GetClassifierAsync(IWpfTextView textView, CancellationToken cancellationToken) { var classifierService = await GetComponentModelServiceAsync(cancellationToken); From 527fddf5c01e617cb7e56b995e42d33689ef67ea Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Thu, 27 Mar 2025 12:32:06 -0700 Subject: [PATCH 048/223] GeneratedOutputSource: Use target-typed new expression --- .../ProjectSystem/Sources/GeneratedOutputSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs index 796ec7742ee..60cd649c033 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/Sources/GeneratedOutputSource.cs @@ -56,7 +56,7 @@ public async ValueTask GetValueAsync(CancellationToken cancel if (_output is null) { - _output = new WeakReference(result); + _output = new(result); } else { From 03dfc0f4bad6c2512d49550ef09e6b173cd0a7fe Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Thu, 27 Mar 2025 13:13:21 -0700 Subject: [PATCH 049/223] Forgot to publish the package... --- eng/config/PublishData.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index f7160dcd4ab..4ad15f6765e 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -17,7 +17,8 @@ "rzls.win-arm64": "vs-impl", "rzls.win-x64": "vs-impl", "rzls.win-x86": "vs-impl", - "Microsoft.VisualStudio.DevKit.Razor": "vs-impl" + "Microsoft.VisualStudio.DevKit.Razor": "vs-impl", + "Microsoft.VisualStudioCode.RazorExtension": "vs-impl" } }, "branches": { From c5a5dff27c86864fdbf36f22e1d8beab497e9872 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 25 Mar 2025 16:05:24 -0700 Subject: [PATCH 050/223] TagHelperBinding: Don't expose Mappings dictionary Don't expose the Mappings dictionary. Instead, expose a GetBoundRules(...) method and update each access. --- .../test/DefaultRazorTagHelperBinderPhaseTest.cs | 4 ++-- .../test/TagHelperBinderTest.cs | 10 +++++----- .../src/Language/Legacy/TagHelperBlockRewriter.cs | 2 +- .../Language/Legacy/TagHelperParseTreeRewriter.cs | 4 ++-- .../src/Language/TagHelperBinding.cs | 14 ++++++++++---- .../RazorWrapperFactory.TagHelperBindingWrapper.cs | 2 +- .../AutoClosingTagOnAutoInsertProvider.cs | 3 +-- .../TagHelperFactsTest.cs | 2 +- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorTagHelperBinderPhaseTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorTagHelperBinderPhaseTest.cs index 9a539690d29..dd3802efad4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorTagHelperBinderPhaseTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DefaultRazorTagHelperBinderPhaseTest.cs @@ -295,7 +295,7 @@ public void Execute_DirectiveWithoutQuotes_RewritesTagHelpers_TagHelperMatchesEl var formTagHelper = Assert.Single(tagHelperNodes); Assert.Equal("form", formTagHelper.TagHelperInfo.TagName); - Assert.Equal(2, formTagHelper.TagHelperInfo.BindingResult.Mappings[tagHelper].Length); + Assert.Equal(2, formTagHelper.TagHelperInfo.BindingResult.GetBoundRules(tagHelper).Length); } [Fact] @@ -340,7 +340,7 @@ public void Execute_DirectiveWithQuotes_RewritesTagHelpers_TagHelperMatchesEleme var formTagHelper = Assert.Single(tagHelperNodes); Assert.Equal("form", formTagHelper.TagHelperInfo.TagName); - Assert.Equal(2, formTagHelper.TagHelperInfo.BindingResult.Mappings[tagHelper].Length); + Assert.Equal(2, formTagHelper.TagHelperInfo.BindingResult.GetBoundRules(tagHelper).Length); } [Fact] diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs index c413db5a176..dcf47aaf0c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs @@ -39,7 +39,7 @@ public void GetBinding_ReturnsBindingWithInformation() Assert.Equal("body", bindingResult.ParentTagName); Assert.Equal>(expectedAttributes, bindingResult.Attributes); Assert.Equal("th:", bindingResult.TagHelperPrefix); - Assert.Equal(divTagHelper.TagMatchingRules, bindingResult.Mappings[divTagHelper]); + Assert.Equal(divTagHelper.TagMatchingRules, bindingResult.GetBoundRules(divTagHelper)); } [Fact] @@ -81,7 +81,7 @@ void TestTagName(string tagName, TagMatchingRuleDescriptor expectedBindingResult Assert.Equal(expectedDescriptors, bindingResult.Descriptors); Assert.Equal(tagName, bindingResult.TagName); - var mapping = Assert.Single(bindingResult.Mappings[multiTagHelper]); + var mapping = Assert.Single(bindingResult.GetBoundRules(multiTagHelper)); Assert.Equal(expectedBindingResult, mapping); } } @@ -136,7 +136,7 @@ void TestTagName(string tagName, TagHelperDescriptor[] expectedDescriptors, TagM for (int i = 0; i < expectedDescriptors.Length; i++) { - var mapping = Assert.Single(bindingResult.Mappings[expectedDescriptors[i]]); + var mapping = Assert.Single(bindingResult.GetBoundRules(expectedDescriptors[i])); Assert.Equal(expectedBindingResults[i], mapping); } } @@ -598,7 +598,7 @@ public void GetBinding_DescriptorWithMultipleRules_CorrectlySelectsMatchingRules // Assert var boundDescriptor = Assert.Single(binding.Descriptors); Assert.Same(multiRuleDescriptor, boundDescriptor); - var boundRules = binding.Mappings[boundDescriptor]; + var boundRules = binding.GetBoundRules(boundDescriptor); var boundRule = Assert.Single(boundRules); Assert.Equal("div", boundRule.TagName); } @@ -626,7 +626,7 @@ public void GetBinding_PrefixedParent_ReturnsBinding() // Assert var boundDescriptor = Assert.Single(bindingResult.Descriptors); Assert.Same(divDescriptor, boundDescriptor); - var boundRules = bindingResult.Mappings[boundDescriptor]; + var boundRules = bindingResult.GetBoundRules(boundDescriptor); var boundRule = Assert.Single(boundRules); Assert.Equal("div", boundRule.TagName); Assert.Equal("p", boundRule.ParentTag); diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs index 3d5afbce23d..5a364468e50 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs @@ -29,7 +29,7 @@ public static TagMode GetTagMode( var hasDirectiveAttribute = false; foreach (var descriptor in bindingResult.Descriptors) { - var boundRules = bindingResult.Mappings[descriptor]; + var boundRules = bindingResult.GetBoundRules(descriptor); var nonDefaultRule = boundRules.FirstOrDefault(static rule => rule.TagStructure != TagStructure.Unspecified); if (nonDefaultRule?.TagStructure == TagStructure.WithoutEndTag) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs index 5e1a323a65e..2c456bfd4a0 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs @@ -349,7 +349,7 @@ private bool TryRewriteTagHelperEnd( foreach (var descriptor in tagHelperBinding.Descriptors) { - var boundRules = tagHelperBinding.Mappings[descriptor]; + var boundRules = tagHelperBinding.GetBoundRules(descriptor); var invalidRule = boundRules.FirstOrDefault(static rule => rule.TagStructure == TagStructure.WithoutEndTag); if (invalidRule != null) @@ -464,7 +464,7 @@ private void ValidateBinding( foreach (var descriptor in bindingResult.Descriptors) { - var boundRules = bindingResult.Mappings[descriptor]; + var boundRules = bindingResult.GetBoundRules(descriptor); foreach (var rule in boundRules) { if (rule.TagStructure != TagStructure.Unspecified) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs index 378586eb70e..5d05dd747b6 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs @@ -10,13 +10,14 @@ namespace Microsoft.AspNetCore.Razor.Language; internal sealed class TagHelperBinding { + private readonly FrozenDictionary> _mappings; + public string TagName { get; } public string? ParentTagName { get; } public ImmutableArray> Attributes { get; } - public FrozenDictionary> Mappings { get; } public string? TagHelperPrefix { get; } - public ImmutableArray Descriptors => Mappings.Keys; + public ImmutableArray Descriptors => _mappings.Keys; internal TagHelperBinding( string tagName, @@ -28,10 +29,15 @@ internal TagHelperBinding( TagName = tagName; Attributes = attributes; ParentTagName = parentTagName; - Mappings = mappings; + _mappings = mappings; TagHelperPrefix = tagHelperPrefix; } + public ImmutableArray GetBoundRules(TagHelperDescriptor descriptor) + { + return _mappings[descriptor]; + } + /// /// Gets a value that indicates whether the the binding matched on attributes only. /// @@ -44,7 +50,7 @@ public bool IsAttributeMatch { get { - foreach (var descriptor in Mappings.Keys) + foreach (var descriptor in _mappings.Keys) { if (!descriptor.Metadata.TryGetValue(TagHelperMetadata.Common.ClassifyAttributesOnly, out var value) || !string.Equals(value, bool.TrueString, StringComparison.OrdinalIgnoreCase)) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.LegacyEditor/RazorWrapperFactory.TagHelperBindingWrapper.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.LegacyEditor/RazorWrapperFactory.TagHelperBindingWrapper.cs index d96f0d34e8e..34aa49599f3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.LegacyEditor/RazorWrapperFactory.TagHelperBindingWrapper.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.LegacyEditor/RazorWrapperFactory.TagHelperBindingWrapper.cs @@ -17,7 +17,7 @@ public ImmutableArray Descriptors public ImmutableArray GetBoundRules(IRazorTagHelperDescriptor descriptor) { - return WrapAll(Object.Mappings[Unwrap(descriptor)], Wrap); + return WrapAll(Object.GetBoundRules(Unwrap(descriptor)), Wrap); } } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs index c532fa188c6..376da13dcc8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs @@ -155,8 +155,7 @@ private static bool TryGetTagHelperAutoClosingBehavior(TagHelperBinding bindingR foreach (var descriptor in bindingResult.Descriptors) { - var tagMatchingRules = bindingResult.Mappings[descriptor]; - foreach (var tagMatchingRule in tagMatchingRules) + foreach (var tagMatchingRule in bindingResult.GetBoundRules(descriptor)) { if (tagMatchingRule.TagStructure == TagStructure.Unspecified) { diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/TagHelperFactsTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/TagHelperFactsTest.cs index a1b00abdcbc..5f9a5ab4151 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/TagHelperFactsTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/TagHelperFactsTest.cs @@ -77,7 +77,7 @@ public void GetTagHelperBinding_WorksAsExpected() // Assert var descriptor = Assert.Single(binding.Descriptors); Assert.Equal(documentDescriptors[0], descriptor); - var boundRule = Assert.Single(binding.Mappings[descriptor]); + var boundRule = Assert.Single(binding.GetBoundRules(descriptor)); Assert.Equal(documentDescriptors[0].TagMatchingRules.First(), boundRule); } From 4ea942ccdbd5c3135bbf9904b1d21a4bdaa075d9 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 25 Mar 2025 16:14:12 -0700 Subject: [PATCH 051/223] TagHelperBinder: Don't create HashSet for each rule This change uses a single HashSet to ensure that there are no duplicates. This avoids needing to use a HashSet per rule. --- .../src/Language/TagHelperBinder.cs | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs index 24d3b5a09a2..3ce168ee232 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Language; /// internal sealed class TagHelperBinder { - private readonly Dictionary> _registrations; + private readonly Dictionary> _registrations; public string? TagHelperPrefix { get; } public ImmutableArray TagHelpers { get; } @@ -31,12 +31,34 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray>(tagHelpers.Length, StringComparer.OrdinalIgnoreCase); + _registrations = new Dictionary>(tagHelpers.Length, StringComparer.OrdinalIgnoreCase); + + using var pooledSet = HashSetPool.GetPooledObject(out var processedDescriptors); // Populate our registrations foreach (var descriptor in tagHelpers) { - Register(descriptor); + if (!processedDescriptors.Add(descriptor)) + { + // We're already seen this descriptor, skip it. + continue; + } + + foreach (var rule in descriptor.TagMatchingRules) + { + var registrationKey = rule.TagName == TagHelperMatchingConventions.ElementCatchAllName + ? TagHelperMatchingConventions.ElementCatchAllName + : TagHelperPrefix + rule.TagName; + + // Ensure there's a HashSet to add the descriptor to. + if (!_registrations.TryGetValue(registrationKey, out var descriptorList)) + { + descriptorList = []; + _registrations[registrationKey] = descriptorList; + } + + descriptorList.Add(descriptor); + } } } @@ -104,7 +126,7 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray descriptors, + List descriptors, ReadOnlySpan tagNameWithoutPrefix, ReadOnlySpan parentTagNameWithoutPrefix, ImmutableArray> attributes, @@ -131,23 +153,4 @@ static void FindApplicableDescriptors( } } } - - private void Register(TagHelperDescriptor descriptor) - { - foreach (var rule in descriptor.TagMatchingRules) - { - var registrationKey = rule.TagName == TagHelperMatchingConventions.ElementCatchAllName - ? TagHelperMatchingConventions.ElementCatchAllName - : TagHelperPrefix + rule.TagName; - - // Ensure there's a HashSet to add the descriptor to. - if (!_registrations.TryGetValue(registrationKey, out var descriptorSet)) - { - descriptorSet = []; - _registrations[registrationKey] = descriptorSet; - } - - descriptorSet.Add(descriptor); - } - } } From f9a92efaf8348e00ca491d098d5ba05334fc3eb8 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 26 Mar 2025 09:51:09 -0700 Subject: [PATCH 052/223] Use a pooled dictionary to build tagNameToDescriptorsMap (registrations) Instead of creating a new Dictionary with an arbitrary capacity, use a pooled Dictionary to build the initial map and copy the results to a new Dictionary with the precise capacity. --- .../src/Language/TagHelperBinder.cs | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs index 3ce168ee232..81e1c413b84 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Language; /// internal sealed class TagHelperBinder { - private readonly Dictionary> _registrations; + private readonly Dictionary> _tagNameToDescriptorsMap; public string? TagHelperPrefix { get; } public ImmutableArray TagHelpers { get; } @@ -30,12 +30,10 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray>(tagHelpers.Length, StringComparer.OrdinalIgnoreCase); - + using var pooledMap = StringDictionaryPool.Builder>.OrdinalIgnoreCase.GetPooledObject(out var mapBuilder); using var pooledSet = HashSetPool.GetPooledObject(out var processedDescriptors); - // Populate our registrations + // Build a map of tag name -> tag helpers. foreach (var descriptor in tagHelpers) { if (!processedDescriptors.Add(descriptor)) @@ -46,20 +44,23 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray ImmutableArray.CreateBuilder()); - descriptorList.Add(descriptor); + builder.Add(descriptor); } } + + // Build the final dictionary with immutable arrays. + _tagNameToDescriptorsMap = new(capacity: mapBuilder.Count, StringComparer.OrdinalIgnoreCase); + + foreach (var (key, value) in mapBuilder) + { + _tagNameToDescriptorsMap.Add(key, value.DrainToImmutable()); + } } /// @@ -102,13 +103,13 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray>.GetPooledObject(out var applicableDescriptors); // First, try any tag helpers with this tag name. - if (_registrations.TryGetValue(tagName, out var matchingDescriptors)) + if (_tagNameToDescriptorsMap.TryGetValue(tagName, out var matchingDescriptors)) { FindApplicableDescriptors(matchingDescriptors, tagNameWithoutPrefix, parentTagNameWithoutPrefix, attributes, applicableDescriptors); } // Next, try any "catch all" descriptors. - if (_registrations.TryGetValue(TagHelperMatchingConventions.ElementCatchAllName, out var catchAllDescriptors)) + if (_tagNameToDescriptorsMap.TryGetValue(TagHelperMatchingConventions.ElementCatchAllName, out var catchAllDescriptors)) { FindApplicableDescriptors(catchAllDescriptors, tagNameWithoutPrefix, parentTagNameWithoutPrefix, attributes, applicableDescriptors); } @@ -126,7 +127,7 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray descriptors, + ImmutableArray descriptors, ReadOnlySpan tagNameWithoutPrefix, ReadOnlySpan parentTagNameWithoutPrefix, ImmutableArray> attributes, From 76214f51bc651cefc56cbdb1c8faf1e8897fe1b9 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 26 Mar 2025 09:59:57 -0700 Subject: [PATCH 053/223] Store catch all descriptors in a separate array rather than in the map This avoids an extra Dictionary lookup for '*' during binding. --- .../src/Language/TagHelperBinder.cs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs index 81e1c413b84..c2f3b5a6c18 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs @@ -14,6 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Language; /// internal sealed class TagHelperBinder { + private readonly ImmutableArray _catchAllDescriptors; private readonly Dictionary> _tagNameToDescriptorsMap; public string? TagHelperPrefix { get; } @@ -30,6 +31,7 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray(); using var pooledMap = StringDictionaryPool.Builder>.OrdinalIgnoreCase.GetPooledObject(out var mapBuilder); using var pooledSet = HashSetPool.GetPooledObject(out var processedDescriptors); @@ -44,9 +46,16 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray ImmutableArray.CreateBuilder()); @@ -61,6 +70,9 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray @@ -109,10 +121,7 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray Date: Wed, 26 Mar 2025 10:20:47 -0700 Subject: [PATCH 054/223] Avoid FrozenDictionary in TagHelperBinding Frozen dictionaries are expensive to construct and should be avoided in binding. Instead, this change updates TagHelperBinding to store all bound rules as an array of TagHelperBoundRulesInfo, which is a struct containing the mapping of TagHelperDescriptor to bound rules. --- .../src/Language/TagHelperBinder.cs | 57 ++++++++++++------- .../src/Language/TagHelperBinding.cs | 27 ++++++--- .../src/Language/TagHelperBoundRulesInfo.cs | 14 +++++ 3 files changed, 68 insertions(+), 30 deletions(-) create mode 100644 src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBoundRulesInfo.cs diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs index c2f3b5a6c18..fa8c7f8f26a 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Collections.Frozen; using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics; using Microsoft.AspNetCore.Razor.PooledObjects; namespace Microsoft.AspNetCore.Razor.Language; @@ -99,31 +99,39 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray 0 }) { - tagNameWithoutPrefix = tagNameWithoutPrefix[length..]; + tagNameSpan = tagNameSpan[length..]; if (parentIsTagHelper) { - parentTagNameWithoutPrefix = parentTagNameWithoutPrefix[length..]; + parentTagNameSpan = parentTagNameSpan[length..]; } } - using var _ = DictionaryPool>.GetPooledObject(out var applicableDescriptors); + using var pooledSet = HashSetPool.GetPooledObject(out var distinctSet); + using var resultsBuilder = new PooledArrayBuilder(); + using var tempRulesBuilder = new PooledArrayBuilder(); // First, try any tag helpers with this tag name. if (_tagNameToDescriptorsMap.TryGetValue(tagName, out var matchingDescriptors)) { - FindApplicableDescriptors(matchingDescriptors, tagNameWithoutPrefix, parentTagNameWithoutPrefix, attributes, applicableDescriptors); + CollectBoundRulesInfo( + matchingDescriptors, + tagNameSpan, parentTagNameSpan, attributes, + distinctSet, ref resultsBuilder.AsRef(), ref tempRulesBuilder.AsRef()); } // Next, try any "catch all" descriptors. - FindApplicableDescriptors(_catchAllDescriptors, tagNameWithoutPrefix, parentTagNameWithoutPrefix, attributes, applicableDescriptors); + CollectBoundRulesInfo( + _catchAllDescriptors, + tagNameSpan, parentTagNameSpan, attributes, + distinctSet, ref resultsBuilder.AsRef(), ref tempRulesBuilder.AsRef()); - if (applicableDescriptors.Count == 0) + if (resultsBuilder.Count == 0) { return null; } @@ -132,34 +140,41 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray descriptors, - ReadOnlySpan tagNameWithoutPrefix, - ReadOnlySpan parentTagNameWithoutPrefix, + ReadOnlySpan tagName, + ReadOnlySpan parentTagName, ImmutableArray> attributes, - Dictionary> applicableDescriptors) + HashSet distinctSet, + ref PooledArrayBuilder resultsBuilder, + ref PooledArrayBuilder tempRulesBuilder) { - using var applicableRules = new PooledArrayBuilder(); - foreach (var descriptor in descriptors) { + if (!distinctSet.Add(descriptor)) + { + continue; // We've already seen this descriptor. + } + + Debug.Assert(tempRulesBuilder.Count == 0); + foreach (var rule in descriptor.TagMatchingRules) { - if (TagHelperMatchingConventions.SatisfiesRule(rule, tagNameWithoutPrefix, parentTagNameWithoutPrefix, attributes)) + if (TagHelperMatchingConventions.SatisfiesRule(rule, tagName, parentTagName, attributes)) { - applicableRules.Add(rule); + tempRulesBuilder.Add(rule); } } - if (applicableRules.Count > 0) + if (tempRulesBuilder.Count > 0) { - applicableDescriptors[descriptor] = applicableRules.DrainToImmutable(); + resultsBuilder.Add(new(descriptor, tempRulesBuilder.ToImmutable())); } - applicableRules.Clear(); + tempRulesBuilder.Clear(); } } } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs index 5d05dd747b6..4cc3fcca097 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Collections.Frozen; using System.Collections.Generic; using System.Collections.Immutable; @@ -10,34 +9,44 @@ namespace Microsoft.AspNetCore.Razor.Language; internal sealed class TagHelperBinding { - private readonly FrozenDictionary> _mappings; - public string TagName { get; } public string? ParentTagName { get; } public ImmutableArray> Attributes { get; } + public ImmutableArray AllBoundRules { get; } public string? TagHelperPrefix { get; } - public ImmutableArray Descriptors => _mappings.Keys; + private ImmutableArray _descriptors; internal TagHelperBinding( string tagName, ImmutableArray> attributes, string? parentTagName, - FrozenDictionary> mappings, + ImmutableArray allBoundRules, string? tagHelperPrefix) { TagName = tagName; Attributes = attributes; ParentTagName = parentTagName; - _mappings = mappings; + AllBoundRules = allBoundRules; TagHelperPrefix = tagHelperPrefix; } - public ImmutableArray GetBoundRules(TagHelperDescriptor descriptor) + public ImmutableArray Descriptors { - return _mappings[descriptor]; + get + { + if (_descriptors.IsDefault) + { + ImmutableInterlocked.InterlockedInitialize(ref _descriptors, AllBoundRules.SelectAsArray(x => x.Descriptor)); + } + + return _descriptors; + } } + public ImmutableArray GetBoundRules(TagHelperDescriptor descriptor) + => AllBoundRules.First(descriptor, static (info, d) => info.Descriptor.Equals(d)).Rules; + /// /// Gets a value that indicates whether the the binding matched on attributes only. /// @@ -50,7 +59,7 @@ public bool IsAttributeMatch { get { - foreach (var descriptor in _mappings.Keys) + foreach (var descriptor in Descriptors) { if (!descriptor.Metadata.TryGetValue(TagHelperMetadata.Common.ClassifyAttributesOnly, out var value) || !string.Equals(value, bool.TrueString, StringComparison.OrdinalIgnoreCase)) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBoundRulesInfo.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBoundRulesInfo.cs new file mode 100644 index 00000000000..67a3a68b57b --- /dev/null +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBoundRulesInfo.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Immutable; + +namespace Microsoft.AspNetCore.Razor.Language; + +internal readonly struct TagHelperBoundRulesInfo( + TagHelperDescriptor descriptor, + ImmutableArray boundRules) +{ + public TagHelperDescriptor Descriptor { get; } = descriptor; + public ImmutableArray Rules { get; } = boundRules; +} From 1fc41caaf07a91877d72a3ae46772c36a5b3aae0 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 26 Mar 2025 11:28:53 -0700 Subject: [PATCH 055/223] Clean up and refactor TagHelperBinder and TagHelperBinding a bit --- .../test/TagHelperBinderTest.cs | 2 +- .../Legacy/TagHelperParseTreeRewriter.cs | 16 +-- .../src/Language/TagHelperBinder.cs | 117 ++++++++++-------- .../src/Language/TagHelperBinding.cs | 16 +-- 4 files changed, 81 insertions(+), 70 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs index dcf47aaf0c6..5473b4cb924 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TagHelperBinderTest.cs @@ -38,7 +38,7 @@ public void GetBinding_ReturnsBindingWithInformation() Assert.Equal("th:div", bindingResult.TagName); Assert.Equal("body", bindingResult.ParentTagName); Assert.Equal>(expectedAttributes, bindingResult.Attributes); - Assert.Equal("th:", bindingResult.TagHelperPrefix); + Assert.Equal("th:", bindingResult.TagNamePrefix); Assert.Equal(divTagHelper.TagMatchingRules, bindingResult.GetBoundRules(divTagHelper)); } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs index 2c456bfd4a0..7404385a75e 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs @@ -34,9 +34,9 @@ public static RazorSyntaxTree Rewrite(RazorSyntaxTree syntaxTree, TagHelperBinde builder.AddRange(treeDiagnostics); builder.AddRange(sinkDiagnostics); - foreach (var tagHelper in binder.TagHelpers) + foreach (var descriptor in binder.Descriptors) { - foreach (var diagnostic in tagHelper.GetAllDiagnostics()) + foreach (var diagnostic in descriptor.GetAllDiagnostics()) { builder.Add(diagnostic); } @@ -137,7 +137,7 @@ public override SyntaxNode VisitMarkupElement(MarkupElementSyntax node) else { // Tag helper start tag. Keep track. - var tracker = new TagHelperTracker(_binder.TagHelperPrefix, tagHelperInfo); + var tracker = new TagHelperTracker(_binder.TagNamePrefix, tagHelperInfo); _trackerStack.Push(tracker); } } @@ -726,7 +726,7 @@ private record TagHelperTracker : TagTracker { public uint OpenMatchingTags; - private readonly string? _tagHelperPrefix; + private readonly string? _tagNamePrefix; private readonly TagHelperBinding _binding; private readonly Lazy<(ImmutableArray Names, HashSet NameSet)> _lazyAllowedChildren; @@ -734,10 +734,10 @@ private record TagHelperTracker : TagTracker public ImmutableArray AllowedChildren => _lazyAllowedChildren.Value.Names; - public TagHelperTracker(string? tagHelperPrefix, TagHelperInfo info) + public TagHelperTracker(string? tagNamePrefix, TagHelperInfo info) : base(info.TagName, IsTagHelper: true) { - _tagHelperPrefix = tagHelperPrefix; + _tagNamePrefix = tagNamePrefix; _binding = info.BindingResult; _lazyAllowedChildren = new(CreateAllowedChildren); @@ -773,7 +773,7 @@ public bool AllowsChild(string tagName, bool nameIncludesPrefix) private HashSet CreatePrefixedAllowedChildren() { - if (_tagHelperPrefix is not string tagHelperPrefix) + if (_tagNamePrefix is not string tagNamePrefix) { return _lazyAllowedChildren.Value.NameSet; } @@ -782,7 +782,7 @@ private HashSet CreatePrefixedAllowedChildren() foreach (var childName in AllowedChildren) { - distinctSet.Add(tagHelperPrefix + childName); + distinctSet.Add(tagNamePrefix + childName); } return distinctSet; diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs index fa8c7f8f26a..accaf2a5ff6 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinder.cs @@ -17,28 +17,41 @@ internal sealed class TagHelperBinder private readonly ImmutableArray _catchAllDescriptors; private readonly Dictionary> _tagNameToDescriptorsMap; - public string? TagHelperPrefix { get; } - public ImmutableArray TagHelpers { get; } + public string? TagNamePrefix { get; } + public ImmutableArray Descriptors { get; } + + private readonly ReadOnlyMemory _tagNamePrefix; /// /// Instantiates a new instance of the . /// - /// The tag helper prefix being used by the document. - /// The s that the + /// The tag helper prefix being used by the document. + /// The s that the /// will pull from. - public TagHelperBinder(string? tagHelperPrefix, ImmutableArray tagHelpers) + public TagHelperBinder(string? tagNamePrefix, ImmutableArray descriptors) { - TagHelperPrefix = tagHelperPrefix; - TagHelpers = tagHelpers; + TagNamePrefix = tagNamePrefix; + Descriptors = descriptors.NullToEmpty(); + + _tagNamePrefix = TagNamePrefix.AsMemory(); + + ProcessDescriptors(descriptors, tagNamePrefix, out _tagNameToDescriptorsMap, out _catchAllDescriptors); + } - using var catchAllDescriptors = new PooledArrayBuilder(); + private static void ProcessDescriptors( + ImmutableArray descriptors, + string? tagNamePrefix, + out Dictionary> tagNameToDescriptorsMap, + out ImmutableArray catchAllDescriptors) + { + using var catchAllBuilder = new PooledArrayBuilder(); using var pooledMap = StringDictionaryPool.Builder>.OrdinalIgnoreCase.GetPooledObject(out var mapBuilder); - using var pooledSet = HashSetPool.GetPooledObject(out var processedDescriptors); + using var pooledSet = HashSetPool.GetPooledObject(out var distinctSet); // Build a map of tag name -> tag helpers. - foreach (var descriptor in tagHelpers) + foreach (var descriptor in descriptors) { - if (!processedDescriptors.Add(descriptor)) + if (!distinctSet.Add(descriptor)) { // We're already seen this descriptor, skip it. continue; @@ -49,30 +62,32 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray ImmutableArray.CreateBuilder()); + var builder = mapBuilder.GetOrAdd(tagName, _ => ImmutableArray.CreateBuilder()); - builder.Add(descriptor); + builder.Add(descriptor); + } } } // Build the final dictionary with immutable arrays. - _tagNameToDescriptorsMap = new(capacity: mapBuilder.Count, StringComparer.OrdinalIgnoreCase); + tagNameToDescriptorsMap = new(capacity: mapBuilder.Count, StringComparer.OrdinalIgnoreCase); foreach (var (key, value) in mapBuilder) { - _tagNameToDescriptorsMap.Add(key, value.DrainToImmutable()); + tagNameToDescriptorsMap.Add(key, value.DrainToImmutable()); } // Build the catch all descriptors array. - _catchAllDescriptors = catchAllDescriptors.DrainToImmutable(); + catchAllDescriptors = catchAllBuilder.DrainToImmutable(); } /// @@ -84,37 +99,40 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArrayThe parent tag name of the given tag. /// Is the parent tag of the given tag a tag helper. /// s that apply to the given HTML tag criteria. - /// Will return null if no s are a match. + /// Will return if no s are a match. public TagHelperBinding? GetBinding( string tagName, ImmutableArray> attributes, string? parentTagName, bool parentIsTagHelper) { - if (!TagHelperPrefix.IsNullOrEmpty() && - (tagName.Length <= TagHelperPrefix.Length || - !tagName.StartsWith(TagHelperPrefix, StringComparison.OrdinalIgnoreCase))) - { - // The tagName doesn't have the tag helper prefix, we can short circuit. - return null; - } + var tagNameSpan = tagName.AsSpan(); + var parentTagNameSpan = parentTagName.AsSpan(); + var tagNamePrefixSpan = _tagNamePrefix.Span; - var tagNameSpan = tagName.AsSpanOrDefault(); - var parentTagNameSpan = parentTagName.AsSpanOrDefault(); - - if (TagHelperPrefix is { Length: var length and > 0 }) + if (!tagNamePrefixSpan.IsEmpty) { - tagNameSpan = tagNameSpan[length..]; + if (!tagNameSpan.StartsWith(tagNamePrefixSpan, StringComparison.OrdinalIgnoreCase)) + { + // The tag name doesn't start with the prefix. So, we're done. + return null; + } + + tagNameSpan = tagNameSpan[tagNamePrefixSpan.Length..]; if (parentIsTagHelper) { - parentTagNameSpan = parentTagNameSpan[length..]; + Debug.Assert( + parentTagNameSpan.StartsWith(tagNamePrefixSpan, StringComparison.OrdinalIgnoreCase), + "If the parent is a tag helper, it must start with the tag name prefix."); + + parentTagNameSpan = parentTagNameSpan[tagNamePrefixSpan.Length..]; } } - using var pooledSet = HashSetPool.GetPooledObject(out var distinctSet); using var resultsBuilder = new PooledArrayBuilder(); using var tempRulesBuilder = new PooledArrayBuilder(); + using var pooledSet = HashSetPool.GetPooledObject(out var distinctSet); // First, try any tag helpers with this tag name. if (_tagNameToDescriptorsMap.TryGetValue(tagName, out var matchingDescriptors)) @@ -122,41 +140,34 @@ public TagHelperBinder(string? tagHelperPrefix, ImmutableArray 0 + ? new(resultsBuilder.DrainToImmutable(), tagName, parentTagName, attributes, TagNamePrefix) + : null; static void CollectBoundRulesInfo( ImmutableArray descriptors, ReadOnlySpan tagName, ReadOnlySpan parentTagName, ImmutableArray> attributes, - HashSet distinctSet, ref PooledArrayBuilder resultsBuilder, - ref PooledArrayBuilder tempRulesBuilder) + ref PooledArrayBuilder tempRulesBuilder, + HashSet distinctSet) { foreach (var descriptor in descriptors) { if (!distinctSet.Add(descriptor)) { - continue; // We've already seen this descriptor. + // We're already seen this descriptor, skip it. + continue; } Debug.Assert(tempRulesBuilder.Count == 0); diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs index 4cc3fcca097..b4ddeb55a42 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs @@ -9,26 +9,26 @@ namespace Microsoft.AspNetCore.Razor.Language; internal sealed class TagHelperBinding { + public ImmutableArray AllBoundRules { get; } + public string? TagNamePrefix { get; } public string TagName { get; } public string? ParentTagName { get; } public ImmutableArray> Attributes { get; } - public ImmutableArray AllBoundRules { get; } - public string? TagHelperPrefix { get; } private ImmutableArray _descriptors; internal TagHelperBinding( + ImmutableArray allBoundRules, string tagName, - ImmutableArray> attributes, string? parentTagName, - ImmutableArray allBoundRules, - string? tagHelperPrefix) + ImmutableArray> attributes, + string? tagNamePrefix) { + AllBoundRules = allBoundRules; TagName = tagName; - Attributes = attributes; ParentTagName = parentTagName; - AllBoundRules = allBoundRules; - TagHelperPrefix = tagHelperPrefix; + Attributes = attributes; + TagNamePrefix = tagNamePrefix; } public ImmutableArray Descriptors From 6439831065bb72b30a38787f8d92630d41a0a77d Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 26 Mar 2025 11:46:23 -0700 Subject: [PATCH 056/223] Avoid calling TagHelperBinding.GetBoundRules(...) when unnecessary A common pattern is to iterate over TagHelperBinding.Descriptors, call GetBoundRules for each descriptor and iterate over the rules. Because TagHelperBinding no longer contains a Dictionary, these double-loops are now O(n^2). Fortunately, it's easy to just iterate over AllBoundRules, which is what these cases are really trying to do. --- .../src/Language/Legacy/TagHelperBlockRewriter.cs | 6 +++--- .../Language/Legacy/TagHelperParseTreeRewriter.cs | 14 +++++++------- .../AutoClosingTagOnAutoInsertProvider.cs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs index 5a364468e50..3dbbd550198 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperBlockRewriter.cs @@ -27,10 +27,9 @@ public static TagMode GetTagMode( } var hasDirectiveAttribute = false; - foreach (var descriptor in bindingResult.Descriptors) + foreach (var boundRulesInfo in bindingResult.AllBoundRules) { - var boundRules = bindingResult.GetBoundRules(descriptor); - var nonDefaultRule = boundRules.FirstOrDefault(static rule => rule.TagStructure != TagStructure.Unspecified); + var nonDefaultRule = boundRulesInfo.Rules.FirstOrDefault(static rule => rule.TagStructure != TagStructure.Unspecified); if (nonDefaultRule?.TagStructure == TagStructure.WithoutEndTag) { @@ -42,6 +41,7 @@ public static TagMode GetTagMode( // vs // // We don't want this to become an error just because you added a directive attribute. + var descriptor = boundRulesInfo.Descriptor; if (descriptor.IsAnyComponentDocumentTagHelper() && !descriptor.IsComponentOrChildContentTagHelper) { hasDirectiveAttribute = true; diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs index 7404385a75e..c75e373ea72 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/TagHelperParseTreeRewriter.cs @@ -347,10 +347,9 @@ private bool TryRewriteTagHelperEnd( return false; } - foreach (var descriptor in tagHelperBinding.Descriptors) + foreach (var boundRulesInfo in tagHelperBinding.AllBoundRules) { - var boundRules = tagHelperBinding.GetBoundRules(descriptor); - var invalidRule = boundRules.FirstOrDefault(static rule => rule.TagStructure == TagStructure.WithoutEndTag); + var invalidRule = boundRulesInfo.Rules.FirstOrDefault(static rule => rule.TagStructure == TagStructure.WithoutEndTag); if (invalidRule != null) { @@ -359,7 +358,7 @@ private bool TryRewriteTagHelperEnd( RazorDiagnosticFactory.CreateParsing_TagHelperMustNotHaveAnEndTag( new SourceSpan(SourceLocationTracker.Advance(endTag.GetSourceLocation(_source), " Date: Wed, 26 Mar 2025 11:49:35 -0700 Subject: [PATCH 057/223] Cache the result of TagHelperBinding.IsAttributeMatch --- .../src/Language/TagHelperBinding.cs | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs index b4ddeb55a42..efd2091857a 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/TagHelperBinding.cs @@ -16,6 +16,7 @@ internal sealed class TagHelperBinding public ImmutableArray> Attributes { get; } private ImmutableArray _descriptors; + private bool? _isAttributeMatch; internal TagHelperBinding( ImmutableArray allBoundRules, @@ -48,32 +49,39 @@ public ImmutableArray GetBoundRules(TagHelperDescript => AllBoundRules.First(descriptor, static (info, d) => info.Descriptor.Equals(d)).Rules; /// - /// Gets a value that indicates whether the the binding matched on attributes only. + /// Gets a value that indicates whether the the binding matched on attributes only. /// - /// false if the entire element should be classified as a tag helper. + /// + /// Returns if the entire element should be classified as a tag helper. + /// /// - /// If this returns true, use TagHelperFactsService.GetBoundTagHelperAttributes to find the - /// set of attributes that should be considered part of the match. + /// If this returns , use TagHelperFactsService.GetBoundTagHelperAttributes to find the + /// set of attributes that should be considered part of the match. /// public bool IsAttributeMatch { get { - foreach (var descriptor in Descriptors) + return _isAttributeMatch ??= ComputeIsAttributeMatch(Descriptors); + + static bool ComputeIsAttributeMatch(ImmutableArray descriptors) { - if (!descriptor.Metadata.TryGetValue(TagHelperMetadata.Common.ClassifyAttributesOnly, out var value) || - !string.Equals(value, bool.TrueString, StringComparison.OrdinalIgnoreCase)) + foreach (var descriptor in descriptors) { - return false; + if (!descriptor.Metadata.TryGetValue(TagHelperMetadata.Common.ClassifyAttributesOnly, out var value) || + !string.Equals(value, bool.TrueString, StringComparison.OrdinalIgnoreCase)) + { + return false; + } } - } - // All the matching tag helpers want to be classified with **attributes only**. - // - // Ex: (components) - // - //