From 0af42d560876c08bed61ecebf0b126c89dff0ee2 Mon Sep 17 00:00:00 2001 From: Victor Song Date: Wed, 24 May 2023 02:13:43 -0500 Subject: [PATCH] Replace nonexistent `std.sort.sort` with `std.mem.sort` --- src/Server.zig | 2 +- src/diff.zig | 2 +- src/features/document_symbol.zig | 2 +- src/features/folding_range.zig | 2 +- src/features/selection_range.zig | 2 +- tests/ErrorBuilder.zig | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Server.zig b/src/Server.zig index 7d3d7bc..37379dc 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -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 }; diff --git a/src/diff.zig b/src/diff.zig index 5da6ced..ee0abf2 100644 --- a/src/diff.zig +++ b/src/diff.zig @@ -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); diff --git a/src/features/document_symbol.zig b/src/features/document_symbol.zig index 1051810..f4cfad1 100644 --- a/src/features/document_symbol.zig +++ b/src/features/document_symbol.zig @@ -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 }; diff --git a/src/features/folding_range.zig b/src/features/folding_range.zig index 6423b86..5ccfa6c 100644 --- a/src/features/folding_range.zig +++ b/src/features/folding_range.zig @@ -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 }; diff --git a/src/features/selection_range.zig b/src/features/selection_range.zig index bfd98e6..5183f5d 100644 --- a/src/features/selection_range.zig +++ b/src/features/selection_range.zig @@ -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) { diff --git a/tests/ErrorBuilder.zig b/tests/ErrorBuilder.zig index 945f81a..8cfe4f2 100644 --- a/tests/ErrorBuilder.zig +++ b/tests/ErrorBuilder.zig @@ -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) {