update for zig master (#651)

This commit is contained in:
Lee Cannon 2022-09-13 21:54:28 +01:00 committed by GitHub
parent e6238e3354
commit bd6f60e451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 17 deletions

View File

@ -892,8 +892,6 @@ fn hoverDefinitionGlobal(server: *Server, writer: anytype, id: types.RequestId,
const tracy_zone = tracy.trace(@src());
defer tracy_zone.end();
_ = server;
const decl = (try server.getSymbolGlobal(pos_index, handle)) orelse return try respondGeneric(writer, id, null_result_response);
return try server.hoverSymbol(writer, id, decl);
}

View File

@ -1460,8 +1460,6 @@ fn tokenRangeAppend(prev: SourceRange, token: std.zig.Token) SourceRange {
const DocumentPosition = offsets.DocumentPosition;
pub fn documentPositionContext(arena: *std.heap.ArenaAllocator, document: types.TextDocument, doc_position: DocumentPosition) !PositionContext {
_ = document;
const line = doc_position.line;
const line_mem_start = @ptrToInt(line.ptr) - @ptrToInt(document.mem.ptr);
@ -2535,13 +2533,7 @@ fn makeInnerScope(allocator: std.mem.Allocator, context: ScopeContext, node_idx:
types.MarkupContent{ .kind = .Markdown, .value = docs }
else
null;
var gop_res = try context.enums.getOrPut(allocator, .{
.label = name,
.kind = .Constant,
.insertText = name,
.insertTextFormat = .PlainText,
.documentation = doc
});
var gop_res = try context.enums.getOrPut(allocator, .{ .label = name, .kind = .Constant, .insertText = name, .insertTextFormat = .PlainText, .documentation = doc });
if (gop_res.found_existing) {
if (doc) |d| allocator.free(d.value);
}

View File

@ -33,7 +33,6 @@ pub fn edits(
var a_trim: []const u8 = a;
var b_trim: []const u8 = b;
const a_trim_offset = trim_input(&a_trim, &b_trim);
_ = a_trim_offset;
const rows = a_trim.len + 1;
const cols = b_trim.len + 1;
@ -239,8 +238,6 @@ pub fn get_changes(
var range_start = group[0].pos;
var range_len: usize = 0;
var newText = std.ArrayList(u8).init(allocator);
_ = range_start;
_ = range_len;
for (group) |ch| {
switch (ch.operation) {
.Addition => try newText.append(ch.value.?),