From 0d85668ce471ffa7db1ab96330ead6f325ea9c45 Mon Sep 17 00:00:00 2001 From: Luuk de Gram Date: Fri, 12 Mar 2021 11:56:51 +0100 Subject: [PATCH] Do not offer completion for function labels --- src/analysis.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index f4e697e..435814d 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -1285,9 +1285,13 @@ pub fn getFieldAccessType( .period => { const after_period = tokenizer.next(); switch (after_period.tag) { - .eof => return FieldAccessReturn{ - .original = current_type, - .unwrapped = try resolveDerefType(store, arena, current_type, &bound_type_params), + .eof => { + // function labels cannot be dot accessed + if (current_type.isFunc()) return null; + return FieldAccessReturn{ + .original = current_type, + .unwrapped = try resolveDerefType(store, arena, current_type, &bound_type_params), + }; }, .identifier => { if (after_period.loc.end == tokenizer.buffer.len) {