File tree 7 files changed +47
-5
lines changed
7 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ npm run update-snapshots
20
20
21
21
Generate snapshots and update.
22
22
23
+ ## Skipping files/test for local development
24
+
25
+ Search for the query ` "Uncomment below if you want to skip ` to find places where
26
+ you can uncomment code to skip tests/files for a faster edit/test/debug feedback
27
+ loop during local development.
28
+
23
29
## Snapshotting arbitrary projects
24
30
25
31
``` sh
Original file line number Diff line number Diff line change
1
+ export const ConflictingConst = 42
2
+ export interface ConflictingConst { }
3
+ export class ImplementsConflictingConst implements ConflictingConst { }
Original file line number Diff line number Diff line change 106
106
if ( forever ( ) ) {
107
107
// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
108
108
var k = 1
109
- // ^ definition local 14
109
+ // ^ definition local 17
110
110
// documentation ```ts\nvar k: number\n```
111
111
}
112
112
print_fib ( k )
Original file line number Diff line number Diff line change 13
13
// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#_length.
14
14
}
15
15
set length ( value : number ) {
16
- // ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<get >length`().
16
+ // ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<set >length`().
17
17
// documentation ```ts\nget length: number\n```
18
18
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().(value)
19
19
// documentation ```ts\n(parameter) value: number\n```
46
46
// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_length.
47
47
}
48
48
public set length ( value : number ) {
49
- // ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<get >length`().
49
+ // ^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set >length`().
50
50
// documentation ```ts\nget length: number\n```
51
51
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().(value)
52
52
// documentation ```ts\n(parameter) value: number\n```
65
65
// ^^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_capacity.
66
66
}
67
67
private set capacity ( value : number ) {
68
- // ^^^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<get >capacity`().
68
+ // ^^^^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set >capacity`().
69
69
// documentation ```ts\nget capacity: number\n```
70
70
// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().(value)
71
71
// documentation ```ts\n(parameter) value: number\n```
Original file line number Diff line number Diff line change
1
+ export const ConflictingConst = 42
2
+ // definition syntax 1.0.0 src/`conflicting-const-interface.ts`/
3
+ //documentation ```ts\nmodule "conflicting-const-interface.ts"\n```
4
+ // ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`conflicting-const-interface.ts`/ConflictingConst.
5
+ // documentation ```ts\ninterface ConflictingConst\n```
6
+ export interface ConflictingConst { }
7
+ // ^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`conflicting-const-interface.ts`/ConflictingConst#
8
+ // documentation ```ts\ninterface ConflictingConst\n```
9
+ export class ImplementsConflictingConst implements ConflictingConst { }
10
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^ definition syntax 1.0.0 src/`conflicting-const-interface.ts`/ImplementsConflictingConst#
11
+ // documentation ```ts\nclass ImplementsConflictingConst\n```
12
+ // relationship implementation scip-typescript npm syntax 1.0.0 src/`conflicting-const-interface.ts`/ConflictingConst#
13
+ // ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`conflicting-const-interface.ts`/ConflictingConst.
14
+ // ^^^^^^^^^^^^^^^^ reference syntax 1.0.0 src/`conflicting-const-interface.ts`/ConflictingConst#
15
+
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ export class FileIndexer {
37
37
this . workingDirectoryRegExp = new RegExp ( options . cwd , 'g' )
38
38
}
39
39
public index ( ) : void {
40
+ // Uncomment below if you want to skip certain files for local development.
41
+ // if (!this.sourceFile.fileName.includes('conflicting-const')) {
42
+ // return
43
+ // }
40
44
this . emitSourceFileOccurrence ( )
41
45
this . visit ( this . sourceFile )
42
46
}
@@ -104,7 +108,17 @@ export class FileIndexer {
104
108
if ( isDefinitionNode ) {
105
109
role |= scip . scip . SymbolRole . Definition
106
110
}
107
- for ( const declaration of sym ?. declarations || [ ] ) {
111
+ const declarations = isDefinitionNode
112
+ ? // Don't emit ambiguous definition at definition-site. You can reproduce
113
+ // ambiguous results by triggering "Go to definition" in VS Code on `Conflict`
114
+ // in the example below:
115
+ // export const Conflict = 42
116
+ // export interface Conflict {}
117
+ // ^^^^^^^^ "Go to definition" shows two results: const and interface.
118
+ // See https://github.com/sourcegraph/scip-typescript/pull/206 for more details.
119
+ [ node . parent ]
120
+ : sym ?. declarations || [ ]
121
+ for ( const declaration of declarations ) {
108
122
const scipSymbol = this . scipSymbol ( declaration )
109
123
110
124
if ( scipSymbol . isEmpty ( ) ) {
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ interface PackageJson {
33
33
workspaces : string [ ]
34
34
}
35
35
for ( const snapshotDirectory of snapshotDirectories ) {
36
+ // Uncomment below if you want to skip certain tests for local development.
37
+ // if (!snapshotDirectory.includes('syntax')) {
38
+ // continue
39
+ // }
36
40
const inputRoot = join ( inputDirectory , snapshotDirectory )
37
41
const outputRoot = join ( outputDirectory , snapshotDirectory )
38
42
if ( ! fs . statSync ( inputRoot ) . isDirectory ( ) ) {
You can’t perform that action at this time.
0 commit comments