From 0fc9da70bdc160ec6caf4cf5ffe50408a24d6d7a Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Sat, 30 Jul 2022 02:43:22 +0200 Subject: Fix snippet support check to handle helix editor --- src/server/completion.odin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/completion.odin b/src/server/completion.odin index dc24ac6..a3b80c1 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -431,7 +431,7 @@ get_selector_completion :: proc(ast_context: ^AstContext, position_context: ^Doc documentation = symbol.doc, } - if symbol.type == .Function { + if symbol.type == .Function && common.config.enable_snippets { item.insertText = fmt.tprintf("%v($0)", item.label) item.insertTextFormat = .Snippet item.command.command = "editor.action.triggerParameterHints" @@ -1003,7 +1003,7 @@ get_identifier_completion :: proc(ast_context: ^AstContext, position_context: ^D }) //hard code for now - top_results := combined[0:(min(50, len(combined)))] + top_results := combined[0:(min(100, len(combined)))] for result in top_results { result := result @@ -1042,7 +1042,7 @@ get_identifier_completion :: proc(ast_context: ^AstContext, position_context: ^D item.kind = cast(CompletionItemKind)result.type - if result.type == .Function { + if result.type == .Function && common.config.enable_snippets { item.insertText = fmt.tprintf("%v($0)", item.label) item.insertTextFormat = .Snippet item.deprecated = .Deprecated in result.flags -- cgit v1.2.3