Skip to content

Commit 0f77926

Browse files
committed
fix: annotation offset for @export keyword
1 parent 5d4cc5c commit 0f77926

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ui/src/lib/parser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function analyzeCodeViaQuery(code) {
5252
let ispublic = false;
5353
if (code.trim().startsWith("@export")) {
5454
ispublic = true;
55-
code = code.slice(7).trim();
55+
code = code.replace("@export", " ".repeat("@export".length));
5656
}
5757
// magic commands
5858
if (code.startsWith("!")) return { ispublic, annotations };
@@ -99,7 +99,7 @@ export function analyzeCode(code) {
9999
let ispublic = false;
100100
if (code.trim().startsWith("@export")) {
101101
ispublic = true;
102-
code = code.slice(7).trim();
102+
code = code.replace("@export", " ".repeat("@export".length));
103103
}
104104
// magic commands
105105
if (code.startsWith("!")) return { ispublic, annotations };

ui/src/lib/runtime.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function rewriteCode(id: string, get: () => RepoSlice & RuntimeSlice) {
4848
let pod = pods[id];
4949
let code = pod.content;
5050
if (code.trim().startsWith("@export")) {
51-
code = code.slice(7).trim();
51+
code = code.replace("@export", " ".repeat("@export".length));
5252
}
5353
if (code.startsWith("!")) return code;
5454
// replace with symbol table

0 commit comments

Comments
 (0)