preamble to usingnamespace

This commit is contained in:
SuperAuguste 2020-06-08 23:21:55 -04:00
parent 20434839f1
commit 3c2c1e97ed
2 changed files with 20 additions and 0 deletions

View File

@ -993,6 +993,9 @@ pub fn declsFromIndexInternal(
try declsFromIndexInternal(arena, decls, tree, child, source_index, innermost_container);
}
}
},
.Use => {
},
else => {},
}

View File

@ -92,6 +92,18 @@ fn respondGeneric(id: types.RequestId, response: []const u8) !void {
try stdout.flush();
}
fn showMessage(@"type": types.MessageType, message: []const u8) !void {
try send(types.Notification{
.method = "window/showMessage",
.params = .{
.ShowMessageParams = .{
.@"type" = @"type",
.message = message
},
},
});
}
// TODO: Is this correct or can we get a better end?
fn astLocationToRange(loc: std.zig.ast.Tree.Location) types.Range {
return .{
@ -528,6 +540,11 @@ fn completeGlobal(id: types.RequestId, pos_index: usize, handle: *DocumentStore.
var analysis_ctx = try document_store.analysisContext(handle, &arena, pos_index, config.zig_lib_path);
for (analysis_ctx.scope_nodes) |decl_ptr| {
var decl = decl_ptr.*;
if (decl.id == .Use) {
std.debug.warn("Found use!", .{});
continue;
}
try nodeToCompletion(&completions, &analysis_ctx, handle, decl_ptr, config);
}