" + Environment.NewLine + " "),
- VsLspFactory.CreateTextEdit(line: 1, character: 0, " "),
- VsLspFactory.CreateTextEdit(
- range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
+ LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "),
+ LspFactory.CreateTextEdit(line: 1, character: 0, " "),
+ LspFactory.CreateTextEdit(
+ range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
newText: " }" + Environment.NewLine + "
"),
};
@@ -331,11 +330,11 @@ public async Task CleanUpTextEdits_BadEditWithTilde()
var computedEdits = new TextEdit[]
{
- VsLspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "),
- VsLspFactory.CreateTextEdit(line: 1, character: 0, " "),
+ LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "),
+ LspFactory.CreateTextEdit(line: 1, character: 0, " "),
// This is the problematic edit.. the close brace has been replaced with a tilde
- VsLspFactory.CreateTextEdit(
- range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
+ LspFactory.CreateTextEdit(
+ range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
newText: " ~" + Environment.NewLine + "
")
};
@@ -371,11 +370,11 @@ public async Task CleanUpTextEdits_GoodEditWithTilde()
var computedEdits = new[]
{
- VsLspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "),
- VsLspFactory.CreateTextEdit(line: 1, character: 0, " "),
+ LspFactory.CreateTextEdit(position: (0, 0), "
" + Environment.NewLine + " "),
+ LspFactory.CreateTextEdit(line: 1, character: 0, " "),
// This looks like a bad edit, but the original source document had a tilde
- VsLspFactory.CreateTextEdit(
- range: VsLspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
+ LspFactory.CreateTextEdit(
+ range: LspFactory.CreateSingleLineRange(line: 2, character: 0, length: 1),
newText: " ~" + Environment.NewLine + "
")
};
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/AssertExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/AssertExtensions.cs
index eeab228a043..6cef26d831a 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/AssertExtensions.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/AssertExtensions.cs
@@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root for license information.
-using Microsoft.VisualStudio.Text.Adornments;
+extern alias RLSP;
+
+using RLSP::Roslyn.Text.Adornments;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Test.Common;
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs
index 7c082b276cc..6cd32ce4efa 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs
@@ -11,7 +11,6 @@
using Microsoft.CodeAnalysis.Razor.Logging;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Composition;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;
using Microsoft.WebTools.Languages.Shared.ContentTypes;
@@ -113,7 +112,7 @@ public void Dispose()
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.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs
index 4590a961b7d..f33ff50f018 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs
@@ -20,6 +20,7 @@
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
+using Diagnostic = Microsoft.CodeAnalysis.Diagnostic;
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests;
@@ -288,7 +289,7 @@ protected static CompileToAssemblyResult CompileToAssembly(CompileToCSharpResult
var diagnostics = compilation
.GetDiagnostics()
- .Where(d => d.Severity != DiagnosticSeverity.Hidden);
+ .Where(d => d.Severity != CodeAnalysis.DiagnosticSeverity.Hidden);
if (diagnostics.Any() && throwOnFailure)
{
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs
index f095947c978..e7712df1027 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs
@@ -12,10 +12,8 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.VisualStudio.Composition;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Nerdbank.Streams;
using StreamJsonRpc;
-using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer;
@@ -77,9 +75,6 @@ static SystemTextJsonFormatter CreateSystemTextJsonMessageFormatter(AbstractRazo
// Roslyn has its own converters since it doesn't use MS.VS.LS.Protocol
languageServerFactory.AddJsonConverters(messageFormatter.JsonSerializerOptions);
- // In its infinite wisdom, the LSP client has a public method that takes Newtonsoft.Json types, but an internal method that takes System.Text.Json types.
- typeof(VSInternalExtensionUtilities).GetMethod("AddVSInternalExtensionConverters", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)!.Invoke(null, [messageFormatter.JsonSerializerOptions]);
-
return messageFormatter;
}
@@ -176,7 +171,7 @@ static DidOpenTextDocumentParams CreateDidOpenTextDocumentParams(Uri uri, string
};
}
- public async Task ReplaceTextAsync(Uri documentUri, params (Range Range, string Text)[] changes)
+ internal async Task ReplaceTextAsync(Uri documentUri, params (LspRange Range, string Text)[] changes)
{
var didChangeParams = CreateDidChangeTextDocumentParams(
documentUri,
@@ -184,7 +179,7 @@ public async Task ReplaceTextAsync(Uri documentUri, params (Range Range, string
await ExecuteRequestAsync
(Methods.TextDocumentDidChangeName, didChangeParams, _cancellationToken);
- static DidChangeTextDocumentParams CreateDidChangeTextDocumentParams(Uri documentUri, ImmutableArray<(Range Range, string Text)> changes)
+ static DidChangeTextDocumentParams CreateDidChangeTextDocumentParams(Uri documentUri, ImmutableArray<(LspRange Range, string Text)> changes)
{
var changeEvents = changes.Select(change => new TextDocumentContentChangeEvent
{
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs
index f49c6ae78d3..07e57ceec27 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs
@@ -18,7 +18,6 @@
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Composition;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer;
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs
index 266bd9acdc9..2347a1ce214 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs
@@ -40,7 +40,7 @@ protected LanguageServerTestBase(ITestOutputHelper testOutput)
{
SpanMappingService = new ThrowingRazorSpanMappingService();
- SerializerOptions = JsonHelpers.VsLspJsonSerializerOptions;
+ SerializerOptions = JsonHelpers.JsonSerializerOptions;
FilePathService = new LSPFilePathService(TestLanguageServerFeatureOptions.Instance);
}
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs
index f3dd0cb02d6..56b25ce496f 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestClientCapabilitiesService.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.Razor.Protocol;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.AspNetCore.Razor.LanguageServer.Test;
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs
index 90049c04c1e..743cea2dcec 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs
@@ -5,7 +5,6 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer;
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs
index 95def5825fc..8688dee484c 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestRazorSemanticTokensLegendService.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor.LanguageServer.Test;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic;
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj
index e9f9f637775..4498b9de54b 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj
@@ -17,6 +17,7 @@
+
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListCacheTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListCacheTest.cs
index 09d4ddcd119..9ca74f799fb 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListCacheTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListCacheTest.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor.Test.Common;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs
index 6fe44aad1d8..2e83e3c19bb 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListMergerTest.cs
@@ -3,7 +3,6 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Test.Common;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs
index bc41b1ed2c9..7b99d5e7943 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/CompletionListOptimizerTest.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor.Test.Common;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/DirectiveVerifier.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/DirectiveVerifier.cs
index 739d4643232..44e50eabd62 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/DirectiveVerifier.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/DirectiveVerifier.cs
@@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
namespace Microsoft.CodeAnalysis.Razor.Completion;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/RazorCompletionListProviderTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/RazorCompletionListProviderTest.cs
index 31e14e2fd1b..0378fac5a65 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/RazorCompletionListProviderTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Completion/RazorCompletionListProviderTest.cs
@@ -12,7 +12,6 @@
using Microsoft.AspNetCore.Razor.Test.Common.Workspaces;
using Microsoft.CodeAnalysis.Razor.Tooltip;
using Microsoft.CodeAnalysis.Testing;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
using static Microsoft.AspNetCore.Razor.Language.CommonMetadata;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Hover/HoverFactoryTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Hover/HoverFactoryTest.cs
index fae68d11ec6..ae21d6dbd18 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Hover/HoverFactoryTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Hover/HoverFactoryTest.cs
@@ -8,8 +8,7 @@
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis.Classification;
using Microsoft.CodeAnalysis.Razor.Tooltip;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
-using Microsoft.VisualStudio.Text.Adornments;
+using Roslyn.Text.Adornments;
using Moq;
using Xunit;
using Xunit.Abstractions;
@@ -48,9 +47,8 @@ public async Task GetHoverAsync_TagHelper_Element()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -72,9 +70,8 @@ public async Task GetHoverAsync_TagHelper_Element_WithParent()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -96,7 +93,6 @@ public async Task GetHoverAsync_TagHelper_Attribute_WithParent()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
Assert.Contains("**Attribute**", ((MarkupContent)hover.Contents).Value, StringComparison.Ordinal);
var expectedRange = codeDocument.Source.Text.GetRange(code.Span);
Assert.Equal(expectedRange, hover.Range);
@@ -118,9 +114,8 @@ public async Task GetHoverAsync_TagHelper_Element_EndTag()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -140,10 +135,9 @@ public async Task GetHoverAsync_TagHelper_Attribute()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -163,10 +157,9 @@ public async Task GetHoverAsync_TagHelper_AttributeTrailingEdge()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -240,10 +233,9 @@ public async Task GetHoverAsync_TagHelper_MinimizedAttribute()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -267,9 +259,8 @@ public void Increment(){
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -289,9 +280,8 @@ public async Task GetHoverAsync_TagHelper_MalformedElement()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -311,10 +301,9 @@ public async Task GetHoverAsync_TagHelper_MalformedAttribute()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -352,10 +341,9 @@ public async Task GetHoverAsync_TagHelper_PlainTextElement()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -375,10 +363,9 @@ public async Task GetHoverAsync_TagHelper_PlainTextElement_EndTag()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -397,10 +384,9 @@ public async Task GetHoverAsync_TagHelper_TextComponent()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -421,10 +407,9 @@ public async Task GetHoverAsync_TagHelper_TextComponent_NestedInHtml()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -468,10 +453,9 @@ public async Task GetHoverAsync_TagHelper_TextComponent_NestedInCSharpAndText()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -491,11 +475,10 @@ public async Task GetHoverAsync_TagHelper_PlainTextAttribute()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
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);
}
@@ -551,10 +534,9 @@ public async Task GetHoverAsync_TagHelper_Element_VSClient_ReturnVSHover()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
- Assert.False(hover.Contents.Value.TryGetFourth(out var _));
- Assert.True(hover.Contents.Value.TryGetThird(out var _) && !hover.Contents.Value.Third.Any());
- var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5);
+ Assert.False(hover.Contents.TryGetFourth(out var _));
+ Assert.True(hover.Contents.TryGetThird(out var _) && !hover.Contents.Third.Any());
+ var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 1, length: 5);
Assert.Equal(expectedRange, hover.Range);
var vsHover = Assert.IsType(hover);
@@ -589,10 +571,9 @@ public async Task GetHoverAsync_TagHelper_Attribute_VSClient_ReturnVSHover()
// Assert
Assert.NotNull(hover);
- Assert.NotNull(hover.Contents);
- Assert.False(hover.Contents.Value.TryGetFourth(out _));
- Assert.True(hover.Contents.Value.TryGetThird(out var markedStrings) && !markedStrings.Any());
- var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8);
+ Assert.False(hover.Contents.TryGetFourth(out _));
+ Assert.True(hover.Contents.TryGetThird(out var markedStrings) && !markedStrings.Any());
+ var expectedRange = LspFactory.CreateSingleLineRange(line: 1, character: 7, length: 8);
Assert.Equal(expectedRange, hover.Range);
var vsHover = Assert.IsType(hover);
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj
index 36c2f7e6ac4..71aca3c9824 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj
@@ -7,6 +7,7 @@
+
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/ClassifiedTagHelperTooltipFactoryTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/ClassifiedTagHelperTooltipFactoryTest.cs
index eb7f49dd11a..b04f9d4a0f0 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/ClassifiedTagHelperTooltipFactoryTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/ClassifiedTagHelperTooltipFactoryTest.cs
@@ -10,7 +10,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis.Classification;
-using Microsoft.VisualStudio.Text.Adornments;
+using Roslyn.Text.Adornments;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/MarkupTagHelperTooltipFactoryTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/MarkupTagHelperTooltipFactoryTest.cs
index b0c37f88f75..4af34838900 100644
--- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/MarkupTagHelperTooltipFactoryTest.cs
+++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Tooltip/MarkupTagHelperTooltipFactoryTest.cs
@@ -6,7 +6,6 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Test.Common;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CodeActions/CohostCodeActionsEndpointTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CodeActions/CohostCodeActionsEndpointTestBase.cs
index 4df101a158c..618212adab9 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CodeActions/CohostCodeActionsEndpointTestBase.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CodeActions/CohostCodeActionsEndpointTestBase.cs
@@ -19,12 +19,10 @@
using Microsoft.CodeAnalysis.Razor.Workspaces;
using Microsoft.CodeAnalysis.Remote.Razor;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.Settings;
using Roslyn.Test.Utilities;
using Xunit;
using Xunit.Abstractions;
-using LspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost.CodeActions;
@@ -170,11 +168,11 @@ private async Task VerifyCodeActionResultAsync(TextDocument document, WorkspaceE
var text = await textDocument.GetTextAsync(DisposalToken).ConfigureAwait(false);
if (textDocument is Document)
{
- solution = solution.WithDocumentText(textDocument.Id, text.WithChanges(edit.Edits.Select(text.GetTextChange)));
+ solution = solution.WithDocumentText(textDocument.Id, text.WithChanges(edit.Edits.Select(e => text.GetTextChange((TextEdit)e))));
}
else
{
- solution = solution.WithAdditionalDocumentText(textDocument.Id, text.WithChanges(edit.Edits.Select(text.GetTextChange)));
+ solution = solution.WithAdditionalDocumentText(textDocument.Id, text.WithChanges(edit.Edits.Select(e => text.GetTextChange((TextEdit)e))));
}
}
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs
index 9f9dfac1b9b..ffadd610c33 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentCompletionEndpointTest.cs
@@ -11,18 +11,11 @@
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Razor.Completion;
using Microsoft.CodeAnalysis.Razor.Settings;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.Razor.Settings;
using Microsoft.VisualStudio.Razor.Snippets;
using Xunit;
using Xunit.Abstractions;
-using RoslynCompletionParams = Roslyn.LanguageServer.Protocol.CompletionParams;
-using RoslynCompletionTriggerKind = Roslyn.LanguageServer.Protocol.CompletionTriggerKind;
-using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions;
-using RoslynTextDocumentIdentifier = Roslyn.LanguageServer.Protocol.TextDocumentIdentifier;
-using RoslynVSInternalCompletionContext = Roslyn.LanguageServer.Protocol.VSInternalCompletionContext;
-using RoslynVSInternalCompletionInvokeKind = Roslyn.LanguageServer.Protocol.VSInternalCompletionInvokeKind;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
@@ -41,10 +34,10 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["var", "char", "DateTime", "Exception"]);
}
@@ -60,11 +53,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "@",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["char", "DateTime", "Exception"]);
}
@@ -80,11 +73,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = ".",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["DaysInMonth", "IsLeapYear", "Now"]);
}
@@ -102,11 +95,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["char", "DateTime", "Exception"]);
}
@@ -129,11 +122,11 @@ void foo()
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = ".",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["DaysInMonth", "IsLeapYear", "Now"]);
}
@@ -151,11 +144,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["Equals(object? obj)", "GetHashCode()", "SetParametersAsync(ParameterView parameters)", "ToString()"]);
}
@@ -179,11 +172,11 @@ void foo()
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "<",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["text", "EditForm", "InputDate", "div"],
delegatedItemLabels: ["div"]);
@@ -220,11 +213,11 @@ void foo()
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "@",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: expectedLabels);
}
@@ -240,11 +233,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "<",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["LayoutView", "EditForm", "ValidationMessage", "div"],
delegatedItemLabels: ["div"]);
@@ -261,11 +254,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "<",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["div", "h1", "LayoutView", "EditForm", "ValidationMessage"],
delegatedItemLabels: ["div", "h1"]);
@@ -280,11 +273,11 @@ This is a Razor document.
<$$
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "<",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["div", "h1", "LayoutView", "EditForm", "ValidationMessage"],
delegatedItemLabels: ["div", "h1"],
@@ -302,11 +295,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "<",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["div", "h1", "LayoutView", "EditForm", "ValidationMessage"],
delegatedItemLabels: ["div", "h1"],
@@ -325,11 +318,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["snippet1", "snippet2"],
delegatedItemLabels: [],
@@ -343,11 +336,11 @@ await VerifyCompletionListAsync(
input: """
$$
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["snippet1", "snippet2"],
delegatedItemLabels: [],
@@ -362,11 +355,11 @@ await VerifyCompletionListAsync(
$$
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["snippet1", "snippet2"],
delegatedItemLabels: [],
@@ -381,11 +374,11 @@ await VerifyCompletionListAsync(
$$
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Explicit,
+ InvokeKind = VSInternalCompletionInvokeKind.Explicit,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["snippet1", "snippet2"],
delegatedItemLabels: [],
@@ -403,11 +396,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = " ",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["style", "dir"],
unexpectedItemLabels: ["snippet1", "snippet2"],
@@ -427,11 +420,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = " ",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["style", "dir", "@..."],
delegatedItemLabels: ["style", "dir"]);
@@ -449,11 +442,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = "@",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["style", "dir", "@rendermode", "@bind-..."],
delegatedItemLabels: ["style", "dir"]);
@@ -471,11 +464,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = null,
- TriggerKind = RoslynCompletionTriggerKind.Invoked
+ TriggerKind = CompletionTriggerKind.Invoked
},
expectedItemLabels: ["style", "dir", "culture", "event", "format", "get", "set", "after"],
delegatedItemLabels: ["style", "dir"]);
@@ -492,11 +485,11 @@ This is a Razor document.
The end.
""",
- completionContext: new RoslynVSInternalCompletionContext()
+ completionContext: new VSInternalCompletionContext()
{
- InvokeKind = RoslynVSInternalCompletionInvokeKind.Typing,
+ InvokeKind = VSInternalCompletionInvokeKind.Typing,
TriggerCharacter = " ",
- TriggerKind = RoslynCompletionTriggerKind.TriggerCharacter
+ TriggerKind = CompletionTriggerKind.TriggerCharacter
},
expectedItemLabels: ["style", "dir", "FormName", "OnValidSubmit", "@..."],
delegatedItemLabels: ["style", "dir"]);
@@ -511,11 +504,11 @@ This is a Razor document.
ClientNotifyAsync
public Task RequestAsync(ITextBuffer textBuffer, Func capabilitiesFilter, string languageServerName, string method, Func parameterFactory, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task RequestAsync(ILanguageClient languageClient, string method, JToken parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task RequestAsync(Request request, CancellationToken cancellationToken) => throw new NotImplementedException();
- public Task<(ILanguageClient?, TOut)> RequestAsync(string[] contentTypes, Func capabilitiesFilter, LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
- public Task RequestAsync(ILanguageClient languageClient, LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
+ public Task<(ILanguageClient?, TOut)> RequestAsync(string[] contentTypes, Func capabilitiesFilter, VSLSP.LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
+ public Task RequestAsync(ILanguageClient languageClient, VSLSP.LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
public Task> RequestMultipleAsync(string[] contentTypes, Func capabilitiesFilter, string method, JToken parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
public IAsyncEnumerable RequestMultipleAsync(ITextBuffer textBuffer, Func capabilitiesFilter, string method, Func parameterFactory, CancellationToken cancellationToken) => throw new NotImplementedException();
- public Task> RequestMultipleAsync(string[] contentTypes, Func capabilitiesFilter, LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
+ public Task> RequestMultipleAsync(string[] contentTypes, Func capabilitiesFilter, VSLSP.LspRequest method, TIn parameters, CancellationToken cancellationToken) => throw new NotImplementedException();
}
[Export(typeof(IWorkspaceProvider))]
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs
index c1fd7478cb2..b392bc54131 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs
@@ -23,9 +23,8 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.NET.Sdk.Razor.SourceGenerators;
using Microsoft.VisualStudio.Composition;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
-using Xunit;
using Roslyn.Test.Utilities;
+using Xunit;
using Xunit.Abstractions;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs
index 80011167cd7..e87ee65657f 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFindAllReferencesEndpointTest.cs
@@ -8,7 +8,6 @@
using Microsoft.AspNetCore.Razor.Utilities;
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Text;
-using Roslyn.LanguageServer.Protocol;
using Roslyn.Text.Adornments;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs
index 6af5a045c67..2dcb667c79a 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs
@@ -10,7 +10,6 @@
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Roslyn.Test.Utilities;
using Xunit;
using Xunit.Abstractions;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs
index 1bfd5c1165d..24666f4b1a7 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs
@@ -9,12 +9,8 @@
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
-using RoslynDocumentLink = Roslyn.LanguageServer.Protocol.DocumentLink;
-using RoslynLocation = Roslyn.LanguageServer.Protocol.Location;
-using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions;
using TextDocument = Microsoft.CodeAnalysis.TextDocument;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
@@ -153,7 +149,7 @@ public async Task Component()
var location = Assert.Single(locations);
var text = SourceText.From(surveyPrompt.Text);
- var range = RoslynLspExtensions.GetRange(text, surveyPrompt.Span);
+ var range = text.GetRange(surveyPrompt.Span);
Assert.Equal(range, location.Range);
}
@@ -199,7 +195,7 @@ @namespace SomeProject
var location = Assert.Single(locations);
var text = SourceText.From(surveyPrompt.Text);
- var range = RoslynLspExtensions.GetRange(text, surveyPrompt.Span);
+ var range = text.GetRange(surveyPrompt.Span);
Assert.Equal(range, location.Range);
}
@@ -250,13 +246,13 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind =
var location = Assert.Single(locations);
var text = SourceText.From(input.Text);
- var range = RoslynLspExtensions.GetRange(text, input.Span);
+ var range = text.GetRange(input.Span);
Assert.Equal(range, location.Range);
Assert.Equal(document.CreateUri(), location.Uri);
}
- private async Task?> GetGoToDefinitionResultAsync(
+ private async Task?> GetGoToDefinitionResultAsync(
TestCode input, string? fileKind = null, params (string fileName, string contents)[]? additionalFiles)
{
UpdateClientInitializationOptions(c => c with { ForceRuntimeCodeGeneration = context.ForceRuntimeCodeGeneration });
@@ -265,7 +261,7 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind =
return await GetGoToDefinitionResultCoreAsync(document, input, htmlResponse: null);
}
- private async Task?> GetGoToDefinitionResultCoreAsync(
+ private async Task?> GetGoToDefinitionResultCoreAsync(
TextDocument document, TestCode input, SumType? htmlResponse)
{
var inputText = await document.GetTextAsync(DisposalToken);
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs
index 6db852ad742..0b5849367d5 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs
@@ -9,11 +9,8 @@
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Remote.Razor;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
-using LspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location;
-using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
@@ -154,19 +151,11 @@ private async Task VerifyGoToImplementationResultCoreAsync(TestCode input, TextD
if (result.Value.TryGetFirst(out var roslynLocations))
{
var expected = input.Spans.Select(s => inputText.GetRange(s).ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray();
- var actual = roslynLocations.Select(l => RoslynLspExtensions.ToLinePositionSpan(l.Range)).OrderBy(r => r.Start.Line).ToArray();
+ var actual = roslynLocations.Select(l => l.Range.ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray();
Assert.Equal(expected, actual);
Assert.All(roslynLocations, l => l.Uri.Equals(document.CreateUri()));
}
- else if (result.Value.TryGetSecond(out var vsLocations))
- {
- var expected = input.Spans.Select(s => inputText.GetRange(s).ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray();
- var actual = vsLocations.Select(l => l.Range.ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray();
- Assert.Equal(expected, actual);
-
- Assert.All(vsLocations, l => l.Uri.Equals(document.CreateUri()));
- }
else
{
Assert.Fail($"Unsupported result type: {result.Value.GetType()}");
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs
index 068e3ce8b96..c0951e01a7d 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostHoverEndpointTest.cs
@@ -7,10 +7,8 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Xunit;
using Xunit.Abstractions;
-using RoslynHover = Roslyn.LanguageServer.Protocol.Hover;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
@@ -183,7 +181,7 @@ await VerifyHoverAsync(code, async (hover, document) =>
});
}
- private async Task VerifyHoverAsync(TestCode input, Func verifyHover)
+ private async Task VerifyHoverAsync(TestCode input, Func verifyHover)
{
UpdateClientInitializationOptions(c => c with { ForceRuntimeCodeGeneration = context.ForceRuntimeCodeGeneration });
@@ -191,10 +189,7 @@ private async Task VerifyHoverAsync(TestCode input, Func verifyHover)
@@ -205,13 +200,10 @@ private async Task VerifyHoverAsync(TestCode input, Hover htmlResponse, Action?> GetHoverResultAsync(TextDocument document, TestCode input, Hover? htmlResponse = null)
+ private async Task GetHoverResultAsync(TextDocument document, TestCode input, Hover? htmlResponse = null)
{
var inputText = await document.GetTextAsync(DisposalToken);
var linePosition = inputText.GetLinePosition(input.Position);
@@ -221,7 +213,7 @@ private async Task VerifyHoverAsync(TestCode input, Hover htmlResponse, Action()
+ new Dictionary()
{
[hostDocumentPosition] = hostBreakpointRange
});
@@ -187,6 +185,6 @@ private static Position GetPosition(string content, ITextBuffer textBuffer)
}
var line = textBuffer.CurrentSnapshot.GetLineFromPosition(index);
- return VsLspFactory.CreatePosition(line.LineNumber, index - line.Start.Position);
+ return LspFactory.CreatePosition(line.LineNumber, index - line.Start.Position);
}
}
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs
index 7c15ab02144..b3129ae4af9 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs
@@ -13,7 +13,6 @@
using Microsoft.AspNetCore.Razor.Threading;
using Microsoft.CodeAnalysis.Razor.Remote;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.Debugging;
using Microsoft.VisualStudio.Text;
using Moq;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs
index dc7e3527557..5b72eabae2e 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs
@@ -10,17 +10,15 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Threading;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
-using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging;
internal class TestLSPBreakpointSpanProvider : ILSPBreakpointSpanProvider
{
private readonly Uri _documentUri;
- private readonly IReadOnlyDictionary _mappings;
+ private readonly IReadOnlyDictionary _mappings;
- public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary mappings)
+ public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary mappings)
{
if (documentUri is null)
{
@@ -36,11 +34,11 @@ public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken)
+ public Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken)
{
if (documentSnapshot.Uri != _documentUri)
{
- return SpecializedTasks.Null();
+ return SpecializedTasks.Null();
}
foreach (var mapping in _mappings.OrderBy(d => d.Key))
@@ -52,6 +50,6 @@ public Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot,
}
}
- return SpecializedTasks.Null();
+ return SpecializedTasks.Null();
}
}
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs
index c13654a7879..bd942f66daa 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/DocumentMapping/LSPDocumentMappingProviderTest.cs
@@ -11,7 +11,6 @@
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Text;
using Moq;
using Xunit;
@@ -47,7 +46,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer()
var response = new RazorMapToDocumentRangesResponse()
{
- Ranges = [VsLspFactory.CreateRange(1, 1, 3, 3)],
+ Ranges = [LspFactory.CreateRange(1, 1, 3, 3)],
HostDocumentVersion = 1
};
var requestInvoker = new Mock(MockBehavior.Strict);
@@ -61,7 +60,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer()
.ReturnsAsync(new ReinvocationResponse("TestLanguageClient", response));
var mappingProvider = new LSPDocumentMappingProvider(requestInvoker.Object, _documentManager);
- var projectedRange = VsLspFactory.CreateRange(10, 10, 15, 15);
+ var projectedRange = LspFactory.CreateRange(10, 10, 15, 15);
// Act
var result = await mappingProvider.MapToDocumentRangesAsync(RazorLanguageKind.CSharp, uri, new[] { projectedRange }, DisposalToken);
@@ -70,7 +69,7 @@ public async Task RazorMapToDocumentRangeAsync_InvokesLanguageServer()
Assert.NotNull(result);
Assert.Equal(1, result.HostDocumentVersion);
var actualRange = result.Ranges[0];
- Assert.Equal(VsLspFactory.CreatePosition(1, 1), actualRange.Start);
- Assert.Equal(VsLspFactory.CreatePosition(3, 3), actualRange.End);
+ Assert.Equal(LspFactory.CreatePosition(1, 1), actualRange.Start);
+ Assert.Equal(LspFactory.CreatePosition(3, 3), actualRange.End);
}
}
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs
index b1421041384..b85cb0209ad 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorCustomMessageTargetTest.cs
@@ -18,7 +18,6 @@
using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.LanguageClient.Cohost;
using Microsoft.VisualStudio.Razor.Settings;
using Microsoft.VisualStudio.Razor.Snippets;
@@ -223,7 +222,7 @@ public async Task ProvideCodeActionsAsync_CannotLookupDocument_ReturnsNullAsync(
{
Uri = new Uri("C:/path/to/file.razor")
},
- Range = VsLspFactory.DefaultRange,
+ Range = LspFactory.DefaultRange,
Context = new VSInternalCodeActionContext()
}
};
@@ -306,7 +305,7 @@ async IAsyncEnumerable>
{
Uri = testDocUri
},
- Range = VsLspFactory.DefaultRange,
+ Range = LspFactory.DefaultRange,
Context = new VSInternalCodeActionContext()
}
};
@@ -431,7 +430,7 @@ public async Task ProvideSemanticTokensAsync_CannotLookupDocument_ReturnsNullAsy
Uri = new Uri("C:/path/to/file.razor")
},
requiredHostDocumentVersion: 1,
- ranges: [VsLspFactory.DefaultRange],
+ ranges: [LspFactory.DefaultRange],
correlationId: Guid.Empty);
// Act
@@ -480,7 +479,7 @@ public async Task ProvideSemanticTokensAsync_CannotLookupVirtualDocument_Returns
Uri = new Uri("C:/path/to/file.razor")
},
requiredHostDocumentVersion: 0,
- ranges: [VsLspFactory.DefaultRange],
+ ranges: [LspFactory.DefaultRange],
correlationId: Guid.Empty);
// Act
@@ -515,11 +514,11 @@ public async Task ProvideSemanticTokensAsync_ContainsRange_ReturnsSemanticTokens
var expectedCSharpResults = new SemanticTokens() { Data = new int[] { It.IsAny() } };
var requestInvoker = new Mock(MockBehavior.Strict);
requestInvoker
- .Setup(invoker => invoker.ReinvokeRequestOnServerAsync(
+ .Setup(invoker => invoker.ReinvokeRequestOnServerAsync(
_textBuffer,
It.IsAny(),
RazorLSPConstants.RazorCSharpLanguageServerName,
- It.IsAny(),
+ It.IsAny(),
It.IsAny()))
.ReturnsAsync(new ReinvocationResponse("languageClient", expectedCSharpResults));
@@ -562,7 +561,7 @@ public async Task ProvideSemanticTokensAsync_ContainsRange_ReturnsSemanticTokens
Uri = new Uri("C:/path/to%20-%20project/file.razor")
},
requiredHostDocumentVersion: 0,
- ranges: [VsLspFactory.DefaultRange],
+ ranges: [LspFactory.DefaultRange],
correlationId: Guid.Empty);
// Act
@@ -598,11 +597,11 @@ public async Task ProvideSemanticTokensAsync_EmptyRange_ReturnsNoSemanticTokens(
var expectedCSharpResults = new SemanticTokens();
var requestInvoker = new Mock(MockBehavior.Strict);
requestInvoker
- .Setup(invoker => invoker.ReinvokeRequestOnServerAsync(
+ .Setup(invoker => invoker.ReinvokeRequestOnServerAsync(
_textBuffer,
It.IsAny(),
RazorLSPConstants.RazorCSharpLanguageServerName,
- It.IsAny(),
+ It.IsAny(),
It.IsAny()))
.ReturnsAsync(new ReinvocationResponse("languageClient", expectedCSharpResults));
@@ -645,7 +644,7 @@ public async Task ProvideSemanticTokensAsync_EmptyRange_ReturnsNoSemanticTokens(
Uri = new Uri("C:/path/to%20-%20project/file.razor")
},
requiredHostDocumentVersion: 0,
- ranges: [VsLspFactory.DefaultRange],
+ ranges: [LspFactory.DefaultRange],
correlationId: Guid.Empty);
var expectedResults = new ProvideSemanticTokensResponse(null, documentVersion);
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorDocumentOptionsServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorDocumentOptionsServiceTest.cs
index df65c78c417..4b5f6214c76 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorDocumentOptionsServiceTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorDocumentOptionsServiceTest.cs
@@ -9,7 +9,6 @@
using Microsoft.AspNetCore.Razor.Test.Common.Workspaces;
using Microsoft.AspNetCore.Razor.Utilities;
using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
using Microsoft.CodeAnalysis.Razor.Settings;
@@ -17,6 +16,7 @@
using Microsoft.VisualStudio.Razor.Settings;
using Xunit;
using Xunit.Abstractions;
+using FormattingOptions = Microsoft.CodeAnalysis.Formatting.FormattingOptions;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPMappingServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPMappingServiceTest.cs
index c246a768acf..c7bb4e7029c 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPMappingServiceTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPMappingServiceTest.cs
@@ -10,11 +10,9 @@
using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping;
using Xunit;
using Xunit.Abstractions;
-using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
@@ -22,13 +20,13 @@ public class RazorLSPMappingServiceTest(ITestOutputHelper testOutput) : ToolingT
{
private readonly Uri _mockDocumentUri = new("C://project/path/document.razor");
- const string s_mockGeneratedContent = """
+ private const string MockGeneratedContent = """
Hello
This is the source text in the generated C# file.
This is some more sample text for demo purposes.
""";
- const string s_mockRazorContent = """
+ private const string MockRazorContent = """
Hello
This is the
source text
@@ -36,8 +34,8 @@ in the generated C# file.
This is some more sample text for demo purposes.
""";
- private static readonly SourceText _sourceTextGenerated = SourceText.From(s_mockGeneratedContent);
- private static readonly SourceText _sourceTextRazor = SourceText.From(s_mockRazorContent);
+ private static readonly SourceText s_sourceTextGenerated = SourceText.From(MockGeneratedContent);
+ private static readonly SourceText s_sourceTextRazor = SourceText.From(MockRazorContent);
[Fact]
public async Task MapSpans_WithinRange_ReturnsMapping()
@@ -48,12 +46,12 @@ public async Task MapSpans_WithinRange_ReturnsMapping()
var documentSnapshot = new StrictMock();
documentSnapshot.SetupGet(doc => doc.Uri).Returns(_mockDocumentUri);
- documentSnapshot.SetupGet(doc => doc.Snapshot).Returns(new StringTextSnapshot(_sourceTextRazor.ToString()));
+ documentSnapshot.SetupGet(doc => doc.Snapshot).Returns(new StringTextSnapshot(s_sourceTextRazor.ToString()));
- var textSnapshot = new StringTextSnapshot(s_mockGeneratedContent, 1);
+ var textSnapshot = new StringTextSnapshot(MockGeneratedContent, 1);
- var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan);
- var mappedRange = VsLspFactory.CreateSingleLineRange(2, character: 1, length: 10);
+ var textSpanAsRange = s_sourceTextGenerated.GetRange(textSpan);
+ var mappedRange = LspFactory.CreateSingleLineRange(2, character: 1, length: 10);
var mappingResult = new RazorMapToDocumentRangesResponse()
{
@@ -76,13 +74,13 @@ public async Task MapSpans_WithinRange_ReturnsMapping()
var service = new RazorLSPMappingService(documentMappingProvider, documentSnapshot.Object, textSnapshot);
- var expectedSpan = _sourceTextRazor.GetTextSpan(mappedRange);
- var expectedLinePosition = _sourceTextRazor.GetLinePositionSpan(expectedSpan);
+ var expectedSpan = s_sourceTextRazor.GetTextSpan(mappedRange);
+ var expectedLinePosition = s_sourceTextRazor.GetLinePositionSpan(expectedSpan);
var expectedFilePath = _mockDocumentUri.LocalPath;
var expectedResult = (expectedFilePath, expectedLinePosition, expectedSpan);
// Act
- var result = await service.GetTestAccessor().MapSpansAsync(spans, _sourceTextGenerated, _sourceTextRazor, DisposalToken);
+ var result = await service.GetTestAccessor().MapSpansAsync(spans, s_sourceTextGenerated, s_sourceTextRazor, DisposalToken);
// Assert
Assert.Single(result, expectedResult);
@@ -97,11 +95,11 @@ public async Task MapSpans_OutsideRange_ReturnsEmpty()
var documentSnapshot = new StrictMock();
documentSnapshot.SetupGet(doc => doc.Uri).Returns(_mockDocumentUri);
- documentSnapshot.SetupGet(doc => doc.Snapshot).Returns(new StringTextSnapshot(_sourceTextRazor.ToString()));
+ documentSnapshot.SetupGet(doc => doc.Snapshot).Returns(new StringTextSnapshot(s_sourceTextRazor.ToString()));
- var textSnapshot = new StringTextSnapshot(s_mockGeneratedContent, 1);
+ var textSnapshot = new StringTextSnapshot(MockGeneratedContent, 1);
- var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan);
+ var textSpanAsRange = s_sourceTextGenerated.GetRange(textSpan);
var requestInvoker = new TestLSPRequestInvoker(new List<(string, object?)>()
{
@@ -121,7 +119,7 @@ public async Task MapSpans_OutsideRange_ReturnsEmpty()
var service = new RazorLSPMappingService(documentMappingProvider, documentSnapshot.Object, textSnapshot);
// Act
- var result = await service.GetTestAccessor().MapSpansAsync(spans, _sourceTextGenerated, _sourceTextRazor, DisposalToken);
+ var result = await service.GetTestAccessor().MapSpansAsync(spans, s_sourceTextGenerated, s_sourceTextRazor, DisposalToken);
// Assert
Assert.Empty(result);
@@ -132,7 +130,7 @@ public void MapSpans_GetMappedSpanResults_MappingErrorReturnsDefaultMappedSpan()
{
// Arrange
var sourceTextRazor = SourceText.From("");
- var response = new RazorMapToDocumentRangesResponse { Ranges = new Range[] { VsLspFactory.UndefinedRange } };
+ var response = new RazorMapToDocumentRangesResponse { Ranges = [LspFactory.UndefinedRange] };
// Act
var results = RazorLSPSpanMappingService.GetMappedSpanResults(_mockDocumentUri.LocalPath, sourceTextRazor, response);
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs
index d54401df24d..a5bfb4e5de1 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/RazorLSPSpanMappingServiceTest.cs
@@ -3,22 +3,17 @@
using System;
using System.Linq;
-using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.AspNetCore.Razor.Test.Common.Editor;
-using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Razor.Protocol.DocumentMapping;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping;
-using Microsoft.VisualStudio.Text;
using Moq;
using Xunit;
using Xunit.Abstractions;
-using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
@@ -26,12 +21,12 @@ public class RazorLSPSpanMappingServiceTest(ITestOutputHelper testOutput) : Tool
{
private readonly Uri _mockDocumentUri = new("C://project/path/document.razor");
- const string s_mockGeneratedContent = """
+ private const string MockGeneratedContent = """
Hello
This is the source text in the generated C# file.
This is some more sample text for demo purposes.
""";
- const string s_mockRazorContent = """
+ private const string MockRazorContent = """
Hello
This is the
source text
@@ -39,8 +34,8 @@ in the generated C# file.
This is some more sample text for demo purposes.
""";
- private static readonly SourceText _sourceTextGenerated = SourceText.From(s_mockGeneratedContent);
- private static readonly SourceText _sourceTextRazor = SourceText.From(s_mockRazorContent);
+ private static readonly SourceText s_sourceTextGenerated = SourceText.From(MockGeneratedContent);
+ private static readonly SourceText s_sourceTextRazor = SourceText.From(MockRazorContent);
[Fact]
public async Task MapSpans_WithinRange_ReturnsMapping()
@@ -52,10 +47,10 @@ public async Task MapSpans_WithinRange_ReturnsMapping()
var documentSnapshot = new Mock(MockBehavior.Strict);
documentSnapshot.SetupGet(doc => doc.Uri).Returns(_mockDocumentUri);
- var textSnapshot = new StringTextSnapshot(s_mockGeneratedContent, 1);
+ var textSnapshot = new StringTextSnapshot(MockGeneratedContent, 1);
- var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan);
- var mappedRange = VsLspFactory.CreateSingleLineRange(2, character: 1, length: 10);
+ var textSpanAsRange = s_sourceTextGenerated.GetRange(textSpan);
+ var mappedRange = LspFactory.CreateSingleLineRange(2, character: 1, length: 10);
var mappingResult = new RazorMapToDocumentRangesResponse()
{
@@ -63,7 +58,6 @@ public async Task MapSpans_WithinRange_ReturnsMapping()
};
var requestInvoker = new TestLSPRequestInvoker([(LanguageServerConstants.RazorMapToDocumentRangesEndpoint, mappingResult)]);
-
var lazyDocumentManager = new Lazy(() =>
{
var documentManager = new TestDocumentManager();
@@ -75,13 +69,13 @@ public async Task MapSpans_WithinRange_ReturnsMapping()
var service = new RazorLSPSpanMappingService(documentMappingProvider, documentSnapshot.Object, textSnapshot);
- var expectedSpan = _sourceTextRazor.GetTextSpan(mappedRange);
- var expectedLinePosition = _sourceTextRazor.GetLinePositionSpan(expectedSpan);
+ var expectedSpan = s_sourceTextRazor.GetTextSpan(mappedRange);
+ var expectedLinePosition = s_sourceTextRazor.GetLinePositionSpan(expectedSpan);
var expectedFilePath = _mockDocumentUri.LocalPath;
var expectedResult = (expectedFilePath, expectedLinePosition, expectedSpan);
// Act
- var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor);
+ var result = await service.MapSpansAsyncTest(spans, s_sourceTextGenerated, s_sourceTextRazor);
// Assert
Assert.Single(result, expectedResult);
@@ -97,9 +91,9 @@ public async Task MapSpans_OutsideRange_ReturnsEmpty()
var documentSnapshot = new Mock(MockBehavior.Strict);
documentSnapshot.SetupGet(doc => doc.Uri).Returns(_mockDocumentUri);
- var textSnapshot = new StringTextSnapshot(s_mockGeneratedContent, 1);
+ var textSnapshot = new StringTextSnapshot(MockGeneratedContent, 1);
- var textSpanAsRange = _sourceTextGenerated.GetRange(textSpan);
+ var textSpanAsRange = s_sourceTextGenerated.GetRange(textSpan);
var requestInvoker = new StrictMock();
var lazyDocumentManager = new Lazy(() => new TestDocumentManager());
@@ -109,7 +103,7 @@ public async Task MapSpans_OutsideRange_ReturnsEmpty()
var service = new RazorLSPSpanMappingService(documentMappingProvider, documentSnapshot.Object, textSnapshot);
// Act
- var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor);
+ var result = await service.MapSpansAsyncTest(spans, s_sourceTextGenerated, s_sourceTextRazor);
// Assert
Assert.Empty(result);
@@ -120,7 +114,7 @@ public void MapSpans_GetMappedSpanResults_MappingErrorReturnsDefaultMappedSpan()
{
// Arrange
var sourceTextRazor = SourceText.From("");
- var response = new RazorMapToDocumentRangesResponse { Ranges = new Range[] { VsLspFactory.UndefinedRange } };
+ var response = new RazorMapToDocumentRangesResponse { Ranges = [LspFactory.UndefinedRange] };
// Act
var results = RazorLSPSpanMappingService.GetMappedSpanResults(_mockDocumentUri.LocalPath, sourceTextRazor, response);
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs
index 9637feecd45..a18c30c2337 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestDocumentManager.cs
@@ -11,7 +11,6 @@
using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Text;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
@@ -73,7 +72,7 @@ private void UpdateCSharpServerDocument(IReadOnlyList changes, Virt
var rangesAndTexts = changes.Select(c =>
{
GetLinesAndOffsets(virtualSourceText, c.OldSpan, out var startLine, out var startCharacter, out var endLine, out var endCharacter);
- var range = VsLspFactory.CreateRange(startLine, startCharacter, endLine, endCharacter);
+ var range = LspFactory.CreateRange(startLine, startCharacter, endLine, endCharacter);
return (range, c.NewText);
}).ToArray();
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestFormattingOptionsProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestFormattingOptionsProvider.cs
index 8d125063368..853c2a48a8d 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestFormattingOptionsProvider.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestFormattingOptionsProvider.cs
@@ -3,11 +3,11 @@
using System;
using Microsoft.VisualStudio.LanguageServer.ContainedLanguage;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
+using FormattingOptions = Microsoft.VisualStudio.LanguageServer.Protocol.FormattingOptions;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
-internal class TestFormattingOptionsProvider : FormattingOptionsProvider
+internal class TestFormattingOptionsProvider(FormattingOptions options) : FormattingOptionsProvider
{
public static readonly TestFormattingOptionsProvider Default = new(
new FormattingOptions()
@@ -15,12 +15,6 @@ internal class TestFormattingOptionsProvider : FormattingOptionsProvider
InsertSpaces = true,
TabSize = 4,
});
- private readonly FormattingOptions _options;
- public TestFormattingOptionsProvider(FormattingOptions options)
- {
- _options = options;
- }
-
- public override FormattingOptions? GetOptions(Uri uri) => _options;
+ public override FormattingOptions? GetOptions(Uri uri) => options;
}
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs
index 3b46d91e9c7..71929d39ac0 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestRazorLSPSpanMappingService.cs
@@ -11,7 +11,6 @@
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.LanguageClient.DocumentMapping;
namespace Microsoft.VisualStudio.Razor.LanguageClient;
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj
index fd54e585914..6b21e7dd53b 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj
@@ -32,6 +32,7 @@
+
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs
index b4509b4df5f..47c5b81fd03 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs
@@ -9,7 +9,6 @@
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.AspNetCore.Razor.Test.Common.Editor;
using Microsoft.VisualStudio.Editor;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Razor.Debugging;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.TextManager.Interop;
@@ -69,7 +68,7 @@ public void ValidateBreakpointLocation_NullBreakpointRange_ReturnsEFail()
public void ValidateBreakpointLocation_ValidBreakpointRange_ReturnsSOK()
{
// Arrange
- var breakpointRange = VsLspFactory.CreateRange(2, 4, 3, 5);
+ var breakpointRange = LspFactory.CreateRange(2, 4, 3, 5);
var breakpointResolver = Mock.Of(resolver => resolver.TryResolveBreakpointRangeAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(breakpointRange), MockBehavior.Strict);
var languageService = CreateLanguageServiceWith(breakpointResolver);
diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs
index f16381fe46a..2e37fe2dc58 100644
--- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs
+++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs
@@ -11,7 +11,6 @@
using Microsoft.AspNetCore.Razor.Test.Common;
using Microsoft.CodeAnalysis.LanguageServer;
using Microsoft.VisualStudio.Editor.Razor.Test.Shared;
-using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Telemetry;
using Microsoft.VisualStudio.Telemetry.Metrics;
using StreamJsonRpc;