From 98a6955271890e2e025e78d48750fa6759abd4dc Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:45:09 +0800 Subject: [PATCH] fix: expression context check issue on initial loading --- .vscode/launch.json | 21 --------------------- packages/sdk/src/utils.ts | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 193903fc4..18b3b5721 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,20 +5,6 @@ { "version": "0.2.0", "configurations": [ - { - "name": "Generate for Todo Sample", - "program": "${workspaceFolder}/packages/schema/dist/bin/cli", - "cwd": "${workspaceFolder}/samples/todo/", - "args": [ - "generate" - ], - "request": "launch", - "skipFiles": ["/**"], - "type": "node", - "env": { - "NODE_PATH": "${workspaceFolder}/samples/todo/node_modules" - } - }, { "name": "Attach", "port": 9229, @@ -42,13 +28,6 @@ "skipFiles": ["/**"], "sourceMaps": true, "outFiles": ["${workspaceFolder}/packages/schema/bundle/**/*.js"] - }, - { - "name": "Todo sample: debug server-side", - "type": "node-terminal", - "request": "launch", - "command": "pnpm dev", - "cwd": "${workspaceFolder}/samples/todo/" } ] } diff --git a/packages/sdk/src/utils.ts b/packages/sdk/src/utils.ts index 3b26c01f1..edd0fa84e 100644 --- a/packages/sdk/src/utils.ts +++ b/packages/sdk/src/utils.ts @@ -227,7 +227,7 @@ export function getFunctionExpressionContext(funcDecl: FunctionDecl) { const funcAllowedContext: ExpressionContext[] = []; const funcAttr = funcDecl.attributes.find((attr) => attr.decl.$refText === '@@@expressionContext'); if (funcAttr) { - const contextArg = getAttributeArg(funcAttr, 'context'); + const contextArg = funcAttr.args[0].value; if (isArrayExpr(contextArg)) { contextArg.items.forEach((item) => { if (isEnumFieldReference(item)) {