Remove format lt 512 diff restriction (#1109)
This commit is contained in:
parent
0f85c49e46
commit
7814a05921
@ -935,15 +935,6 @@ pub fn formattingHandler(server: *Server, request: types.DocumentFormattingParam
|
|||||||
|
|
||||||
if (std.mem.eql(u8, handle.text, formatted)) return null;
|
if (std.mem.eql(u8, handle.text, formatted)) return null;
|
||||||
|
|
||||||
if (formatted.len <= 512) {
|
|
||||||
var text_edits = try allocator.alloc(types.TextEdit, 1);
|
|
||||||
text_edits[0] = .{
|
|
||||||
.range = offsets.locToRange(handle.text, .{ .start = 0, .end = handle.text.len }, server.offset_encoding),
|
|
||||||
.newText = formatted,
|
|
||||||
};
|
|
||||||
return text_edits;
|
|
||||||
}
|
|
||||||
|
|
||||||
return if (diff.edits(allocator, handle.text, formatted, server.offset_encoding)) |text_edits| text_edits.items else |_| null;
|
return if (diff.edits(allocator, handle.text, formatted, server.offset_encoding)) |text_edits| text_edits.items else |_| null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user