Skip to content

Commit 05b5554

Browse files
authored
fix: expression context check issue on initial loading (#544)
1 parent 1036719 commit 05b5554

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

.vscode/launch.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,6 @@
55
{
66
"version": "0.2.0",
77
"configurations": [
8-
{
9-
"name": "Generate for Todo Sample",
10-
"program": "${workspaceFolder}/packages/schema/dist/bin/cli",
11-
"cwd": "${workspaceFolder}/samples/todo/",
12-
"args": [
13-
"generate"
14-
],
15-
"request": "launch",
16-
"skipFiles": ["<node_internals>/**"],
17-
"type": "node",
18-
"env": {
19-
"NODE_PATH": "${workspaceFolder}/samples/todo/node_modules"
20-
}
21-
},
228
{
239
"name": "Attach",
2410
"port": 9229,
@@ -42,13 +28,6 @@
4228
"skipFiles": ["<node_internals>/**"],
4329
"sourceMaps": true,
4430
"outFiles": ["${workspaceFolder}/packages/schema/bundle/**/*.js"]
45-
},
46-
{
47-
"name": "Todo sample: debug server-side",
48-
"type": "node-terminal",
49-
"request": "launch",
50-
"command": "pnpm dev",
51-
"cwd": "${workspaceFolder}/samples/todo/"
5231
}
5332
]
5433
}

packages/sdk/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export function getFunctionExpressionContext(funcDecl: FunctionDecl) {
227227
const funcAllowedContext: ExpressionContext[] = [];
228228
const funcAttr = funcDecl.attributes.find((attr) => attr.decl.$refText === '@@@expressionContext');
229229
if (funcAttr) {
230-
const contextArg = getAttributeArg(funcAttr, 'context');
230+
const contextArg = funcAttr.args[0].value;
231231
if (isArrayExpr(contextArg)) {
232232
contextArg.items.forEach((item) => {
233233
if (isEnumFieldReference(item)) {

0 commit comments

Comments
 (0)