Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/Lsp.Tests/Matchers/TextDocumentMatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,30 @@ public void Should_Return_Did_Open_Text_Document_Handler_Descriptor()
result.Should().Contain(x => x.Method == DocumentNames.DidOpen);
}

[Fact]
public void Should_Return_Did_Open_Text_Document_Handler_Descriptor_With_Sepcial_Character()
{
// Given
var textDocumentSyncHandler =
TextDocumentSyncHandlerExtensions.With(DocumentSelector.ForPattern("**/*.cshtml"));
var collection = new HandlerCollection(SupportedCapabilitiesFixture.AlwaysTrue) { textDocumentSyncHandler };
AutoSubstitute.Provide<IHandlerCollection>(collection);
AutoSubstitute.Provide<IEnumerable<ILspHandlerDescriptor>>(collection);
var handlerMatcher = AutoSubstitute.Resolve<TextDocumentMatcher>();

// When
var result = handlerMatcher.FindHandler(new DidOpenTextDocumentParams() {
TextDocument = new TextDocumentItem {
Uri = new Uri("file://c:/users/myøasdf/d.cshtml")
}
},
collection.Where(x => x.Method == DocumentNames.DidOpen));

// Then
result.Should().NotBeNullOrEmpty();
result.Should().Contain(x => x.Method == DocumentNames.DidOpen);
}

[Fact]
public void Should_Return_Did_Change_Text_Document_Descriptor()
{
Expand Down