Skip to content

Commit a11214c

Browse files
committed
WIP
1 parent 3dec819 commit a11214c

19 files changed

+145
-148
lines changed

snapshots/output/pure-js/src/main.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
//documentation ```ts\nmodule "main.js"\n```
44
// ^^^ definition pure-js 1.0.0 src/`main.js`/fib().
55
// documentation ```ts\nfunction fib(n: any): any\n```
6-
// ^ definition local 0
6+
// ^ definition pure-js 1.0.0 src/`main.js`/fib().(n)
77
// documentation ```ts\n(parameter) n: any\n```
88
if (n <= 1) {
9-
// ^ reference local 0
9+
// ^ reference pure-js 1.0.0 src/`main.js`/fib().(n)
1010
return 0
1111
}
1212
return fib(n - 1) + fib(n - 2)
1313
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
14-
// ^ reference local 0
14+
// ^ reference pure-js 1.0.0 src/`main.js`/fib().(n)
1515
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
16-
// ^ reference local 0
16+
// ^ reference pure-js 1.0.0 src/`main.js`/fib().(n)
1717
}
1818

1919
function print_fib(a) {
2020
// ^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/print_fib().
2121
// documentation ```ts\nfunction print_fib(a: any): void\n```
22-
// ^ definition local 1
22+
// ^ definition pure-js 1.0.0 src/`main.js`/print_fib().(a)
2323
// documentation ```ts\n(parameter) a: any\n```
2424
console.log(fib(a))
2525
// ^^^^^^^ reference typescript 4.8.4 lib/`lib.dom.d.ts`/console.
@@ -29,7 +29,7 @@
2929
// ^^^ reference typescript 4.8.4 lib/`lib.dom.d.ts`/Console#log().
3030
// ^^^ reference @types/node 17.0.14 `console.d.ts`/`'node:console'`/global/Console#log().
3131
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
32-
// ^ reference local 1
32+
// ^ reference pure-js 1.0.0 src/`main.js`/print_fib().(a)
3333
}
3434

3535
var y = 'Hello'
@@ -49,13 +49,13 @@
4949
}
5050

5151
for (var i = 0; i <= 10; i++) {}
52-
// ^ definition local 4
52+
// ^ definition local 2
5353
// documentation ```ts\nvar i: number\n```
54-
// ^ reference local 4
55-
// ^ reference local 4
54+
// ^ reference local 2
55+
// ^ reference local 2
5656

5757
for (const x of [1, 2, 3]) {
58-
// ^ definition local 7
58+
// ^ definition local 5
5959
// documentation ```ts\nvar x: number\n```
6060
}
6161

@@ -81,37 +81,37 @@
8181
// documentation ```ts\nfunction use_before_def(): void\n```
8282
print_fib(n)
8383
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
84-
// ^ reference local 10
84+
// ^ reference local 8
8585
var n = 10
86-
// ^ definition local 10
86+
// ^ definition local 8
8787
// documentation ```ts\nvar n: number\n```
8888

8989
if (forever()) {
9090
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
9191
var m = 10
92-
// ^ definition local 13
92+
// ^ definition local 11
9393
// documentation ```ts\nvar m: number\n```
9494
}
9595
print_fib(m)
9696
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
97-
// ^ reference local 13
97+
// ^ reference local 11
9898
}
9999

100100
function var_function_scope() {
101101
// ^^^^^^^^^^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/var_function_scope().
102102
// documentation ```ts\nfunction var_function_scope(): void\n```
103103
var k = 0
104-
// ^ definition local 16
104+
// ^ definition local 14
105105
// documentation ```ts\nvar k: number\n```
106106
if (forever()) {
107107
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
108108
var k = 1
109-
// ^ definition local 19
109+
// ^ definition local 17
110110
// documentation ```ts\nvar k: number\n```
111111
}
112112
print_fib(k)
113113
// ^^^^^^^^^ reference pure-js 1.0.0 src/`main.js`/print_fib().
114-
// ^ reference local 16
115-
// ^ reference local 19
114+
// ^ reference local 14
115+
// ^ reference local 17
116116
}
117117

