aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-06-28 22:43:40 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-06-28 22:43:40 +0200
commit352221c8688e47364b0fa6c4e436f3e0a2dfc131 (patch)
treec1790c1c1a3c973bcc85138effcb4ecfc314454b /src/server
parent23386134013425a47fbfe43928d16f1420b55bfa (diff)
odinfmt: fix proc tags being printed
Diffstat (limited to 'src/server')
-rw-r--r--src/server/analysis.odin12
-rw-r--r--src/server/format.odin7
2 files changed, 16 insertions, 3 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 5c40e7e..c22c1e8 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1785,8 +1785,18 @@ make_symbol_union_from_ast :: proc(ast_context: ^AstContext, v: ast.Union_Type,
symbol.name = "union"
}
+ types := make([dynamic]^ast.Expr, ast_context.allocator)
+
+ for variant in v.variants {
+ if v.poly_params != nil {
+ append(&types, clone_type(variant, ast_context.allocator, nil))
+ } else {
+ append(&types, variant)
+ }
+ }
+
symbol.value = SymbolUnionValue {
- types = v.variants,
+ types = types[:],
}
if v.poly_params != nil {
diff --git a/src/server/format.odin b/src/server/format.odin
index 0035545..219d7d9 100644
--- a/src/server/format.odin
+++ b/src/server/format.odin
@@ -1,9 +1,10 @@
package server
import "shared:common"
-
import "shared:odin/printer"
+import "core:log"
+
FormattingOptions :: struct {
tabSize: uint,
insertSpaces: bool, //tabs or spaces
@@ -41,7 +42,9 @@ get_complete_format :: proc(document: ^common.Document, config: ^common.Config)
src := printer.print(&prnt, &document.ast)
- end_line := 0
+ log.error(src)
+
+ end_line := 0
end_charcter := 0
last := document.text[0]