From bf9e093d9f4f0d5aaa6cd14d751a3ba6f775bf00 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Fri, 18 Dec 2020 15:09:30 +0100 Subject: fixed crash after updating Odin --- src/server/documents.odin | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/documents.odin') diff --git a/src/server/documents.odin b/src/server/documents.odin index 7e9aa67..bf8a04f 100644 --- a/src/server/documents.odin +++ b/src/server/documents.odin @@ -386,9 +386,15 @@ parse_document :: proc(document: ^Document, config: ^common.Config) -> ([] Parse context.allocator = common.scratch_allocator(document.allocator); + //have to cheat the parser since it really wants to parse an entire package with the new changes... + pkg := new(ast.Package); + pkg.kind = .Normal; + pkg.fullpath = document.uri.path; + document.ast = ast.File { fullpath = document.uri.path, src = document.text[:document.used_text], + pkg = pkg, }; parser.parse_file(&p, &document.ast); -- cgit v1.2.3