aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-05-01 22:55:10 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2021-05-01 22:55:10 +0200
commit86c39dd5669b8aac89dd6237d98fcedd82d2a666 (patch)
treefa59e29ace992f84c0c9bbe0b60ac56b920d34cc /src/server/analysis.odin
parent8e07c7747d1714ddb4e235f247088c6030bd25ac (diff)
more tests + added default values in proc resolving
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 28a8249..035949e 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -2003,6 +2003,11 @@ get_locals :: proc(file: ast.File, function: ^ast.Node, ast_context: ^AstContext
using_stmt.list[0] = arg.type;
get_locals_using_stmt(using_stmt, ast_context);
}
+ } else {
+ str := common.get_ast_node_string(name, file.src);
+ store_local(ast_context, arg.default_value, name.pos.offset, str);
+ ast_context.variables[str] = true;
+ ast_context.parameters[str] = true;
}
}
}
@@ -2184,21 +2189,6 @@ get_definition_location :: proc(document: ^Document, position: common.Position)
return location, true;
}
-write_hover_content :: proc(ast_context: ^AstContext, symbol: index.Symbol) -> MarkupContent {
- content: MarkupContent;
-
- cat := concatenate_symbols_information(ast_context, symbol, false);
-
- if cat != "" {
- content.kind = "markdown";
- content.value = fmt.tprintf("```odin\n %v\n```\n%v", cat, symbol.doc);
- } else {
- content.kind = "plaintext";
- }
-
- return content;
-}
-
get_signature :: proc(ast_context: ^AstContext, ident: ast.Ident, symbol: index.Symbol, was_variable := false) -> string {
if symbol.type == .Function {
@@ -2424,6 +2414,12 @@ fallback_position_context_completion :: proc(document: ^Document, position: comm
continue;
}
+ //ignore everything in the bracket
+ if bracket_count != 0 || paren_count != 0 {
+ i -= 1;
+ continue;
+ }
+
//yeah..
if c == ' ' || c == '{' || c == ',' ||
c == '}' || c == '^' || c == ':' ||
@@ -2442,8 +2438,6 @@ fallback_position_context_completion :: proc(document: ^Document, position: comm
i -= 1;
}
- //log.error(u8(position_context.file.src[end]));
-
if i >= 0 && position_context.file.src[end] == '.' {
empty_dot = true;
end -= 1;