Skip to content

Commit 2119957

Browse files
committed
v0.1.9 - hotfix
1 parent 2328786 commit 2119957

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "For Modpack makers.",
55
"repository": "https://github.com/Yesterday17/ZenScript",
66
"license": "MIT",
7-
"version": "0.1.8",
7+
"version": "0.1.9",
88
"publisher": "yesterday17",
99
"engines": {
1010
"vscode": "^1.30.0"

server/server.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,19 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
196196
const ast: ASTNodeProgram = ZSInterpreter.visit(
197197
documentCSTs.get(textDocument.uri)
198198
);
199-
connection.console.log(
200-
JSON.stringify({
201-
type: ast.type,
202-
import: ast.import,
203-
global: Array.from(ast.global),
204-
static: Array.from(ast.static),
205-
function: Array.from(ast.function),
206-
error: ast.errors,
207-
})
208-
);
199+
200+
if (ast) {
201+
connection.console.log(
202+
JSON.stringify({
203+
type: ast.type,
204+
import: ast.import,
205+
global: Array.from(ast.global),
206+
static: Array.from(ast.static),
207+
function: Array.from(ast.function),
208+
error: ast.errors,
209+
})
210+
);
211+
}
209212

210213
// save errors
211214
ZSParser.errors.map(error => {

0 commit comments

Comments
 (0)