File tree Expand file tree Collapse file tree 7 files changed +47
-5
lines changed Expand file tree Collapse file tree 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
2020
2121Generate snapshots and update.
2222
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+
2329## Snapshotting arbitrary projects
2430
2531``` 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 106106 if ( forever ( ) ) {
107107// ^^^^^^^ reference pure-js 1.0.0 src/`main.js`/forever().
108108 var k = 1
109- // ^ definition local 14
109+ // ^ definition local 17
110110// documentation ```ts\nvar k: number\n```
111111 }
112112 print_fib ( k )
Original file line number Diff line number Diff line change 1313// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/C#_length.
1414 }
1515 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`().
1717// documentation ```ts\nget length: number\n```
1818// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/C#`<set>length`().(value)
1919// documentation ```ts\n(parameter) value: number\n```
4646// ^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_length.
4747 }
4848 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`().
5050// documentation ```ts\nget length: number\n```
5151// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>length`().(value)
5252// documentation ```ts\n(parameter) value: number\n```
6565// ^^^^^^^^^ reference syntax 1.0.0 src/`accessors.ts`/D#_capacity.
6666 }
6767 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`().
6969// documentation ```ts\nget capacity: number\n```
7070// ^^^^^ definition syntax 1.0.0 src/`accessors.ts`/D#`<set>capacity`().(value)
7171// 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 {
3737 this . workingDirectoryRegExp = new RegExp ( options . cwd , 'g' )
3838 }
3939 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+ // }
4044 this . emitSourceFileOccurrence ( )
4145 this . visit ( this . sourceFile )
4246 }
@@ -104,7 +108,17 @@ export class FileIndexer {
104108 if ( isDefinitionNode ) {
105109 role |= scip . scip . SymbolRole . Definition
106110 }
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 ) {
108122 const scipSymbol = this . scipSymbol ( declaration )
109123
110124 if ( scipSymbol . isEmpty ( ) ) {
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ interface PackageJson {
3333 workspaces : string [ ]
3434}
3535for ( 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+ // }
3640 const inputRoot = join ( inputDirectory , snapshotDirectory )
3741 const outputRoot = join ( outputDirectory , snapshotDirectory )
3842 if ( ! fs . statSync ( inputRoot ) . isDirectory ( ) ) {
You can’t perform that action at this time.
0 commit comments