snapshots/output/react/src/LoaderInput.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@
2626
// ^^^^^^^^^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/FunctionComponent#
2727
// ^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#
2828
loading,
29-
// ^^^^^^^ definition local 2
29+
// ^^^^^^^ definition local 3
3030
// documentation ```ts\n(parameter) loading: boolean\n```
3131
// ^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading.
3232
children,
33-
// ^^^^^^^^ definition local 3
33+
// ^^^^^^^^ definition local 4
3434
// documentation ```ts\n(parameter) children: ReactNode\n```
3535
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
36-
// ^^^^^^^^ reference local 6
36+
// ^^^^^^^^ reference local 7
3737
}) => (
3838
<div className="hello">
3939
// ^^^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#div.
4040
// ^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/HTMLAttributes#className.
4141
{children}
42-
// ^^^^^^^^ reference local 3
42+
// ^^^^^^^^ reference local 4
4343
{loading && <p>spinner</p>}
44-
// ^^^^^^^ reference local 2
44+
// ^^^^^^^ reference local 3
4545
// ^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#p.
4646
// ^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#p.
4747
</div>
@@ -54,15 +54,15 @@
5454
// ^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/
5555
// ^^^^^^^^^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/FunctionComponent#
5656
// ^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#
57-
// ^^^^^ definition local 7
57+
// ^^^^^ definition local 9
5858
// documentation ```ts\n(parameter) props: PropsWithChildren<Props>\n```
5959
return <LoaderInput loading={true} key="key" children={props.children} />
6060
// ^^^^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/LoaderInput.
6161
// ^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading.
62-
// ^^^ reference local 11
62+
// ^^^ reference local 13
6363
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
64-
// ^^^^^ reference local 7
64+
// ^^^^^ reference local 9
6565
// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children.
66-
// ^^^^^^^^ reference local 6
66+
// ^^^^^^^^ reference local 7
6767
}
6868

snapshots/output/syntax/src/accessors.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
set length(value: number) {
1616
// ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().
1717
// documentation ```ts\nget length: number\n```
18-
// ^^^^^ definition local 0
18+
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().(value)
1919
// documentation ```ts\n(parameter) value: number\n```
2020
this._length = value
2121
// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#_length.
22-
// ^^^^^ reference local 0
22+
// ^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().(value)
2323
}
2424

2525
_capacity: number = 0
@@ -48,11 +48,11 @@
4848
public set length(value: number) {
4949
// ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().
5050
// documentation ```ts\nget length: number\n```
51-
// ^^^^^ definition local 1
51+
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().(value)
5252
// documentation ```ts\n(parameter) value: number\n```
5353
this._length = value
5454
// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_length.
55-
// ^^^^^ reference local 1
55+
// ^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().(value)
5656
}
5757

5858
_capacity: number = 0
@@ -67,72 +67,72 @@
6767
private set capacity(value: number) {
6868
// ^^^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().
6969
// documentation ```ts\nget capacity: number\n```
70-
// ^^^^^ definition local 2
70+
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().(value)
7171
// documentation ```ts\n(parameter) value: number\n```
7272
this._capacity = value
7373
// ^^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_capacity.
74-
// ^^^^^ reference local 2
74+
// ^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().(value)
7575
}
7676
public unsafeSetCapacity(value: number): void {
7777
// ^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#unsafeSetCapacity().
7878
// documentation ```ts\n(method) unsafeSetCapacity(value: number): void\n```
79-
// ^^^^^ definition local 3
79+
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#unsafeSetCapacity().(value)
8080
// documentation ```ts\n(parameter) value: number\n```
8181
this.capacity = value
8282
// ^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<get>capacity`().
8383
// ^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().
84-
// ^^^^^ reference local 3
84+
// ^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#unsafeSetCapacity().(value)
8585
}
8686
}
8787

8888
function g(_: number): void {}
8989
// ^ definition syntax 1.0.0 src/`accessors.ts`/g().
9090
// documentation ```ts\nfunction g(_: number): void\n```
91-
// ^ definition local 4
91+
// ^ definition syntax 1.0.0 src/`accessors.ts`/g().(_)
9292
// documentation ```ts\n(parameter) _: number\n```
9393

