Skip to content

Fix occurrence typos #4203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/harness/fourslash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2115,17 +2115,17 @@ module FourSlash {
}
}

private getOccurancesAtCurrentPosition() {
private getOccurrencesAtCurrentPosition() {
return this.languageService.getOccurrencesAtPosition(this.activeFile.fileName, this.currentCaretPosition);
}

public verifyOccurrencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) {
this.taoInvalidReason = "verifyOccurrencesAtPositionListContains NYI";

let occurrences = this.getOccurancesAtCurrentPosition();
let occurrences = this.getOccurrencesAtCurrentPosition();

if (!occurrences || occurrences.length === 0) {
this.raiseError('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.');
this.raiseError('verifyOccurrencesAtPositionListContains failed - found 0 references, expected at least one.');
}

for (let occurrence of occurrences) {
Expand All @@ -2144,7 +2144,7 @@ module FourSlash {
public verifyOccurrencesAtPositionListCount(expectedCount: number) {
this.taoInvalidReason = "verifyOccurrencesAtPositionListCount NYI";

let occurrences = this.getOccurancesAtCurrentPosition();
let occurrences = this.getOccurrencesAtCurrentPosition();
let actualCount = occurrences ? occurrences.length : 0;
if (expectedCount !== actualCount) {
this.raiseError(`verifyOccurrencesAtPositionListCount failed - actual: ${actualCount}, expected:${expectedCount}`);
Expand Down Expand Up @@ -2172,7 +2172,7 @@ module FourSlash {
for (let highlight of highlightSpans) {
if (highlight && highlight.textSpan.start === start && ts.textSpanEnd(highlight.textSpan) === end) {
if (typeof kind !== "undefined" && highlight.kind !== kind) {
this.raiseError('verifyDocumentHighlightsAtPositionListContains failed - item "kind" value does not match, actual: ' + highlight.kind + ', expected: ' + kind + '.');
this.raiseError(`verifyDocumentHighlightsAtPositionListContains failed - item "kind" value does not match, actual: ${highlight.kind}, expected: ${kind}.`);
}
return;
}
Expand All @@ -2181,7 +2181,7 @@ module FourSlash {
}

let missingItem = { fileName: fileName, start: start, end: end, kind: kind };
this.raiseError('verifyOccurancesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(documentHighlights) + ')');
this.raiseError(`verifyDocumentHighlightsAtPositionListContains failed - could not find the item: ${JSON.stringify(missingItem)} in the returned list: (${JSON.stringify(documentHighlights)})`);
}

public verifyDocumentHighlightsAtPositionListCount(expectedCount: number, fileNamesToSearch: string[]) {
Expand Down
4 changes: 2 additions & 2 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4620,7 +4620,7 @@ namespace ts {
case SyntaxKind.BreakKeyword:
case SyntaxKind.ContinueKeyword:
if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) {
return getBreakOrContinueStatementOccurences(<BreakOrContinueStatement>node.parent);
return getBreakOrContinueStatementOccurrences(<BreakOrContinueStatement>node.parent);
}
break;
case SyntaxKind.ForKeyword:
Expand Down Expand Up @@ -4946,7 +4946,7 @@ namespace ts {
return map(keywords, getHighlightSpanForNode);
}

function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] {
function getBreakOrContinueStatementOccurrences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] {
let owner = getBreakOrContinueOwner(breakOrContinueStatement);

if (owner) {
Expand Down
28 changes: 14 additions & 14 deletions tests/cases/fourslash/getOccurrencesIfElse5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
////}
////else/*13*/ { }

function verifyOccurencesAtMarker(marker: string, count: number) {
function verifyOccurrencesAtMarker(marker: string, count: number) {
goTo.marker(marker);
verify.occurrencesAtPositionCount(count);
}

verifyOccurencesAtMarker("1", 7);
verifyOccurencesAtMarker("2", 2);
verifyOccurencesAtMarker("3", 2);
verifyOccurencesAtMarker("4", 2);
verifyOccurencesAtMarker("5", 2);
verifyOccurencesAtMarker("6", 1);
verifyOccurencesAtMarker("7", 1);
verifyOccurencesAtMarker("8", 7);
verifyOccurencesAtMarker("9", 7);
verifyOccurencesAtMarker("10", 7);
verifyOccurencesAtMarker("11", 7);
verifyOccurencesAtMarker("12", 7);
verifyOccurencesAtMarker("13", 7);
verifyOccurrencesAtMarker("1", 7);
verifyOccurrencesAtMarker("2", 2);
verifyOccurrencesAtMarker("3", 2);
verifyOccurrencesAtMarker("4", 2);
verifyOccurrencesAtMarker("5", 2);
verifyOccurrencesAtMarker("6", 1);
verifyOccurrencesAtMarker("7", 1);
verifyOccurrencesAtMarker("8", 7);
verifyOccurrencesAtMarker("9", 7);
verifyOccurrencesAtMarker("10", 7);
verifyOccurrencesAtMarker("11", 7);
verifyOccurrencesAtMarker("12", 7);
verifyOccurrencesAtMarker("13", 7);
16 changes: 8 additions & 8 deletions tests/cases/fourslash/getOccurrencesReturn4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
//// return/*7*/ true;
////}

function verifyOccurencesAtMarker(marker: string, count: number) {
function verifyOccurrencesAtMarker(marker: string, count: number) {
goTo.marker(marker);
verify.occurrencesAtPositionCount(count);
}

verifyOccurencesAtMarker("1", 4);
verifyOccurencesAtMarker("2", 4);
verifyOccurencesAtMarker("3", 4);
verifyOccurencesAtMarker("4", 4);
verifyOccurencesAtMarker("5", 1);
verifyOccurencesAtMarker("6", 3);
verifyOccurencesAtMarker("7", 3);
verifyOccurrencesAtMarker("1", 4);
verifyOccurrencesAtMarker("2", 4);
verifyOccurrencesAtMarker("3", 4);
verifyOccurrencesAtMarker("4", 4);
verifyOccurrencesAtMarker("5", 1);
verifyOccurrencesAtMarker("6", 3);
verifyOccurrencesAtMarker("7", 3);
30 changes: 15 additions & 15 deletions tests/cases/fourslash/getOccurrencesSwitchCaseDefault5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
//// case 16/*14*/:
////}

function verifyOccurencesAtMarker(marker: string, count: number) {
function verifyOccurrencesAtMarker(marker: string, count: number) {
goTo.marker(marker);
verify.occurrencesAtPositionCount(count);
}

verifyOccurencesAtMarker("1", 9);
verifyOccurencesAtMarker("2", 9);
verifyOccurencesAtMarker("3", 9);
verifyOccurencesAtMarker("4", 9);
verifyOccurencesAtMarker("5", 9);
verifyOccurencesAtMarker("6", 6);
verifyOccurencesAtMarker("7", 6);
verifyOccurencesAtMarker("8", 6);
verifyOccurencesAtMarker("9", 6);
verifyOccurencesAtMarker("10", 6);
verifyOccurencesAtMarker("11", 9);
verifyOccurencesAtMarker("12", 9);
verifyOccurencesAtMarker("13", 9);
verifyOccurencesAtMarker("14", 0);
verifyOccurrencesAtMarker("1", 9);
verifyOccurrencesAtMarker("2", 9);
verifyOccurrencesAtMarker("3", 9);
verifyOccurrencesAtMarker("4", 9);
verifyOccurrencesAtMarker("5", 9);
verifyOccurrencesAtMarker("6", 6);
verifyOccurrencesAtMarker("7", 6);
verifyOccurrencesAtMarker("8", 6);
verifyOccurrencesAtMarker("9", 6);
verifyOccurrencesAtMarker("10", 6);
verifyOccurrencesAtMarker("11", 9);
verifyOccurrencesAtMarker("12", 9);
verifyOccurrencesAtMarker("13", 9);
verifyOccurrencesAtMarker("14", 0);

14 changes: 7 additions & 7 deletions tests/cases/fourslash/getOccurrencesThis6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@
////}


function verifyOccurencesAtMarker(marker: string, count: number) {
function verifyOccurrencesAtMarker(marker: string, count: number) {
goTo.marker(marker);
verify.occurrencesAtPositionCount(count);
}

verifyOccurencesAtMarker("1", 2);
verifyOccurencesAtMarker("2", 6);
verifyOccurencesAtMarker("3", 1);
verifyOccurencesAtMarker("4", 1);
verifyOccurencesAtMarker("5", 1);
verifyOccurencesAtMarker("6", 0);
verifyOccurrencesAtMarker("1", 2);
verifyOccurrencesAtMarker("2", 6);
verifyOccurrencesAtMarker("3", 1);
verifyOccurrencesAtMarker("4", 1);
verifyOccurrencesAtMarker("5", 1);
verifyOccurrencesAtMarker("6", 0);
18 changes: 9 additions & 9 deletions tests/cases/fourslash/getOccurrencesTryCatchFinally4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
////}
////finally/*7*/ {
////}
function verifyOccurencesAtMarker(marker: string, count: number) {
function verifyOccurrencesAtMarker(marker: string, count: number) {
goTo.marker(marker);
verify.occurrencesAtPositionCount(count);
}

verifyOccurencesAtMarker("1", 3);
verifyOccurencesAtMarker("2", 2);
verifyOccurencesAtMarker("3", 2);
verifyOccurencesAtMarker("4", 2);
verifyOccurencesAtMarker("5", 2);
verifyOccurencesAtMarker("6", 3);
verifyOccurencesAtMarker("7", 3);
verifyOccurencesAtMarker("8", 0);
verifyOccurrencesAtMarker("1", 3);
verifyOccurrencesAtMarker("2", 2);
verifyOccurrencesAtMarker("3", 2);
verifyOccurrencesAtMarker("4", 2);
verifyOccurrencesAtMarker("5", 2);
verifyOccurrencesAtMarker("6", 3);
verifyOccurrencesAtMarker("7", 3);
verifyOccurrencesAtMarker("8", 0);