aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 16:29:24 -0400
committerGitHub <noreply@github.com>2025-09-07 16:29:24 -0400
commit7d334f6c9fff565b5d51c30e13db810f466e6241 (patch)
tree525aeac53660f83029b025c3e8c790ae77ee5d9c /src/server
parent174bf9d651a57343b87654120d6650f435bee6d9 (diff)
parent59d3d9efc70ec5530c52ac6a657c8778defd1819 (diff)
Merge pull request #981 from BradLewis/chore/improve-binary-expr-types
Improvement to resolving numeric binary expressions
Diffstat (limited to 'src/server')
-rw-r--r--src/server/analysis.odin11
-rw-r--r--src/server/hover.odin16
2 files changed, 9 insertions, 18 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 92082b5..ac3680c 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -2872,8 +2872,15 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_
return symbol_b, true
}
- if _, ok := symbol_a.value.(SymbolUntypedValue); ok {
- return symbol_b, ok_b
+ if value_a, ok := symbol_a.value.(SymbolUntypedValue); ok {
+ if value_b, ok := symbol_b.value.(SymbolUntypedValue); ok {
+ if value_a.type == .Float {
+ return symbol_a, true
+ }
+ return symbol_b, true
+ } else {
+ return symbol_b, ok_b
+ }
}
//Otherwise just choose the first type, we do not handle error cases - that is done with the checker
return symbol_a, ok_a
diff --git a/src/server/hover.odin b/src/server/hover.odin
index 4941b87..960a3a2 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -18,22 +18,6 @@ import "src:common"
write_hover_content :: proc(ast_context: ^AstContext, symbol: Symbol) -> MarkupContent {
content: MarkupContent
-
- symbol := symbol
-
- if untyped, ok := symbol.value.(SymbolUntypedValue); ok {
- switch untyped.type {
- case .String:
- symbol.signature = "string"
- case .Bool:
- symbol.signature = "bool"
- case .Float:
- symbol.signature = "float"
- case .Integer:
- symbol.signature = "int"
- }
- }
-
cat := construct_symbol_information(ast_context, symbol)
doc := construct_symbol_docs(symbol)