fix empty comments

This commit is contained in:
SuperAuguste 2020-05-13 19:43:09 -04:00
parent bc597025e7
commit 18c026372b

View File

@ -222,11 +222,10 @@ fn publishDiagnostics(document: *types.TextDocument, config: Config) !void {
}
fn nodeToCompletion(alloc: *std.mem.Allocator, tree: *std.zig.ast.Tree, decl: *std.zig.ast.Node, config: Config) !?types.CompletionItem {
var doc_comments = try analysis.getDocComments(alloc, tree, decl);
var doc = types.MarkupContent{
var doc = if (try analysis.getDocComments(alloc, tree, decl)) |doc_comments| types.MarkupContent{
.kind = .Markdown,
.value = doc_comments orelse "",
};
.value = doc_comments,
} else null;
switch (decl.id) {
.FnProto => {