diff --git a/.changeset/stale-birds-win.md b/.changeset/stale-birds-win.md new file mode 100644 index 00000000..8422e278 --- /dev/null +++ b/.changeset/stale-birds-win.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": minor +--- + +feat: support latest runes (`$props.id` and `$inspect.trace`) diff --git a/src/parser/typescript/analyze/index.ts b/src/parser/typescript/analyze/index.ts index d70cdbe7..b6de0a9b 100644 --- a/src/parser/typescript/analyze/index.ts +++ b/src/parser/typescript/analyze/index.ts @@ -391,7 +391,7 @@ function analyzeRuneVariables( continue; } switch (globalName) { - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2299 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L2679 case "$state": { appendDeclareFunctionVirtualScripts(globalName, [ "(initial: T): T", @@ -407,7 +407,7 @@ function analyzeRuneVariables( break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2453 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L2833 case "$derived": { appendDeclareFunctionVirtualScripts(globalName, [ "(expression: T): T", @@ -417,7 +417,7 @@ function analyzeRuneVariables( ]); break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2513 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L2893 case "$effect": { appendDeclareFunctionVirtualScripts(globalName, [ "(fn: () => void | (() => void)): void", @@ -429,27 +429,33 @@ function analyzeRuneVariables( ]); break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2615 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L2997 case "$props": { // Use type parameters to avoid `@typescript-eslint/no-unsafe-assignment` errors. appendDeclareFunctionVirtualScripts(globalName, ["(): T"]); + appendDeclareNamespaceVirtualScripts(globalName, [ + "export function id(): string;", + ]); break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2626 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L3038 case "$bindable": { appendDeclareFunctionVirtualScripts(globalName, [ "(fallback?: T): T", ]); break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2646 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L3081 case "$inspect": { appendDeclareFunctionVirtualScripts(globalName, [ `(...values: T): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void }`, ]); + appendDeclareNamespaceVirtualScripts(globalName, [ + "export function trace(name?: string): void;", + ]); break; } - // See https://github.com/sveltejs/svelte/blob/41b5cd6f5daae3970a9927e062f42b6b62440d16/packages/svelte/types/index.d.ts#L2669 + // See https://github.com/sveltejs/svelte/blob/3c4a8d425b8192dc11ea2af256d531c51c37ba5d/packages/svelte/types/index.d.ts#L3144 case "$host": { appendDeclareFunctionVirtualScripts(globalName, [ `(): El`, diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-input.svelte b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-input.svelte new file mode 100644 index 00000000..06390326 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-input.svelte @@ -0,0 +1,11 @@ + + +
+ + + + + +
diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-output.json new file mode 100644 index 00000000..c3f430a1 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-output.json @@ -0,0 +1,3007 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 30, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "range": [ + 23, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "optional": false, + "range": [ + 23, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "range": [ + 17, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "range": [ + 11, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 26 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 36, + 45 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 45 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 45, + 47 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "form", + "range": [ + 48, + 52 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 5 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 53, + 56 + ], + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 6, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "label", + "range": [ + 57, + 62 + ], + "loc": { + "start": { + "line": 6, + "column": 3 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "for", + "range": [ + 63, + 66 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 69, + 72 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "range": [ + 68, + 73 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-firstname", + "range": [ + 73, + 83 + ], + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 29 + } + } + } + ], + "range": [ + 63, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "selfClosing": false, + "range": [ + 56, + 85 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "First Name: ", + "range": [ + 85, + 97 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 43 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 97, + 105 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + "range": [ + 56, + 105 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 105, + 108 + ], + "loc": { + "start": { + "line": 6, + "column": 51 + }, + "end": { + "line": 7, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 109, + 114 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "id", + "range": [ + 115, + 117 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 120, + 123 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "range": [ + 119, + 124 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-firstname", + "range": [ + 124, + 134 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 28 + } + } + } + ], + "range": [ + 115, + 135 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "type", + "range": [ + 136, + 140 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 34 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 142, + 146 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 40 + } + } + } + ], + "range": [ + 136, + 147 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 41 + } + } + } + ], + "selfClosing": true, + "range": [ + 108, + 150 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 108, + 150 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n ", + "range": [ + 150, + 154 + ], + "loc": { + "start": { + "line": 7, + "column": 44 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "label", + "range": [ + 155, + 160 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "for", + "range": [ + 161, + 164 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 167, + 170 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "range": [ + 166, + 171 + ], + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 19 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-lastname", + "range": [ + 171, + 180 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + } + } + ], + "range": [ + 161, + 181 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 29 + } + } + } + ], + "selfClosing": false, + "range": [ + 154, + 182 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "Last Name: ", + "range": [ + 182, + 193 + ], + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 193, + 201 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + "range": [ + 154, + 201 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 201, + 204 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "id", + "range": [ + 211, + 213 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 216, + 219 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "range": [ + 215, + 220 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-lastname", + "range": [ + 220, + 229 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + } + } + ], + "range": [ + 211, + 230 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 28 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "type", + "range": [ + 231, + 235 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 237, + 241 + ], + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 39 + } + } + } + ], + "range": [ + 231, + 242 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 40 + } + } + } + ], + "selfClosing": true, + "range": [ + 204, + 245 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 204, + 245 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 10, + "column": 43 + }, + "end": { + "line": 11, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 7 + } + } + }, + "range": [ + 47, + 253 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 11, + "column": 7 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 11, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 21, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 29, + 30 + ], + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + { + "type": "Identifier", + "value": "id", + "range": [ + 30, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 32, + 33 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 33, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 34, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 36, + 37 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 37, + 38 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 38, + 44 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 44, + 45 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 45, + 47 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 47, + 48 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "form", + "range": [ + 48, + 52 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 52, + 53 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 53, + 56 + ], + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 6, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 56, + 57 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 57, + 62 + ], + "loc": { + "start": { + "line": 6, + "column": 3 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "for", + "range": [ + 63, + 66 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 66, + 67 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 67, + 68 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 68, + 69 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 69, + 72 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 72, + 73 + ], + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "-firstname", + "range": [ + 73, + 83 + ], + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 83, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 84, + 85 + ], + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + { + "type": "HTMLText", + "value": "First", + "range": [ + 85, + 90 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 90, + 91 + ], + "loc": { + "start": { + "line": 6, + "column": 36 + }, + "end": { + "line": 6, + "column": 37 + } + } + }, + { + "type": "HTMLText", + "value": "Name:", + "range": [ + 91, + 96 + ], + "loc": { + "start": { + "line": 6, + "column": 37 + }, + "end": { + "line": 6, + "column": 42 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 96, + 97 + ], + "loc": { + "start": { + "line": 6, + "column": 42 + }, + "end": { + "line": 6, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 44 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 98, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 44 + }, + "end": { + "line": 6, + "column": 45 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 99, + 104 + ], + "loc": { + "start": { + "line": 6, + "column": 45 + }, + "end": { + "line": 6, + "column": 50 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 104, + 105 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 105, + 108 + ], + "loc": { + "start": { + "line": 6, + "column": 51 + }, + "end": { + "line": 7, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 109, + 114 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "id", + "range": [ + 115, + 117 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 117, + 118 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 118, + 119 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 119, + 120 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 120, + 123 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 123, + 124 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "-firstname", + "range": [ + 124, + 134 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 134, + 135 + ], + "loc": { + "start": { + "line": 7, + "column": 28 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "type", + "range": [ + 136, + 140 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 141, + 142 + ], + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 36 + } + } + }, + { + "type": "HTMLText", + "value": "text", + "range": [ + 142, + 146 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 146, + 147 + ], + "loc": { + "start": { + "line": 7, + "column": 40 + }, + "end": { + "line": 7, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 148, + 149 + ], + "loc": { + "start": { + "line": 7, + "column": 42 + }, + "end": { + "line": 7, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 149, + 150 + ], + "loc": { + "start": { + "line": 7, + "column": 43 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n ", + "range": [ + 150, + 154 + ], + "loc": { + "start": { + "line": 7, + "column": 44 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 154, + 155 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 155, + 160 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "for", + "range": [ + 161, + 164 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 164, + 165 + ], + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 165, + 166 + ], + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 166, + 167 + ], + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 167, + 170 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 170, + 171 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "-lastname", + "range": [ + 171, + 180 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 180, + 181 + ], + "loc": { + "start": { + "line": 9, + "column": 28 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 181, + 182 + ], + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "Last", + "range": [ + 182, + 186 + ], + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 34 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 186, + 187 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "Name:", + "range": [ + 187, + 192 + ], + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 40 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 193, + 194 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 194, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 42 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 195, + 200 + ], + "loc": { + "start": { + "line": 9, + "column": 43 + }, + "end": { + "line": 9, + "column": 48 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 200, + 201 + ], + "loc": { + "start": { + "line": 9, + "column": 48 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 201, + 204 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "id", + "range": [ + 211, + 213 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 213, + 214 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 214, + 215 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 215, + 216 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 216, + 219 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 219, + 220 + ], + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "-lastname", + "range": [ + 220, + 229 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 229, + 230 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 28 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "type", + "range": [ + 231, + 235 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 235, + 236 + ], + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 236, + 237 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "text", + "range": [ + 237, + 241 + ], + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 241, + 242 + ], + "loc": { + "start": { + "line": 10, + "column": 39 + }, + "end": { + "line": 10, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 243, + 244 + ], + "loc": { + "start": { + "line": 10, + "column": 41 + }, + "end": { + "line": 10, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 244, + 245 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 10, + "column": 43 + }, + "end": { + "line": 11, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 246, + 247 + ], + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 247, + 248 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "form", + "range": [ + 248, + 252 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 252, + 253 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + } + } + ], + "range": [ + 0, + 254 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 12, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-scope-output.json new file mode 100644 index 00000000..98faf852 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-scope-output.json @@ -0,0 +1,706 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "uid", + "identifiers": [ + { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 30, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "range": [ + 23, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "optional": false, + "range": [ + 23, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "range": [ + 17, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 69, + 72 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 120, + 123 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 167, + 170 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 216, + 219 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 69, + 72 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 120, + 123 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 167, + 170 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 216, + 219 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "range": [ + 17, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-input.svelte new file mode 100644 index 00000000..3594fec0 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-input.svelte @@ -0,0 +1,11 @@ + + +
+ + + + + +
diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-output.json new file mode 100644 index 00000000..99500d66 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-output.json @@ -0,0 +1,3224 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 48, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 41, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 27, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 33 + } + } + } + ], + "range": [ + 21, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 34 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 54, + 63 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 63 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 63, + 65 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "form", + "range": [ + 66, + 70 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 5 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 65, + 71 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 71, + 74 + ], + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 6, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "label", + "range": [ + 75, + 80 + ], + "loc": { + "start": { + "line": 6, + "column": 3 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "for", + "range": [ + 81, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 87, + 90 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "range": [ + 86, + 91 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-firstname", + "range": [ + 91, + 101 + ], + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 29 + } + } + } + ], + "range": [ + 81, + 102 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "selfClosing": false, + "range": [ + 74, + 103 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "First Name: ", + "range": [ + 103, + 115 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 43 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 115, + 123 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + "range": [ + 74, + 123 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 123, + 126 + ], + "loc": { + "start": { + "line": 6, + "column": 51 + }, + "end": { + "line": 7, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 127, + 132 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "id", + "range": [ + 133, + 135 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 138, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "range": [ + 137, + 142 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-firstname", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 28 + } + } + } + ], + "range": [ + 133, + 153 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "type", + "range": [ + 154, + 158 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 34 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 160, + 164 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 40 + } + } + } + ], + "range": [ + 154, + 165 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 41 + } + } + } + ], + "selfClosing": true, + "range": [ + 126, + 168 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 126, + 168 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n ", + "range": [ + 168, + 172 + ], + "loc": { + "start": { + "line": 7, + "column": 44 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "label", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "for", + "range": [ + 179, + 182 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "range": [ + 184, + 189 + ], + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 19 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-lastname", + "range": [ + 189, + 198 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + } + } + ], + "range": [ + 179, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 29 + } + } + } + ], + "selfClosing": false, + "range": [ + 172, + 200 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "Last Name: ", + "range": [ + 200, + 211 + ], + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 211, + 219 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + "range": [ + 172, + 219 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 219, + 222 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 223, + 228 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "id", + "range": [ + 229, + 231 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "uid", + "range": [ + 234, + 237 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "range": [ + 233, + 238 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "SvelteLiteral", + "value": "-lastname", + "range": [ + 238, + 247 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + } + } + ], + "range": [ + 229, + 248 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 28 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "type", + "range": [ + 249, + 253 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 255, + 259 + ], + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 39 + } + } + } + ], + "range": [ + 249, + 260 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 40 + } + } + } + ], + "selfClosing": true, + "range": [ + 222, + 263 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 222, + 263 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 263, + 264 + ], + "loc": { + "start": { + "line": 10, + "column": 43 + }, + "end": { + "line": 11, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 264, + 271 + ], + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 7 + } + } + }, + "range": [ + 65, + 271 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 11, + "column": 7 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 21, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 27, + 30 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 30, + 31 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "string", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 39, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 47, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Identifier", + "value": "id", + "range": [ + 48, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 50, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 51, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 52, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 54, + 55 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 62, + 63 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 63, + 65 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 65, + 66 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "form", + "range": [ + 66, + 70 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 70, + 71 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 71, + 74 + ], + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 6, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 74, + 75 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 75, + 80 + ], + "loc": { + "start": { + "line": 6, + "column": 3 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "for", + "range": [ + 81, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 84, + 85 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 85, + 86 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 86, + 87 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 87, + 90 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 90, + 91 + ], + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "-firstname", + "range": [ + 91, + 101 + ], + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 101, + 102 + ], + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 102, + 103 + ], + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + { + "type": "HTMLText", + "value": "First", + "range": [ + 103, + 108 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 36 + }, + "end": { + "line": 6, + "column": 37 + } + } + }, + { + "type": "HTMLText", + "value": "Name:", + "range": [ + 109, + 114 + ], + "loc": { + "start": { + "line": 6, + "column": 37 + }, + "end": { + "line": 6, + "column": 42 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 114, + 115 + ], + "loc": { + "start": { + "line": 6, + "column": 42 + }, + "end": { + "line": 6, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 115, + 116 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 44 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 116, + 117 + ], + "loc": { + "start": { + "line": 6, + "column": 44 + }, + "end": { + "line": 6, + "column": 45 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 117, + 122 + ], + "loc": { + "start": { + "line": 6, + "column": 45 + }, + "end": { + "line": 6, + "column": 50 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 122, + 123 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, + "end": { + "line": 6, + "column": 51 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 123, + 126 + ], + "loc": { + "start": { + "line": 6, + "column": 51 + }, + "end": { + "line": 7, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 126, + 127 + ], + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 127, + 132 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "id", + "range": [ + 133, + 135 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 135, + 136 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 136, + 137 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 137, + 138 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 138, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 141, + 142 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "-firstname", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 152, + 153 + ], + "loc": { + "start": { + "line": 7, + "column": 28 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "type", + "range": [ + 154, + 158 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 158, + 159 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 159, + 160 + ], + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 36 + } + } + }, + { + "type": "HTMLText", + "value": "text", + "range": [ + 160, + 164 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 164, + 165 + ], + "loc": { + "start": { + "line": 7, + "column": 40 + }, + "end": { + "line": 7, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 166, + 167 + ], + "loc": { + "start": { + "line": 7, + "column": 42 + }, + "end": { + "line": 7, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 167, + 168 + ], + "loc": { + "start": { + "line": 7, + "column": 43 + }, + "end": { + "line": 7, + "column": 44 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n ", + "range": [ + 168, + 172 + ], + "loc": { + "start": { + "line": 7, + "column": 44 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 172, + 173 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "for", + "range": [ + 179, + 182 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 182, + 183 + ], + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 183, + 184 + ], + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 184, + 185 + ], + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 188, + 189 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "-lastname", + "range": [ + 189, + 198 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 198, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 28 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 199, + 200 + ], + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "Last", + "range": [ + 200, + 204 + ], + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 34 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "Name:", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 40 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 210, + 211 + ], + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 211, + 212 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 212, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 42 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "label", + "range": [ + 213, + 218 + ], + "loc": { + "start": { + "line": 9, + "column": 43 + }, + "end": { + "line": 9, + "column": 48 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 218, + 219 + ], + "loc": { + "start": { + "line": 9, + "column": 48 + }, + "end": { + "line": 9, + "column": 49 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 219, + 222 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 222, + 223 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 223, + 228 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "id", + "range": [ + 229, + 231 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 231, + 232 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 232, + 233 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 233, + 234 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "uid", + "range": [ + 234, + 237 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 237, + 238 + ], + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "-lastname", + "range": [ + 238, + 247 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 247, + 248 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 28 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "type", + "range": [ + 249, + 253 + ], + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 253, + 254 + ], + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 254, + 255 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "text", + "range": [ + 255, + 259 + ], + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 259, + 260 + ], + "loc": { + "start": { + "line": 10, + "column": 39 + }, + "end": { + "line": 10, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 261, + 262 + ], + "loc": { + "start": { + "line": 10, + "column": 41 + }, + "end": { + "line": 10, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 262, + 263 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 263, + 264 + ], + "loc": { + "start": { + "line": 10, + "column": 43 + }, + "end": { + "line": 11, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 264, + 265 + ], + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 265, + 266 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "form", + "range": [ + 266, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 270, + 271 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + } + } + ], + "range": [ + 0, + 272 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 12, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-scope-output.json new file mode 100644 index 00000000..958f7d7c --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-id-ts-scope-output.json @@ -0,0 +1,1216 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "uid", + "identifiers": [ + { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 48, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 41, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 27, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 33 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 87, + 90 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 138, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 234, + 237 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 87, + 90 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 138, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "uid", + "range": [ + 234, + 237 + ], + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "uid", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 32, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 30, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file