From c895d7d8f62ec38f672a20353f02398219eb35a7 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Sat, 23 May 2020 02:58:39 +0300 Subject: [PATCH] Go to definition now works for captures --- src/analysis.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/analysis.zig b/src/analysis.zig index 87d6b0a..ec858de 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -200,6 +200,11 @@ pub fn getDeclNameToken(tree: *ast.Tree, node: *ast.Node) ?ast.TokenIndex { const field = node.cast(ast.Node.ContainerField).?; return field.name_token; }, + // We need identifier for captures + .Identifier => { + const ident = node.cast(ast.Node.Identifier).?; + return ident.token; + }, else => {}, }