9494
function f() {
9595
// ^ definition syntax 1.0.0 src/`accessors.ts`/f().
9696
// documentation ```ts\nfunction f(): void\n```
9797
const c = new C()
98-
// ^ definition local 7
98+
// ^ definition local 2
9999
// documentation ```ts\nvar c: C\n```
100100
// ^ reference syntax 1.0.0 src/`accessors.ts`/C#
101101
c.length = 10
102-
// ^ reference local 7
102+
// ^ reference local 2
103103
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<get>length`().
104104
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().
105105
g(c.length)
106106
// ^ reference syntax 1.0.0 src/`accessors.ts`/g().
107-
// ^ reference local 7
107+
// ^ reference local 2
108108
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<get>length`().
109109
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().
110110
g(c.capacity)
111111
// ^ reference syntax 1.0.0 src/`accessors.ts`/g().
112-
// ^ reference local 7
112+
// ^ reference local 2
113113
// ^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<get>capacity`().
114114
g(c.length)
115115
// ^ reference syntax 1.0.0 src/`accessors.ts`/g().
116-
// ^ reference local 7
116+
// ^ reference local 2
117117
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<get>length`().
118118
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().
119119

120120
const d = new D()
121-
// ^ definition local 10
121+
// ^ definition local 5
122122
// documentation ```ts\nvar d: D\n```
123123
// ^ reference syntax 1.0.0 src/`accessors.ts`/D#
124124
d.length = 0
125-
// ^ reference local 10
125+
// ^ reference local 5
126126
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<get>length`().
127127
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().
128128
g(d.length)
129129
// ^ reference syntax 1.0.0 src/`accessors.ts`/g().
130-
// ^ reference local 10
130+
// ^ reference local 5
131131
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<get>length`().
132132
// ^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().
133133
g(d.capacity)
134134
// ^ reference syntax 1.0.0 src/`accessors.ts`/g().
135-
// ^ reference local 10
135+
// ^ reference local 5
136136
// ^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<get>capacity`().
137137
// ^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().
138138
g(D.length)

snapshots/output/syntax/src/class.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,58 @@
99
constructor(constructorParam: string) {
1010
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#`<constructor>`().
1111
// documentation ```ts\nconstructor(constructorParam: string): Class\n```
12-
// ^^^^^^^^^^^^^^^^ definition local 0
12+
// ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#`<constructor>`().(constructorParam)
1313
// documentation ```ts\n(parameter) constructorParam: string\n```
1414
this.classProperty = constructorParam
1515
// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#classProperty.
16-
// ^^^^^^^^^^^^^^^^ reference local 0
16+
// ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#`<constructor>`().(constructorParam)
1717
}
1818
public method(methodParam: string): string {
1919
// ^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#method().
2020
// documentation ```ts\n(method) method(methodParam: string): string\n```
21-
// ^^^^^^^^^^^ definition local 1
21+
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#method().(methodParam)
2222
// documentation ```ts\n(parameter) methodParam: string\n```
2323
return this.privateMethod(methodParam)
2424
// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#privateMethod().
25-
// ^^^^^^^^^^^ reference local 1
25+
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#method().(methodParam)
2626
}
2727
public static staticMethod(methodParam: string): string {
2828
// ^^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#staticMethod().
2929
// documentation ```ts\n(method) staticMethod(methodParam: string): string\n```
30-
// ^^^^^^^^^^^ definition local 2
30+
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#staticMethod().(methodParam)
3131
// documentation ```ts\n(parameter) methodParam: string\n```
3232
return methodParam
33-
// ^^^^^^^^^^^ reference local 2
33+
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#staticMethod().(methodParam)
3434
}
3535
private privateMethod(methodParam: string): string {
3636
// ^^^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#privateMethod().
3737
// documentation ```ts\n(method) privateMethod(methodParam: string): string\n```
38-
// ^^^^^^^^^^^ definition local 3
38+
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/Class#privateMethod().(methodParam)
3939
// documentation ```ts\n(parameter) methodParam: string\n```
4040
return methodParam
41-
// ^^^^^^^^^^^ reference local 3
41+
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#privateMethod().(methodParam)
4242
}
4343
}
4444

