Added addressof, fixed slice and array completions

This commit is contained in:
Alexandros Naskos
2020-07-24 13:20:13 +03:00
parent d8510b3099
commit c09e488109
2 changed files with 52 additions and 2 deletions

View File

@@ -281,6 +281,23 @@ fn typeToCompletion(
}
},
.error_union => {},
.pointer => |n| {
if (config.operator_completions) {
try list.append(.{
.label = "*",
.kind = .Operator,
});
}
try nodeToCompletion(
arena,
list,
.{ .node = n, .handle = type_handle.handle },
null,
orig_handle,
type_handle.type.is_type_val,
config,
);
},
.other => |n| try nodeToCompletion(
arena,
list,
@@ -416,7 +433,22 @@ fn nodeToCompletion(
.detail = analysis.getContainerFieldSignature(handle.tree, field),
});
},
.ArrayType, .SliceType => {},
.SliceType => {
try list.append(.{
.label = "len",
.kind = .Field,
});
try list.append(.{
.label = "ptr",
.kind = .Field,
});
},
.ArrayType => {
try list.append(.{
.label = "len",
.kind = .Field,
});
},
.PtrType => {
if (config.operator_completions) {
try list.append(.{