Fixed goto import, preparing for hover impl

This commit is contained in:
Alexandros Naskos
2020-05-26 00:37:18 +03:00
parent 754a982be2
commit 48ad1eccbf
2 changed files with 80 additions and 35 deletions

View File

@@ -742,8 +742,9 @@ pub fn getImportStr(tree: *ast.Tree, source_index: usize) ?[]const u8 {
var node = &tree.root_node.base;
var child_idx: usize = 0;
while (node.iterate(child_idx)) |child| : (child_idx += 1) {
while (node.iterate(child_idx)) |child| {
if (!nodeContainsSourceIndex(tree, child, source_index)) {
child_idx += 1;
continue;
}
if (child.cast(ast.Node.BuiltinCall)) |builtin_call| blk: {