From 95c37afc6eec583fa299af8836c06eb0b130908d Mon Sep 17 00:00:00 2001
From: David Wengier
Date: Tue, 30 Jul 2024 11:26:21 +1000
Subject: [PATCH 01/20] 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 02/20] 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 03/20] 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{tagName}>");
+ edit = LspFactory.CreateTextEdit(position, $"$0{tagName}>");
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{SyntaxConstants.TextTagName}>");
+ edit = LspFactory.CreateTextEdit(position, $"$0{SyntaxConstants.TextTagName}>");
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) // [||]test1>
+ Position = LspFactory.CreatePosition(1, 9) // [||]test1>
};
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) //