Skip to content

Commit 4a37fd7

Browse files
committedSep 14, 2016
More PR feedback
1 parent f91a123 commit 4a37fd7

File tree

51 files changed

+192
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+192
-225
lines changed
 

Diff for: ‎src/harness/fourslash.ts

+14-18
Original file line numberDiff line numberDiff line change
@@ -1680,13 +1680,13 @@ namespace FourSlash {
16801680
assertFn(actualCount, expectedCount, this.messageAtLastKnownMarker("Type definitions Count"));
16811681
}
16821682

1683-
public verifyImplementationsCount(negative: boolean, expectedCount: number) {
1683+
public verifyImplementationListIsEmpty(negative: boolean) {
16841684
const assertFn = negative ? assert.notEqual : assert.equal;
16851685

16861686
const implementations = this.languageService.getImplementationAtPosition(this.activeFile.fileName, this.currentCaretPosition);
16871687
const actualCount = implementations && implementations.length || 0;
16881688

1689-
assertFn(actualCount, expectedCount, this.messageAtLastKnownMarker("Implementations Count"));
1689+
assertFn(actualCount, 0, this.messageAtLastKnownMarker("Implementations Count"));
16901690
}
16911691

16921692
public verifyGoToDefinitionName(expectedName: string, expectedContainerName: string) {
@@ -1697,26 +1697,22 @@ namespace FourSlash {
16971697
assert.equal(actualDefinitionContainerName, expectedContainerName, this.messageAtLastKnownMarker("Definition Info Container Name"));
16981698
}
16991699

1700-
public goToImplementation(implIndex?: number) {
1700+
public goToImplementation() {
17011701
const implementations = this.languageService.getImplementationAtPosition(this.activeFile.fileName, this.currentCaretPosition);
17021702
if (!implementations || !implementations.length) {
17031703
this.raiseError("goToImplementation failed - expected to find at least one implementation location but got 0");
17041704
}
1705-
1706-
if (implIndex === undefined && implementations.length > 1) {
1707-
this.raiseError(`goToImplementation failed - no index given but more than 1 implementation returned (${implementations.length})`);
1708-
}
1709-
1710-
if (implIndex >= implementations.length) {
1711-
this.raiseError(`goToImplementation failed - implIndex value (${implIndex}) exceeds implementation list size (${implementations.length})`);
1705+
if (implementations.length > 1) {
1706+
this.raiseError(`goToImplementation failed - more than 1 implementation returned (${implementations.length})`);
17121707
}
17131708

1714-
const implementation = implementations[implIndex || 0];
1709+
const implementation = implementations[0];
17151710
this.openFile(implementation.fileName);
17161711
this.currentCaretPosition = implementation.textSpan.start;
17171712
}
17181713

1719-
public verifyRangesInImplementationList() {
1714+
public verifyRangesInImplementationList(markerName: string) {
1715+
this.goToMarker(markerName);
17201716
const implementations: ImplementationLocationInformation[] = this.languageService.getImplementationAtPosition(this.activeFile.fileName, this.currentCaretPosition);
17211717
if (!implementations || !implementations.length) {
17221718
this.raiseError("verifyRangesInImplementationList failed - expected to find at least one implementation location but got 0");
@@ -2954,8 +2950,8 @@ namespace FourSlashInterface {
29542950
this.state.goToTypeDefinition(definitionIndex);
29552951
}
29562952

2957-
public implementation(implementationIndex?: number) {
2958-
this.state.goToImplementation(implementationIndex);
2953+
public implementation() {
2954+
this.state.goToImplementation();
29592955
}
29602956

29612957
public position(position: number, fileIndex?: number): void;
@@ -3062,8 +3058,8 @@ namespace FourSlashInterface {
30623058
this.state.verifyTypeDefinitionsCount(this.negative, expectedCount);
30633059
}
30643060

3065-
public implementationCountIs(expectedCount: number) {
3066-
this.state.verifyImplementationsCount(this.negative, expectedCount);
3061+
public implementationListIsEmpty() {
3062+
this.state.verifyImplementationListIsEmpty(this.negative);
30673063
}
30683064

30693065
public isValidBraceCompletionAtPosition(openingBrace: string) {
@@ -3319,8 +3315,8 @@ namespace FourSlashInterface {
33193315
this.state.verifyProjectInfo(expected);
33203316
}
33213317

3322-
public allRangesAppearInImplementationList() {
3323-
this.state.verifyRangesInImplementationList();
3318+
public allRangesAppearInImplementationList(markerName: string) {
3319+
this.state.verifyRangesInImplementationList(markerName);
33243320
}
33253321
}
33263322

Diff for: ‎src/services/services.ts

+84-85
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)