2014-07-13 01:04:16 +02:00
// Welcome to the FourSlash syntax guide!
// A line in the source text is indicated by four slashes (////)
// Tip: Hit Ctrl-K Ctrl-C Ctrl-K Ctrl-C to prefix-slash any selected block of text in Visual Studio
//// This is a line in the source text!
// Files are terminated by any entirely blank line (e.g.
// interspersed //-initiated comments are allowed)
// You can indicate a 'marker' with /**/
//// function./**/
// ... goTo.marker();
// Optionally, markers may have names:
//// function.go(/*1*/x, /*2*/y);
// goTo.marker('1');
// Marker names may consist of any alphanumeric characters
// File metadata must occur directly before the first line of source text
// and is indicated by an @ symbol:
// @Filename: lib.d.ts
//// this is the first line of my file
// Global options may appear anywhere
// @Module: Node
// @Target: ES5
// In the imperative section, you can write any valid TypeScript code. If
// you need help finding a something in Intellisense, you can
// type 'fs.' as an alternate way of accessing the top-level objects
// (e.g. 'fs.goTo.eof();')
declare var FourSlash ;
enum IncrementalEditValidation {
None = FourSlash . IncrementalEditValidation . None ,
SyntacticOnly = FourSlash . IncrementalEditValidation . SyntacticOnly ,
Complete = FourSlash . IncrementalEditValidation . Complete
}
enum TypingFidelity {
/** Performs typing and formatting (if formatting is enabled) */
Low = FourSlash . TypingFidelity . Low ,
/** Performs typing, checks completion lists, signature help, and formatting (if enabled) */
High = FourSlash . TypingFidelity . High
}
2014-09-06 01:18:39 +02:00
// Return code used by getEmitOutput function to indicate status of the function
// It is a duplicate of the one in types.ts to expose it to testcases in fourslash
enum EmitReturnStatus {
Succeeded = 0 , // All outputs generated as requested (.js, .map, .d.ts), no errors reported
AllOutputGenerationSkipped = 1 , // No .js generated because of syntax errors, or compiler options errors, nothing generated
JSGeneratedWithSemanticErrors = 2 , // .js and .map generated with semantic errors
DeclarationGenerationSkipped = 3 , // .d.ts generation skipped because of semantic errors or declaration emitter specific errors; Output .js with semantic errors
2014-09-11 00:57:01 +02:00
EmitErrorsEncountered = 4 // Emitter errors occurred during emitting process
2014-09-03 20:28:55 +02:00
}
2014-07-13 01:04:16 +02:00
module FourSlashInterface {
declare var FourSlash ;
export interface Marker {
fileName : string ;
position : number ;
data? : any ;
}
export interface Range {
fileName : string ;
start : number ;
end : number ;
marker? : Marker ;
}
export interface TextSpan {
start : number ;
end : number ;
}
export class test_ {
public markers ( ) : Marker [ ] {
return FourSlash . currentTestState . getMarkers ( ) ;
}
2014-10-14 02:29:19 +02:00
public marker ( name? : string ) : Marker {
return FourSlash . currentTestState . getMarkerByName ( name ) ;
}
2014-07-13 01:04:16 +02:00
public ranges ( ) : Range [ ] {
return FourSlash . currentTestState . getRanges ( ) ;
}
2014-10-13 23:38:18 +02:00
public markerByName ( s : string ) : Marker {
return FourSlash . currentTestState . getMarkerByName ( s ) ;
}
2014-07-13 01:04:16 +02:00
}
export class diagnostics {
public validateTypeAtCurrentPosition() {
return this . validateTypesAtPositions ( FourSlash . currentTestState . currentCaretPosition ) ;
}
public validateTypesAtPositions ( . . . positions : number [ ] ) {
return FourSlash . currentTestState . verifyTypesAgainstFullCheckAtPositions ( positions ) ;
}
public setEditValidation ( validation : IncrementalEditValidation ) {
FourSlash . currentTestState . editValidation = validation ;
}
public setTypingFidelity ( fidelity : TypingFidelity ) {
FourSlash . currentTestState . typingFidelity = fidelity ;
}
}
export class goTo {
// Moves the caret to the specified marker,
// or the anonymous marker ('/**/') if no name
// is given
public marker ( name? : string ) {
FourSlash . currentTestState . goToMarker ( name ) ;
}
public bof() {
FourSlash . currentTestState . goToBOF ( ) ;
}
public eof() {
FourSlash . currentTestState . goToEOF ( ) ;
}
public definition ( definitionIndex : number = 0 ) {
FourSlash . currentTestState . goToDefinition ( definitionIndex ) ;
}
public position ( position : number , fileIndex? : number ) ;
public position ( position : number , fileName? : string ) ;
public position ( position : number , fileNameOrIndex? : any ) {
if ( fileNameOrIndex !== undefined ) {
this . file ( fileNameOrIndex ) ;
}
FourSlash . currentTestState . goToPosition ( position ) ;
}
// Opens a file, given either its index as it
// appears in the test source, or its filename
// as specified in the test metadata
public file ( index : number ) ;
public file ( name : string ) ;
public file ( indexOrName : any ) {
FourSlash . currentTestState . openFile ( indexOrName ) ;
}
}
export class verifyNegatable {
public not : verifyNegatable ;
constructor ( private negative = false ) {
if ( ! negative ) {
this . not = new verifyNegatable ( true ) ;
}
}
// Verifies the member list contains the specified symbol. The
// member list is brought up if necessary
2014-09-29 18:45:03 +02:00
public memberListContains ( symbol : string , text? : string , documenation? : string , kind? : string ) {
2014-07-13 01:04:16 +02:00
if ( this . negative ) {
FourSlash . currentTestState . verifyMemberListDoesNotContain ( symbol ) ;
} else {
2014-09-29 18:45:03 +02:00
FourSlash . currentTestState . verifyMemberListContains ( symbol , text , documenation , kind ) ;
2014-07-13 01:04:16 +02:00
}
}
public memberListCount ( expectedCount : number ) {
FourSlash . currentTestState . verifyMemberListCount ( expectedCount , this . negative ) ;
}
// Verifies the completion list contains the specified symbol. The
// completion list is brought up if necessary
2014-09-29 18:45:03 +02:00
public completionListContains ( symbol : string , text? : string , documentation? : string , kind? : string ) {
2014-07-13 01:04:16 +02:00
if ( this . negative ) {
FourSlash . currentTestState . verifyCompletionListDoesNotContain ( symbol ) ;
} else {
2014-09-29 18:45:03 +02:00
FourSlash . currentTestState . verifyCompletionListContains ( symbol , text , documentation , kind ) ;
2014-07-13 01:04:16 +02:00
}
}
// Verifies the completion list items count to be greater than the specified amount. The
// completion list is brought up if necessary
public completionListItemsCountIsGreaterThan ( count : number ) {
FourSlash . currentTestState . verifyCompletionListItemsCountIsGreaterThan ( count ) ;
}
public completionListIsEmpty() {
FourSlash . currentTestState . verifyCompletionListIsEmpty ( this . negative ) ;
}
public memberListIsEmpty() {
FourSlash . currentTestState . verifyMemberListIsEmpty ( this . negative ) ;
}
public referencesCountIs ( count : number ) {
2014-08-21 02:33:44 +02:00
FourSlash . currentTestState . verifyReferencesCountIs ( count , /*localFilesOnly*/ false ) ;
2014-07-13 01:04:16 +02:00
}
2014-08-23 07:07:45 +02:00
public referencesAtPositionContains ( range : Range , isWriteAccess? : boolean ) {
FourSlash . currentTestState . verifyReferencesAtPositionListContains ( range . fileName , range . start , range . end , isWriteAccess ) ;
}
2014-07-13 01:04:16 +02:00
public implementorsCountIs ( count : number ) {
FourSlash . currentTestState . verifyImplementorsCountIs ( count ) ;
}
2014-08-30 03:02:05 +02:00
// Add tests for this.
2014-07-13 01:04:16 +02:00
public currentParameterIsVariable() {
FourSlash . currentTestState . verifyCurrentParameterIsVariable ( ! this . negative ) ;
}
public signatureHelpPresent() {
FourSlash . currentTestState . verifySignatureHelpPresent ( ! this . negative ) ;
}
public errorExistsBetweenMarkers ( startMarker : string , endMarker : string ) {
FourSlash . currentTestState . verifyErrorExistsBetweenMarkers ( startMarker , endMarker , ! this . negative ) ;
}
public errorExistsAfterMarker ( markerName = "" ) {
FourSlash . currentTestState . verifyErrorExistsAfterMarker ( markerName , ! this . negative , true ) ;
}
public errorExistsBeforeMarker ( markerName = "" ) {
FourSlash . currentTestState . verifyErrorExistsAfterMarker ( markerName , ! this . negative , false ) ;
}
2014-09-29 18:45:03 +02:00
public quickInfoIs ( expectedText? : string , expectedDocumentation? : string ) {
2014-11-21 07:36:27 +01:00
FourSlash . currentTestState . verifyQuickInfoString ( this . negative , expectedText , expectedDocumentation ) ;
2014-07-13 01:04:16 +02:00
}
public quickInfoExists() {
FourSlash . currentTestState . verifyQuickInfoExists ( this . negative ) ;
}
public definitionLocationExists() {
FourSlash . currentTestState . verifyDefinitionLocationExists ( this . negative ) ;
}
2014-10-03 23:51:22 +02:00
public verifyDefinitionsName ( name : string , containerName : string ) {
FourSlash . currentTestState . verifyDefinitionsName ( this . negative , name , containerName ) ;
}
2014-07-13 01:04:16 +02:00
}
export class verify extends verifyNegatable {
public caretAtMarker ( markerName? : string ) {
FourSlash . currentTestState . verifyCaretAtMarker ( markerName ) ;
}
public indentationIs ( numberOfSpaces : number ) {
FourSlash . currentTestState . verifyIndentationAtCurrentPosition ( numberOfSpaces ) ;
}
public indentationAtPositionIs ( fileName : string , position : number , numberOfSpaces : number ) {
FourSlash . currentTestState . verifyIndentationAtPosition ( fileName , position , numberOfSpaces ) ;
}
public textAtCaretIs ( text : string ) {
FourSlash . currentTestState . verifyTextAtCaretIs ( text ) ;
}
/ * *
Compiles the current file and evaluates 'expr' in a context containing
the emitted output , then compares ( using === ) the result of that expression
to 'value' . Do not use this function with external modules as it is not supported .
* /
public eval ( expr : string , value : any ) {
FourSlash . currentTestState . verifyEval ( expr , value ) ;
}
public currentLineContentIs ( text : string ) {
FourSlash . currentTestState . verifyCurrentLineContent ( text ) ;
}
public currentFileContentIs ( text : string ) {
FourSlash . currentTestState . verifyCurrentFileContent ( text ) ;
}
public currentParameterHelpArgumentNameIs ( name : string ) {
2014-09-22 22:22:29 +02:00
FourSlash . currentTestState . verifyCurrentParameterHelpName ( name ) ;
2014-07-13 01:04:16 +02:00
}
public currentParameterSpanIs ( parameter : string ) {
2014-09-22 22:22:29 +02:00
FourSlash . currentTestState . verifyCurrentParameterSpanIs ( parameter ) ;
2014-07-13 01:04:16 +02:00
}
public currentParameterHelpArgumentDocCommentIs ( docComment : string ) {
2014-09-27 00:40:55 +02:00
FourSlash . currentTestState . verifyCurrentParameterHelpDocComment ( docComment ) ;
2014-07-13 01:04:16 +02:00
}
public currentSignatureHelpDocCommentIs ( docComment : string ) {
2014-09-27 00:40:55 +02:00
FourSlash . currentTestState . verifyCurrentSignatureHelpDocComment ( docComment ) ;
2014-07-13 01:04:16 +02:00
}
public signatureHelpCountIs ( expected : number ) {
2014-09-16 02:03:08 +02:00
FourSlash . currentTestState . verifySignatureHelpCount ( expected ) ;
2014-07-13 01:04:16 +02:00
}
2014-10-01 02:13:27 +02:00
public signatureHelpArgumentCountIs ( expected : number ) {
FourSlash . currentTestState . verifySignatureHelpArgumentCount ( expected ) ;
}
2014-11-19 20:55:05 +01:00
public currentSignatureParameterCountIs ( expected : number ) {
2014-09-17 01:13:33 +02:00
FourSlash . currentTestState . verifyCurrentSignatureHelpParameterCount ( expected ) ;
2014-07-13 01:04:16 +02:00
}
2014-11-19 20:55:05 +01:00
public currentSignatureTypeParameterCountIs ( expected : number ) {
2014-09-18 22:12:14 +02:00
FourSlash . currentTestState . verifyCurrentSignatureHelpTypeParameterCount ( expected ) ;
2014-07-13 01:04:16 +02:00
}
public currentSignatureHelpIs ( expected : string ) {
2014-09-18 22:12:14 +02:00
FourSlash . currentTestState . verifyCurrentSignatureHelpIs ( expected ) ;
2014-07-13 01:04:16 +02:00
}
public numberOfErrorsInCurrentFile ( expected : number ) {
FourSlash . currentTestState . verifyNumberOfErrorsInCurrentFile ( expected ) ;
}
public baselineCurrentFileBreakpointLocations() {
FourSlash . currentTestState . baselineCurrentFileBreakpointLocations ( ) ;
}
public baselineCurrentFileNameOrDottedNameSpans() {
FourSlash . currentTestState . baselineCurrentFileNameOrDottedNameSpans ( ) ;
}
2014-09-10 02:42:53 +02:00
public baselineGetEmitOutput() {
FourSlash . currentTestState . baselineGetEmitOutput ( ) ;
}
2014-07-13 01:04:16 +02:00
public nameOrDottedNameSpanTextIs ( text : string ) {
FourSlash . currentTestState . verifyCurrentNameOrDottedNameSpanText ( text ) ;
}
public outliningSpansInCurrentFile ( spans : TextSpan [ ] ) {
FourSlash . currentTestState . verifyOutliningSpans ( spans ) ;
}
public todoCommentsInCurrentFile ( descriptors : string [ ] ) {
FourSlash . currentTestState . verifyTodoComments ( descriptors , test . ranges ( ) ) ;
}
public matchingBracePositionInCurrentFile ( bracePosition : number , expectedMatchPosition : number ) {
FourSlash . currentTestState . verifyMatchingBracePosition ( bracePosition , expectedMatchPosition ) ;
}
public noMatchingBracePositionInCurrentFile ( bracePosition : number ) {
FourSlash . currentTestState . verifyNoMatchingBracePosition ( bracePosition ) ;
}
public setVerifyDocComments ( val : boolean ) {
FourSlash . currentTestState . setVerifyDocComments ( val ) ;
}
public getScriptLexicalStructureListCount ( count : number ) {
FourSlash . currentTestState . verifyGetScriptLexicalStructureListCount ( count ) ;
}
public getScriptLexicalStructureListContains (
name : string ,
kind : string ,
fileName? : string ,
parentName? : string ,
isAdditionalSpan? : boolean ,
markerPosition? : number ) {
FourSlash . currentTestState . verifGetScriptLexicalStructureListContains (
name ,
kind ,
fileName ,
parentName ,
isAdditionalSpan ,
markerPosition ) ;
}
public navigationItemsListCount ( count : number , searchValue : string , matchKind? : string ) {
FourSlash . currentTestState . verifyNavigationItemsCount ( count , searchValue , matchKind ) ;
}
public navigationItemsListContains (
name : string ,
kind : string ,
searchValue : string ,
matchKind : string ,
fileName? : string ,
2014-12-03 23:58:15 +01:00
parentName? : string ) {
2014-07-13 01:04:16 +02:00
FourSlash . currentTestState . verifyNavigationItemsListContains (
name ,
kind ,
searchValue ,
matchKind ,
fileName ,
2014-12-03 23:58:15 +01:00
parentName ) ;
2014-07-13 01:04:16 +02:00
}
public occurrencesAtPositionContains ( range : Range , isWriteAccess? : boolean ) {
FourSlash . currentTestState . verifyOccurrencesAtPositionListContains ( range . fileName , range . start , range . end , isWriteAccess ) ;
}
public occurrencesAtPositionCount ( expectedCount : number ) {
FourSlash . currentTestState . verifyOccurrencesAtPositionListCount ( expectedCount ) ;
}
2014-09-29 18:45:03 +02:00
public completionEntryDetailIs ( entryName : string , text : string , documentation? : string , kind? : string ) {
FourSlash . currentTestState . verifyCompletionEntryDetails ( entryName , text , documentation , kind ) ;
2014-07-13 01:04:16 +02:00
}
2014-09-16 02:23:38 +02:00
2014-10-14 02:29:19 +02:00
/ * *
* This method * requires * a contiguous , complete , and ordered stream of classifications for a file .
* /
2014-09-16 02:23:38 +02:00
public syntacticClassificationsAre ( . . . classifications : { classificationType : string ; text : string } [ ] ) {
FourSlash . currentTestState . verifySyntacticClassifications ( classifications ) ;
}
2014-09-16 02:39:48 +02:00
2014-10-14 02:29:19 +02:00
/ * *
* This method * requires * an ordered stream of classifications for a file , and spans are highly recommended .
* /
public semanticClassificationsAre ( . . . classifications : { classificationType : string ; text : string ; textSpan? : TextSpan } [ ] ) {
2014-09-16 02:39:48 +02:00
FourSlash . currentTestState . verifySemanticClassifications ( classifications ) ;
}
2014-09-18 00:19:20 +02:00
public renameInfoSucceeded ( displayName? : string , fullDisplayName? : string , kind? : string , kindModifiers? : string ) {
FourSlash . currentTestState . verifyRenameInfoSucceeded ( displayName , fullDisplayName , kind , kindModifiers )
}
public renameInfoFailed ( message? : string ) {
FourSlash . currentTestState . verifyRenameInfoFailed ( message )
}
2014-10-04 00:33:29 +02:00
public renameLocations ( findInStrings : boolean , findInComments : boolean ) {
FourSlash . currentTestState . verifyRenameLocations ( findInStrings , findInComments ) ;
}
2014-10-13 23:38:18 +02:00
2014-11-21 07:36:27 +01:00
public verifyQuickInfoDisplayParts ( kind : string , kindModifiers : string , textSpan : { start : number ; length : number ; } ,
2014-11-22 02:42:27 +01:00
displayParts : ts.SymbolDisplayPart [ ] , documentation : ts.SymbolDisplayPart [ ] ) {
2014-11-21 07:36:27 +01:00
FourSlash . currentTestState . verifyQuickInfoDisplayParts ( kind , kindModifiers , textSpan , displayParts , documentation ) ;
2014-10-13 23:38:18 +02:00
}
2014-07-13 01:04:16 +02:00
}
export class edit {
public backspace ( count? : number ) {
FourSlash . currentTestState . deleteCharBehindMarker ( count ) ;
}
public deleteAtCaret ( times? : number ) {
FourSlash . currentTestState . deleteChar ( times ) ;
}
public replace ( start : number , length : number , text : string ) {
FourSlash . currentTestState . replace ( start , length , text ) ;
}
public paste ( text : string ) {
FourSlash . currentTestState . paste ( text ) ;
}
public insert ( text : string ) {
this . insertLines ( text ) ;
}
public insertLine ( text : string ) {
this . insertLines ( text + '\n' ) ;
}
public insertLines ( . . . lines : string [ ] ) {
FourSlash . currentTestState . type ( lines . join ( '\n' ) ) ;
}
public moveRight ( count? : number ) {
FourSlash . currentTestState . moveCaretRight ( count ) ;
}
public moveLeft ( count? : number ) {
if ( typeof count === 'undefined' ) {
count = 1 ;
}
FourSlash . currentTestState . moveCaretRight ( count * - 1 ) ;
}
public enableFormatting() {
FourSlash . currentTestState . enableFormatting = true ;
}
public disableFormatting() {
FourSlash . currentTestState . enableFormatting = false ;
}
}
export class debug {
public printCurrentParameterHelp() {
FourSlash . currentTestState . printCurrentParameterHelp ( ) ;
}
public printCurrentFileState() {
FourSlash . currentTestState . printCurrentFileState ( ) ;
}
public printCurrentFileStateWithWhitespace() {
FourSlash . currentTestState . printCurrentFileState ( /*withWhiteSpace=*/ true ) ;
}
public printCurrentFileStateWithoutCaret() {
FourSlash . currentTestState . printCurrentFileState ( /*withWhiteSpace=*/ false , /*withCaret=*/ false ) ;
}
public printCurrentQuickInfo() {
FourSlash . currentTestState . printCurrentQuickInfo ( ) ;
}
public printCurrentSignatureHelp() {
FourSlash . currentTestState . printCurrentSignatureHelp ( ) ;
}
public printMemberListMembers() {
FourSlash . currentTestState . printMemberListMembers ( ) ;
}
public printCompletionListMembers() {
FourSlash . currentTestState . printCompletionListMembers ( ) ;
}
public printBreakpointLocation ( pos : number ) {
FourSlash . currentTestState . printBreakpointLocation ( pos ) ;
}
public printBreakpointAtCurrentLocation() {
FourSlash . currentTestState . printBreakpointAtCurrentLocation ( ) ;
}
public printNameOrDottedNameSpans ( pos : number ) {
FourSlash . currentTestState . printNameOrDottedNameSpans ( pos ) ;
}
public printErrorList() {
FourSlash . currentTestState . printErrorList ( ) ;
}
public printNavigationItems ( searchValue : string = ".*" ) {
FourSlash . currentTestState . printNavigationItems ( searchValue ) ;
}
public printScriptLexicalStructureItems() {
FourSlash . currentTestState . printScriptLexicalStructureItems ( ) ;
}
2014-08-13 20:26:35 +02:00
public printReferences() {
FourSlash . currentTestState . printReferences ( ) ;
}
public printContext() {
FourSlash . currentTestState . printContext ( ) ;
}
2014-07-13 01:04:16 +02:00
}
export class format {
public document ( ) {
FourSlash . currentTestState . formatDocument ( ) ;
}
public selection ( startMarker : string , endMarker : string ) {
FourSlash . currentTestState . formatSelection ( FourSlash . currentTestState . getMarkerByName ( startMarker ) . position , FourSlash . currentTestState . getMarkerByName ( endMarker ) . position ) ;
}
public setOption ( name : string , value : number ) ;
public setOption ( name : string , value : string ) ;
public setOption ( name : string , value : boolean ) ;
public setOption ( name : string , value : any ) {
FourSlash . currentTestState . formatCodeOptions [ name ] = value ;
}
}
export class cancellation {
public resetCancelled() {
FourSlash . currentTestState . cancellationToken . resetCancelled ( ) ;
}
public setCancelled ( numberOfCalls : number = 0 ) {
FourSlash . currentTestState . cancellationToken . setCancelled ( numberOfCalls ) ;
}
}
2014-09-16 02:23:38 +02:00
2014-10-14 02:29:19 +02:00
export module classification {
export function comment ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "comment" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function identifier ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "identifier" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function keyword ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "keyword" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function numericLiteral ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "numericLiteral" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function operator ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "operator" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function stringLiteral ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "stringLiteral" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function whiteSpace ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "whiteSpace" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function text ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "text" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function punctuation ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "punctuation" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function className ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "className" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function enumName ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "enumName" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function interfaceName ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
2014-10-15 23:45:33 +02:00
return getClassification ( "interfaceName" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function moduleName ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
return getClassification ( "moduleName" , text , position ) ;
2014-09-16 02:23:38 +02:00
}
2014-10-14 02:29:19 +02:00
export function typeParameterName ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
return getClassification ( "typeParameterName" , text , position ) ;
}
2014-12-06 02:32:36 +01:00
export function typeAlias ( text : string , position? : number ) : { classificationType : string ; text : string ; textSpan? : TextSpan } {
return getClassification ( "typeAlias" , text , position ) ;
}
2014-10-14 02:29:19 +02:00
function getClassification ( type : string , text : string , position? : number ) {
return {
classificationType : type ,
text : text ,
textSpan : position === undefined ? undefined : { start : position , end : position + text . length }
} ;
2014-09-16 02:23:38 +02:00
}
}
2014-07-13 01:04:16 +02:00
}
module fs {
export var test = new FourSlashInterface . test_ ( ) ;
export var goTo = new FourSlashInterface . goTo ( ) ;
export var verify = new FourSlashInterface . verify ( ) ;
export var edit = new FourSlashInterface . edit ( ) ;
export var debug = new FourSlashInterface . debug ( ) ;
export var format = new FourSlashInterface . format ( ) ;
export var diagnostics = new FourSlashInterface . diagnostics ( ) ;
export var cancellation = new FourSlashInterface . cancellation ( ) ;
}
2014-11-22 02:42:27 +01:00
module ts {
export interface SymbolDisplayPart {
text : string ;
kind : string ;
}
}
2014-07-13 01:04:16 +02:00
function verifyOperationIsCancelled ( f ) {
FourSlash . verifyOperationIsCancelled ( f ) ;
}
2014-10-14 02:29:19 +02:00
2014-07-13 01:04:16 +02:00
var test = new FourSlashInterface . test_ ( ) ;
var goTo = new FourSlashInterface . goTo ( ) ;
var verify = new FourSlashInterface . verify ( ) ;
var edit = new FourSlashInterface . edit ( ) ;
var debug = new FourSlashInterface . debug ( ) ;
var format = new FourSlashInterface . format ( ) ;
var diagnostics = new FourSlashInterface . diagnostics ( ) ;
var cancellation = new FourSlashInterface . cancellation ( ) ;
2014-09-16 02:23:38 +02:00
var classification = FourSlashInterface . classification ;