Merge pull request #251 from rhysd/filterText-insertText-falsy
Fix falsy value for filterText and insertText
This commit is contained in:
		
						commit
						ef4a60541e
					
				@ -415,7 +415,7 @@ fn nodeToCompletion(
 | 
			
		||||
                    } else false;
 | 
			
		||||
 | 
			
		||||
                    break :blk try analysis.getFunctionSnippet(&arena.allocator, tree, func, skip_self_param);
 | 
			
		||||
                } else null;
 | 
			
		||||
                } else "";
 | 
			
		||||
 | 
			
		||||
                const is_type_function = analysis.isTypeFunction(handle.tree, func);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -230,8 +230,8 @@ pub const CompletionItem = struct {
 | 
			
		||||
    label: []const u8,
 | 
			
		||||
    kind: Kind,
 | 
			
		||||
    textEdit: ?TextEdit = null,
 | 
			
		||||
    filterText: ?[]const u8 = null,
 | 
			
		||||
    insertText: ?[]const u8 = null,
 | 
			
		||||
    filterText: []const u8 = "",
 | 
			
		||||
    insertText: []const u8 = "",
 | 
			
		||||
    insertTextFormat: ?InsertTextFormat = .PlainText,
 | 
			
		||||
    detail: ?[]const u8 = null,
 | 
			
		||||
    documentation: ?MarkupContent = null,
 | 
			
		||||
 | 
			
		||||
@ -138,7 +138,7 @@ test "Requesting a completion with no trailing whitespace" {
 | 
			
		||||
    try sendRequest(completion_req, process);
 | 
			
		||||
    try sendRequest(shutdown_message, process);
 | 
			
		||||
    try consumeOutputAndWait(process, .{
 | 
			
		||||
        \\{"jsonrpc":"2.0","id":2,"result":{"isIncomplete":false,"items":[{"label":"std","kind":21,"textEdit":null,"filterText":null,"insertText":null,"insertTextFormat":1,"detail":"const std = @import(\"std\")","documentation":null}]}}
 | 
			
		||||
        \\{"jsonrpc":"2.0","id":2,"result":{"isIncomplete":false,"items":[{"label":"std","kind":21,"textEdit":null,"filterText":"","insertText":"","insertTextFormat":1,"detail":"const std = @import(\"std\")","documentation":null}]}}
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user