aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2021-03-30 23:04:55 +0200
committerDanielGavin <danielgavin5@hotmail.com>2021-03-30 23:04:55 +0200
commitcf2e2cc7e8cafd5f517a200fcc7a9407b4e250ea (patch)
tree58153f490a1dc8769c538d1d652eaa6fab233b73 /src/server
parent4fd0aff346169c24be6c65cf8b439952d42c82d1 (diff)
no completion in comments
Diffstat (limited to 'src/server')
-rw-r--r--src/server/analysis.odin9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 78c4329..3fd6a56 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -2049,17 +2049,24 @@ get_document_position_context :: proc(document: ^Document, position: common.Posi
position_context.position = absolute_position;
+ exists_in_decl := false;
+
for decl in document.ast.decls {
if position_in_node(decl, position_context.position) {
get_document_position(decl, &position_context);
-
+ exists_in_decl = true;
switch v in decl.derived {
case ast.Expr_Stmt:
position_context.global_lhs_stmt = true;
}
+ break;
}
}
+ if !exists_in_decl {
+ position_context.abort_completion = true;
+ }
+
if !position_in_node(position_context.comp_lit, position_context.position) {
position_context.comp_lit = nil;
}