aboutsummaryrefslogtreecommitdiff
path: root/src/server/completion.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2021-03-30 03:24:55 +0200
committerDanielGavin <danielgavin5@hotmail.com>2021-03-30 03:24:55 +0200
commit1c5599f44562a6ee1cd6abe03fd764e8efcd4f11 (patch)
tree5f748ebd0efdefe5e6cfbcd89451a64ba0596e68 /src/server/completion.odin
parent981e04ffdb15be4e6027445d964e347b7c10ede1 (diff)
experiment with more context based completion + fix no signature on proc
Diffstat (limited to 'src/server/completion.odin')
-rw-r--r--src/server/completion.odin12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index f04b79d..9e64696 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -806,6 +806,10 @@ get_identifier_completion :: proc(ast_context: ^AstContext, position_context: ^D
global: for k, v in ast_context.globals {
+ if position_context.global_lhs_stmt {
+ break;
+ }
+
//combined is sorted and should do binary search instead.
for result in combined {
if result.symbol.name == k {
@@ -832,6 +836,10 @@ get_identifier_completion :: proc(ast_context: ^AstContext, position_context: ^D
for k, v in ast_context.locals {
+ if position_context.global_lhs_stmt {
+ break;
+ }
+
ast_context.use_locals = true;
ast_context.use_globals = true;
ast_context.current_package = ast_context.document_package;
@@ -851,6 +859,10 @@ get_identifier_completion :: proc(ast_context: ^AstContext, position_context: ^D
for pkg in ast_context.imports {
+ if position_context.global_lhs_stmt {
+ break;
+ }
+
symbol := index.Symbol {
name = pkg.base,
type = .Package,