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()); const tracy_zone = tracy.trace(@src());
defer tracy_zone.end(); defer tracy_zone.end();
_ = server;
const decl = (try server.getSymbolGlobal(pos_index, handle)) orelse return try respondGeneric(writer, id, null_result_response); const decl = (try server.getSymbolGlobal(pos_index, handle)) orelse return try respondGeneric(writer, id, null_result_response);
return try server.hoverSymbol(writer, id, decl); 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; const DocumentPosition = offsets.DocumentPosition;
pub fn documentPositionContext(arena: *std.heap.ArenaAllocator, document: types.TextDocument, doc_position: DocumentPosition) !PositionContext { pub fn documentPositionContext(arena: *std.heap.ArenaAllocator, document: types.TextDocument, doc_position: DocumentPosition) !PositionContext {
_ = document;
const line = doc_position.line; const line = doc_position.line;
const line_mem_start = @ptrToInt(line.ptr) - @ptrToInt(document.mem.ptr); const line_mem_start = @ptrToInt(line.ptr) - @ptrToInt(document.mem.ptr);
@ -2532,16 +2530,10 @@ fn makeInnerScope(allocator: std.mem.Allocator, context: ScopeContext, node_idx:
if (container_field) |_| { if (container_field) |_| {
if (!std.mem.eql(u8, name, "_")) { if (!std.mem.eql(u8, name, "_")) {
var doc = if (try getDocComments(allocator, tree, decl, .Markdown)) |docs| var doc = if (try getDocComments(allocator, tree, decl, .Markdown)) |docs|
types.MarkupContent{ .kind = .Markdown, .value = docs } types.MarkupContent{ .kind = .Markdown, .value = docs }
else else
null; null;
var gop_res = try context.enums.getOrPut(allocator, .{ var gop_res = try context.enums.getOrPut(allocator, .{ .label = name, .kind = .Constant, .insertText = name, .insertTextFormat = .PlainText, .documentation = doc });
.label = name,
.kind = .Constant,
.insertText = name,
.insertTextFormat = .PlainText,
.documentation = doc
});
if (gop_res.found_existing) { if (gop_res.found_existing) {
if (doc) |d| allocator.free(d.value); if (doc) |d| allocator.free(d.value);
} }

View File

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