diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-11-02 15:50:11 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-11-02 15:50:11 +0100 |
| commit | b3b366132e9eb184f21007eccf58342e8e0fb2ad (patch) | |
| tree | 69bdeed63359505435ed4987c76dbaf2f7f3c044 /src/server/completion.odin | |
| parent | f2de3dd0dfe96365191e49d233d145a3b49ee41c (diff) | |
Prevent completion in basic literals
Diffstat (limited to 'src/server/completion.odin')
| -rw-r--r-- | src/server/completion.odin | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin index 59e762c..f046815 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -100,7 +100,7 @@ get_completion_list :: proc( if position_context.import_stmt != nil { completion_type = .Package } - + done: if position_context.switch_type_stmt != nil && position_context.case_clause != nil { @@ -126,6 +126,13 @@ get_completion_list :: proc( } } + //Currently we do not do any completion in string literals, but it could be possible in the future for formatted strings + if position_context.basic_lit != nil { + if _, ok := position_context.basic_lit.derived.(^ast.Basic_Lit); ok { + return list, true + } + } + switch completion_type { case .Comp_Lit: get_comp_lit_completion(&ast_context, &position_context, &list) @@ -1035,8 +1042,8 @@ get_identifier_completion :: proc( if position_context.identifier != nil { if ident, ok := position_context.identifier.derived.(^ast.Ident); ok { lookup_name = ident.name - } - } + } + } pkgs := make([dynamic]string, context.temp_allocator) |