29
29
// type 'fs.' as an alternate way of accessing the top-level objects
30
30
// (e.g. 'fs.goTo.eof();')
31
31
32
+ //---------------------------------------
33
+ // For API editors:
34
+ // When editting this file, and only while editing this file, enable the reference comments
35
+ // and comment out the declarations in this section to get proper type information.
36
+ // Undo these changes before compiling/committing/editing any other fourslash tests.
37
+ // The test suite will likely crash if you try 'jake runtests' with reference comments enabled.
38
+ //
39
+ // Explanation:
40
+ // We want type-completion while we edit this file, but at compile time/while editting fourslash tests,
41
+ // we don't want to include the following reference because we are compiling this file in "--out" mode and don't want to rope
42
+ // in the entire codebase into the compilation each fourslash test. Additionally, we don't want to expose the
43
+ // src/harness/fourslash.ts API's (or the rest of the compiler) because they are unstable and complicate the
44
+ // fourslash testing DSL. Finally, in this case, runtime reflection is (much) faster.
45
+ //
46
+ // TODO: figure out a better solution to the API exposure problem.
47
+
48
+ // /// <reference path="../../../built/local/typescriptServices.d.ts"/>
49
+ // /// <reference path="../../../src/harness/fourslash.ts"/>
50
+
32
51
declare var FourSlash ;
52
+ module ts {
53
+ export interface SymbolDisplayPart {
54
+ text : string ;
55
+ kind : string ;
56
+ }
57
+ }
58
+
59
+ //---------------------------------------------
33
60
34
61
// Return code used by getEmitOutput function to indicate status of the function
35
62
// It is a duplicate of the one in types.ts to expose it to testcases in fourslash
@@ -42,7 +69,6 @@ enum EmitReturnStatus {
42
69
}
43
70
44
71
module FourSlashInterface {
45
- declare var FourSlash ;
46
72
47
73
export interface Marker {
48
74
fileName : string ;
@@ -201,15 +227,6 @@ module FourSlashInterface {
201
227
FourSlash . currentTestState . verifyReferencesAtPositionListContains ( range . fileName , range . start , range . end , isWriteAccess ) ;
202
228
}
203
229
204
- public implementorsCountIs ( count : number ) {
205
- FourSlash . currentTestState . verifyImplementorsCountIs ( count ) ;
206
- }
207
-
208
- // Add tests for this.
209
- public currentParameterIsVariable ( ) {
210
- FourSlash . currentTestState . verifyCurrentParameterIsVariable ( ! this . negative ) ;
211
- }
212
-
213
230
public signatureHelpPresent ( ) {
214
231
FourSlash . currentTestState . verifySignatureHelpPresent ( ! this . negative ) ;
215
232
}
@@ -361,28 +378,19 @@ module FourSlashInterface {
361
378
FourSlash . currentTestState . verifyNoMatchingBracePosition ( bracePosition ) ;
362
379
}
363
380
364
- public setVerifyDocComments ( val : boolean ) {
365
- FourSlash . currentTestState . setVerifyDocComments ( val ) ;
366
- }
367
-
368
381
public getScriptLexicalStructureListCount ( count : number ) {
369
382
FourSlash . currentTestState . verifyGetScriptLexicalStructureListCount ( count ) ;
370
383
}
371
384
385
+ // TODO: figure out what to do with the unused arguments.
372
386
public getScriptLexicalStructureListContains (
373
387
name : string ,
374
388
kind : string ,
375
389
fileName ?: string ,
376
390
parentName ?: string ,
377
391
isAdditionalSpan ?: boolean ,
378
392
markerPosition ?: number ) {
379
- FourSlash . currentTestState . verifGetScriptLexicalStructureListContains (
380
- name ,
381
- kind ,
382
- fileName ,
383
- parentName ,
384
- isAdditionalSpan ,
385
- markerPosition ) ;
393
+ FourSlash . currentTestState . verifyGetScriptLexicalStructureListContains ( name , kind ) ;
386
394
}
387
395
388
396
public navigationItemsListCount ( count : number , searchValue : string , matchKind ?: string ) {
@@ -698,12 +706,7 @@ module fs {
698
706
export var format = new FourSlashInterface . format ( ) ;
699
707
export var cancellation = new FourSlashInterface . cancellation ( ) ;
700
708
}
701
- module ts {
702
- export interface SymbolDisplayPart {
703
- text : string ;
704
- kind : string ;
705
- }
706
- }
709
+
707
710
function verifyOperationIsCancelled ( f ) {
708
711
FourSlash . verifyOperationIsCancelled ( f ) ;
709
712
}
0 commit comments