diff --git a/src/analysis.zig b/src/analysis.zig index 20887fb..3575da3 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -993,6 +993,9 @@ pub fn declsFromIndexInternal( try declsFromIndexInternal(arena, decls, tree, child, source_index, innermost_container); } } + }, + .Use => { + }, else => {}, } diff --git a/src/main.zig b/src/main.zig index f556c53..e993f38 100644 --- a/src/main.zig +++ b/src/main.zig @@ -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); }