fix block label completion test

This commit is contained in:
Techatrix 2023-03-20 20:25:00 +01:00 committed by Lee Cannon
parent 84228a612e
commit 1e733a8782
2 changed files with 4 additions and 3 deletions

View File

@ -328,7 +328,9 @@ fn declToCompletion(context: DeclToCompletionContext, decl_handle: Analyser.Decl
var allocator = context.server.arena.allocator();
const tree = decl_handle.handle.tree;
switch (decl_handle.decl.*) {
const decl = decl_handle.decl.*;
switch (decl) {
.ast_node => |node| try nodeToCompletion(
context.server,
context.completions,
@ -374,7 +376,7 @@ fn declToCompletion(context: DeclToCompletionContext, decl_handle: Analyser.Decl
try context.completions.append(allocator, .{
.label = name,
.kind = .Variable,
.kind = if (decl == .label_decl) .Text else .Variable,
.insertText = name,
.insertTextFormat = .PlainText,
});

View File

@ -404,7 +404,6 @@ test "completion - usingnamespace" {
}
test "completion - block" {
if (true) return error.SkipZigTest;
try testCompletion(
\\const foo = blk: {
\\ break :<cursor>