Skip to content

Commit bd95c2b

Browse files
committed
early return when receiving textDocument/didChange with no content changes
1 parent f3d9197 commit bd95c2b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Server.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ fn openDocumentHandler(server: *Server, _: std.mem.Allocator, notification: type
11471147
}
11481148

11491149
fn changeDocumentHandler(server: *Server, _: std.mem.Allocator, notification: types.DidChangeTextDocumentParams) Error!void {
1150+
if (notification.contentChanges.len == 0) return;
11501151
const handle = server.document_store.getHandle(notification.textDocument.uri) orelse return;
11511152

11521153
const new_text = try diff.applyContentChanges(server.allocator, handle.tree.source, notification.contentChanges, server.offset_encoding);

0 commit comments

Comments
 (0)