Skip to content

Commit 37b6553

Browse files
committed
Fix local identifier lookup and upgrade OScript parser and walker
1 parent 986a235 commit 37b6553

File tree

9 files changed

+89
-67
lines changed

9 files changed

+89
-67
lines changed

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
1414
"sourceMaps": true,
1515
"outFiles": ["${workspaceRoot}/dist/extension.js"]
16+
},
17+
{
18+
"name": "Launch Server",
19+
"type": "node",
20+
"request": "launch",
21+
"program": "${workspaceRoot}/dist/server.js",
22+
"args": ["--nolazy", "--inspect=6009"],
23+
"sourceMaps": true,
24+
"outFiles": ["${workspaceRoot}/dist/server.js"]
1625
},
1726
{
1827
"name": "Attach to Server",

package-lock.json

Lines changed: 47 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-oscript",
33
"displayName": "OScript Language",
44
"description": "Provides syntax checking and fixing, highlighting, autocompletion, hints, symbol outline, identifier recognition and renaming and other features for the OScript language in Visual Studio Code.",
5-
"version": "0.2.3",
5+
"version": "0.2.4",
66
"icon": "doc/logo.png",
77
"publisher": "prantlf",
88
"author": {
@@ -218,13 +218,13 @@
218218
"@rollup/plugin-commonjs": "17.0.0",
219219
"@rollup/plugin-node-resolve": "11.0.1",
220220
"@rollup/plugin-sucrase": "3.1.0",
221-
"@types/node": "14.14.19",
221+
"@types/node": "14.14.20",
222222
"@types/vscode": "1.52.0",
223-
"@typescript-eslint/eslint-plugin": "4.11.1",
224-
"@typescript-eslint/parser": "4.11.1",
223+
"@typescript-eslint/eslint-plugin": "4.12.0",
224+
"@typescript-eslint/parser": "4.12.0",
225225
"eslint": "7.17.0",
226226
"js-yaml": "4.0.0",
227-
"rollup": "2.35.1",
227+
"rollup": "2.36.1",
228228
"rollup-plugin-terser": "7.0.2",
229229
"typescript": "4.1.3",
230230
"yaml-lint": "1.2.4"

pkg/api/package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/examples/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"editor.tabSize": 4,
77
"editor.insertSpaces": false,
88
"editor.detectIndentation": false
9-
}
9+
},
10+
"oscript.logging.level": "debug"
1011
}

pkg/examples/object.os

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ public object Document inherits CORE::Node
88
DAPINODE node = DAPI.GetNodeByID(id, workspace, FALSE)
99
if !IsError(node) and node.pSubType == $Document
1010
return node
11+
elseif IsError(node)
12+
.Clear()
13+
return Error(1)
14+
else
15+
;
1116
end
1217
end
1318

@@ -16,6 +21,14 @@ public object Document inherits CORE::Node
1621
Object item
1722

1823
for item in cached
24+
switch item.type
25+
case 144
26+
break
27+
end
28+
default
29+
;
30+
end
31+
end
1932
end
2033

2134
function List GetCache()

pkg/server/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/server/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oscript-language-server",
3-
"description": "Syntax checking, highlighting, hover hints and other support for the OScript language in Visual Studio Code.",
4-
"version": "0.0.3",
3+
"description": "A language server for the OScript language.",
4+
"version": "0.0.5",
55
"author": {
66
"name": "Ferdinand Prantl",
77
"email": "prantlf@gmail.com",
@@ -34,8 +34,8 @@
3434
],
3535
"devDependencies": {
3636
"@rollup/plugin-yaml": "3.0.0",
37-
"oscript-ast-walker": "0.0.1",
38-
"oscript-parser": "0.2.2",
37+
"oscript-ast-walker": "0.0.2",
38+
"oscript-parser": "0.2.3",
3939
"rollup-plugin-copy": "3.3.0",
4040
"vscode-languageserver": "7.0.0",
4141
"vscode-languageserver-textdocument": "1.0.1"

pkg/server/src/language/locals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function findLocalsInScope (scope: any, node: any): { node: Node, parent:
1515
// Skip the scope itself, if it has accidentally the same name. Also,
1616
// skip nested scopes, if they contain a local declaration using the
1717
// same identifier value.
18-
if (scope !== node && !ignoreScope &&
18+
if (scope !== parent && !ignoreScope &&
1919
mayComeFromVariable(node, parent) && node.value === value) {
2020
results.push({ node, parent })
2121
}

0 commit comments

Comments
 (0)