4545
export function newClass(param: string): string {
4646
// ^^^^^^^^ definition syntax 1.0.0 src/`class.ts`/newClass().
4747
// documentation ```ts\nfunction newClass(param: string): string\n```
48-
// ^^^^^ definition local 4
48+
// ^^^^^ definition syntax 1.0.0 src/`class.ts`/newClass().(param)
4949
// documentation ```ts\n(parameter) param: string\n```
5050
const instance = new Class(param).classProperty
51-
// ^^^^^^^^ definition local 7
51+
// ^^^^^^^^ definition local 2
5252
// documentation ```ts\nvar instance: string\n```
5353
// ^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#`<constructor>`().
54-
// ^^^^^ reference local 4
54+
// ^^^^^ reference syntax 1.0.0 src/`class.ts`/newClass().(param)
5555
// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#classProperty.
5656
const instance2 = Class.staticMethod(param)
57-
// ^^^^^^^^^ definition local 10
57+
// ^^^^^^^^^ definition local 5
5858
// documentation ```ts\nvar instance2: string\n```
5959
// ^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#
6060
// ^^^^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#staticMethod().
61-
// ^^^^^ reference local 4
61+
// ^^^^^ reference syntax 1.0.0 src/`class.ts`/newClass().(param)
6262
return instance + instance2
63-
// ^^^^^^^^ reference local 7
64-
// ^^^^^^^^^ reference local 10
63+
// ^^^^^^^^ reference local 2
64+
// ^^^^^^^^^ reference local 5
6565
}
6666

snapshots/output/syntax/src/constructor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
constructor(public readonly property: number) {}
1010
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor#`<constructor>`().
1111
// documentation ```ts\nconstructor(property: number): SuperConstructor\n```
12-
// ^^^^^^^^ definition local 0
12+
// ^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/Yay/SuperConstructor#`<constructor>`().(property)
1313
// documentation ```ts\n(property) property: number\n```
1414
}
1515

@@ -32,7 +32,7 @@
3232
constructor(public readonly property: number) {}
3333
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/SuperConstructor2#`<constructor>`().
3434
// documentation ```ts\nconstructor(property: number): SuperConstructor2\n```
35-
// ^^^^^^^^ definition local 1
35+
// ^^^^^^^^ definition syntax 1.0.0 src/`constructor.ts`/SuperConstructor2#`<constructor>`().(property)
3636
// documentation ```ts\n(property) property: number\n```
3737
}
3838

snapshots/output/syntax/src/decorators.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
function MyDecorator(value: Configuration) {
88
// ^^^^^^^^^^^ definition syntax 1.0.0 src/`decorators.ts`/MyDecorator().
99
// documentation ```ts\nfunction MyDecorator(value: Configuration): (target: Function) => void\n```
10-
// ^^^^^ definition local 0
10+
// ^^^^^ definition syntax 1.0.0 src/`decorators.ts`/MyDecorator().(value)
1111
// documentation ```ts\n(parameter) value: Configuration\n```
1212
// ^^^^^^^^^^^^^ reference syntax 1.0.0 src/`reusable-types.ts`/Configuration#
1313
return function (target: Function) {
14-
// ^^^^^^ definition local 1
14+
// ^^^^^^ definition local 2
1515
// documentation ```ts\n(parameter) target: Function\n```
1616
// ^^^^^^^^ reference typescript 4.8.4 lib/`lib.es5.d.ts`/Function#
1717
// ^^^^^^^^ reference typescript 4.8.4 lib/`lib.es5.d.ts`/Function.
@@ -24,7 +24,7 @@
2424
// ^^^^^^^ reference @types/node 17.0.14 `console.d.ts`/`'node:console'`/global/console.
2525
// ^^^ reference typescript 4.8.4 lib/`lib.dom.d.ts`/Console#log().
2626
// ^^^ reference @types/node 17.0.14 `console.d.ts`/`'node:console'`/global/Console#log().
27-
// ^^^^^ reference local 0
27+
// ^^^^^ reference syntax 1.0.0 src/`decorators.ts`/MyDecorator().(value)
2828
}
2929
}
3030

0 commit comments

Comments
 (0)