From 33f03d36a54f2e65561b4d826c3b8914800b7a24 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Mon, 5 Apr 2021 22:25:11 +0800 Subject: [PATCH] completion: Add `insertText` field for enum completions Another bug with the older version of lsp-mode on Emacs prevents the label from being inserted when there is an empty `insertText`. This commit adds an `insertText` property to enum completions for consistency with the rest of the completion items. --- src/analysis.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/analysis.zig b/src/analysis.zig index 13b00af..cb5dbf8 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -2672,6 +2672,8 @@ fn makeScopeInternal( try enum_completions.put(allocator, .{ .label = name, .kind = .Constant, + .insertText = name, + .insertTextFormat = .PlainText, .documentation = if (try getDocComments(allocator, tree, decl, .Markdown)) |docs| .{ .kind = .Markdown, .value = docs,