Replace nonexistent std.sort.sort with std.mem.sort

This commit is contained in:
Victor Song 2023-05-24 02:13:43 -05:00
parent 2ff2593a86
commit 0af42d5608
6 changed files with 6 additions and 6 deletions

View File

@ -1142,7 +1142,7 @@ fn inlayHintHandler(server: *Server, request: types.InlayHintParams) Error!?[]ty
}
};
std.sort.sort(inlay_hints.InlayHint, hints, {}, helper.lessThan);
std.mem.sort(inlay_hints.InlayHint, hints, {}, helper.lessThan);
var last_index: usize = 0;
var last_position: types.Position = .{ .line = 0, .character = 0 };

View File

@ -125,7 +125,7 @@ pub fn applyTextEdits(
defer allocator.free(text_edits_sortable);
std.mem.copy(types.TextEdit, text_edits_sortable, text_edits);
std.sort.sort(types.TextEdit, text_edits_sortable, {}, textEditLessThan);
std.mem.sort(types.TextEdit, text_edits_sortable, {}, textEditLessThan);
var final_text = std.ArrayListUnmanaged(u8){};
errdefer final_text.deinit(allocator);

View File

@ -171,7 +171,7 @@ fn convertSymbols(
const result = convertSymbolsInternal(from, &symbol_buffer, &mappings);
// sort items based on their source position
std.sort.sort(IndexToPositionEntry, mappings.items, {}, IndexToPositionEntry.lessThan);
std.mem.sort(IndexToPositionEntry, mappings.items, {}, IndexToPositionEntry.lessThan);
var last_index: usize = 0;
var last_position: types.Position = .{ .line = 0, .character = 0 };

View File

@ -93,7 +93,7 @@ const Builder = struct {
}
// sort mappings based on their source index
std.sort.sort(IndexToPositionEntry, mappings, {}, IndexToPositionEntry.lessThan);
std.mem.sort(IndexToPositionEntry, mappings, {}, IndexToPositionEntry.lessThan);
var last_index: usize = 0;
var last_position: types.Position = .{ .line = 0, .character = 0 };

View File

@ -37,7 +37,7 @@ pub fn generateSelectionRanges(
}
}
std.sort.sort(offsets.Loc, locs.items, {}, shorterLocsFirst);
std.mem.sort(offsets.Loc, locs.items, {}, shorterLocsFirst);
{
var i: usize = 0;
while (i + 1 < locs.items.len) {

View File

@ -92,7 +92,7 @@ pub fn write(builder: *ErrorBuilder, writer: anytype, tty_config: std.debug.TTY.
for (builder.files.keys(), builder.files.values()) |file_name, file| {
if (file.messages.items.len == 0) continue;
std.sort.sort(MsgItem, file.messages.items, file.source, ErrorBuilder.lessThan);
std.mem.sort(MsgItem, file.messages.items, file.source, ErrorBuilder.lessThan);
try writer.writeByte('\n');
if (builder.files.count() > 1) {