Merge branch 'master' into find_all_refs_primitive
This commit is contained in:
commit
36a9f6798a
201 changed files with 567 additions and 1326 deletions
|
@ -4172,7 +4172,6 @@ namespace ts {
|
|||
}
|
||||
|
||||
function getDeclaredTypeOfSymbol(symbol: Symbol): Type {
|
||||
Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0);
|
||||
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,9 @@ namespace ts {
|
|||
}
|
||||
|
||||
// More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times.
|
||||
export const collator: { compare(a: string, b: string): number } = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
|
||||
export const collator: { compare(a: string, b: string): number } = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
|
||||
// Intl is missing in Safari, and node 0.10 treats "a" as greater than "B".
|
||||
export const localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
|
||||
|
||||
/** Create a MapLike with good performance. */
|
||||
function createDictionaryObject<T>(): MapLike<T> {
|
||||
|
@ -1247,9 +1249,12 @@ namespace ts {
|
|||
if (a === undefined) return Comparison.LessThan;
|
||||
if (b === undefined) return Comparison.GreaterThan;
|
||||
if (ignoreCase) {
|
||||
if (collator && String.prototype.localeCompare) {
|
||||
// accent means a ≠ b, a ≠ á, a = A
|
||||
const result = a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" });
|
||||
// Checking if "collator exists indicates that Intl is available.
|
||||
// We still have to check if "collator.compare" is correct. If it is not, use "String.localeComapre"
|
||||
if (collator) {
|
||||
const result = localeCompareIsCorrect ?
|
||||
collator.compare(a, b) :
|
||||
a.localeCompare(b, /*locales*/ undefined, { usage: "sort", sensitivity: "accent" }); // accent means a ≠ b, a ≠ á, a = A
|
||||
return result < 0 ? Comparison.LessThan : result > 0 ? Comparison.GreaterThan : Comparison.EqualTo;
|
||||
}
|
||||
|
||||
|
|
|
@ -372,8 +372,8 @@ namespace FourSlash {
|
|||
}
|
||||
|
||||
// Entry points from fourslash.ts
|
||||
public goToMarker(name = "") {
|
||||
const marker = this.getMarkerByName(name);
|
||||
public goToMarker(name: string | Marker = "") {
|
||||
const marker = typeof name === "string" ? this.getMarkerByName(name) : name;
|
||||
if (this.activeFile.fileName !== marker.fileName) {
|
||||
this.openFile(marker.fileName);
|
||||
}
|
||||
|
@ -382,10 +382,37 @@ namespace FourSlash {
|
|||
if (marker.position === -1 || marker.position > content.length) {
|
||||
throw new Error(`Marker "${name}" has been invalidated by unrecoverable edits to the file.`);
|
||||
}
|
||||
this.lastKnownMarker = name;
|
||||
const mName = typeof name === "string" ? name : this.markerName(marker);
|
||||
this.lastKnownMarker = mName;
|
||||
this.goToPosition(marker.position);
|
||||
}
|
||||
|
||||
public goToEachMarker(action: () => void) {
|
||||
const markers = this.getMarkers();
|
||||
assert(markers.length);
|
||||
for (const marker of markers) {
|
||||
this.goToMarker(marker);
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
public goToEachRange(action: () => void) {
|
||||
const ranges = this.getRanges();
|
||||
assert(ranges.length);
|
||||
for (const range of ranges) {
|
||||
this.goToRangeStart(range);
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
private markerName(m: Marker): string {
|
||||
return ts.forEachEntry(this.testData.markerPositions, (marker, name) => {
|
||||
if (marker === m) {
|
||||
return name;
|
||||
}
|
||||
})!;
|
||||
}
|
||||
|
||||
public goToPosition(pos: number) {
|
||||
this.currentCaretPosition = pos;
|
||||
}
|
||||
|
@ -2365,6 +2392,21 @@ namespace FourSlash {
|
|||
return this.languageService.getDocumentHighlights(this.activeFile.fileName, this.currentCaretPosition, filesToSearch);
|
||||
}
|
||||
|
||||
public verifyRangesAreOccurrences(isWriteAccess?: boolean) {
|
||||
const ranges = this.getRanges();
|
||||
for (const r of ranges) {
|
||||
this.goToRangeStart(r);
|
||||
this.verifyOccurrencesAtPositionListCount(ranges.length);
|
||||
for (const range of ranges) {
|
||||
this.verifyOccurrencesAtPositionListContains(range.fileName, range.start, range.end, isWriteAccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public verifyRangesAreRenameLocations(findInStrings: boolean, findInComments: boolean) {
|
||||
this.goToEachRange(() => this.verifyRenameLocations(findInStrings, findInComments));
|
||||
}
|
||||
|
||||
public verifyRangesWithSameTextAreDocumentHighlights() {
|
||||
this.rangesByText().forEach(ranges => this.verifyRangesAreDocumentHighlights(ranges));
|
||||
}
|
||||
|
@ -3078,14 +3120,22 @@ namespace FourSlashInterface {
|
|||
// Moves the caret to the specified marker,
|
||||
// or the anonymous marker ('/**/') if no name
|
||||
// is given
|
||||
public marker(name?: string) {
|
||||
public marker(name?: string | FourSlash.Marker) {
|
||||
this.state.goToMarker(name);
|
||||
}
|
||||
|
||||
public eachMarker(action: () => void) {
|
||||
this.state.goToEachMarker(action);
|
||||
}
|
||||
|
||||
public rangeStart(range: FourSlash.Range) {
|
||||
this.state.goToRangeStart(range);
|
||||
}
|
||||
|
||||
public eachRange(action: () => void) {
|
||||
this.state.goToEachRange(action);
|
||||
}
|
||||
|
||||
public bof() {
|
||||
this.state.goToBOF();
|
||||
}
|
||||
|
@ -3436,6 +3486,14 @@ namespace FourSlashInterface {
|
|||
this.state.verifyOccurrencesAtPositionListCount(expectedCount);
|
||||
}
|
||||
|
||||
public rangesAreOccurrences(isWriteAccess?: boolean) {
|
||||
this.state.verifyRangesAreOccurrences(isWriteAccess);
|
||||
}
|
||||
|
||||
public rangesAreRenameLocations(findInStrings = false, findInComments = false) {
|
||||
this.state.verifyRangesAreRenameLocations(findInStrings, findInComments);
|
||||
}
|
||||
|
||||
public rangesAreDocumentHighlights(ranges?: FourSlash.Range[]) {
|
||||
this.state.verifyRangesAreDocumentHighlights(ranges);
|
||||
}
|
||||
|
|
|
@ -322,7 +322,7 @@ namespace ts.NavigationBar {
|
|||
function compareChildren(child1: NavigationBarNode, child2: NavigationBarNode): number {
|
||||
const name1 = tryGetName(child1.node), name2 = tryGetName(child2.node);
|
||||
if (name1 && name2) {
|
||||
const cmp = localeCompareFix(name1, name2);
|
||||
const cmp = ts.compareStringsCaseInsensitive(name1, name2);
|
||||
return cmp !== 0 ? cmp : navigationBarNodeKind(child1) - navigationBarNodeKind(child2);
|
||||
}
|
||||
else {
|
||||
|
@ -330,26 +330,6 @@ namespace ts.NavigationBar {
|
|||
}
|
||||
}
|
||||
|
||||
// Intl is missing in Safari, and node 0.10 treats "a" as greater than "B".
|
||||
const localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
|
||||
const localeCompareFix: (a: string, b: string) => number = localeCompareIsCorrect ? collator.compare : function(a, b) {
|
||||
// This isn't perfect, but it passes all of our tests.
|
||||
for (let i = 0; i < Math.min(a.length, b.length); i++) {
|
||||
const chA = a.charAt(i), chB = b.charAt(i);
|
||||
if (chA === "\"" && chB === "'") {
|
||||
return 1;
|
||||
}
|
||||
if (chA === "'" && chB === "\"") {
|
||||
return -1;
|
||||
}
|
||||
const cmp = ts.compareStrings(chA.toLocaleLowerCase(), chB.toLocaleLowerCase());
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
}
|
||||
return a.length - b.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* This differs from getItemName because this is just used for sorting.
|
||||
* We only sort nodes by name that have a more-or-less "direct" name, as opposed to `new()` and the like.
|
||||
|
|
32
tests/baselines/reference/mergedDeclarations7.errors.txt
Normal file
32
tests/baselines/reference/mergedDeclarations7.errors.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
tests/cases/compiler/test.ts(4,5): error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
|
||||
Types of property 'use' are incompatible.
|
||||
Type '() => PassportStatic' is not assignable to type '() => this'.
|
||||
Type 'PassportStatic' is not assignable to type 'this'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/passport.d.ts (0 errors) ====
|
||||
declare module 'passport' {
|
||||
namespace passport {
|
||||
interface Passport {
|
||||
use(): this;
|
||||
}
|
||||
|
||||
interface PassportStatic extends Passport {
|
||||
Passport: {new(): Passport};
|
||||
}
|
||||
}
|
||||
|
||||
const passport: passport.PassportStatic;
|
||||
export = passport;
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/test.ts (1 errors) ====
|
||||
import * as passport from "passport";
|
||||
import { Passport } from "passport";
|
||||
|
||||
let p: Passport = passport.use();
|
||||
~
|
||||
!!! error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
|
||||
!!! error TS2322: Types of property 'use' are incompatible.
|
||||
!!! error TS2322: Type '() => PassportStatic' is not assignable to type '() => this'.
|
||||
!!! error TS2322: Type 'PassportStatic' is not assignable to type 'this'.
|
28
tests/baselines/reference/mergedDeclarations7.js
Normal file
28
tests/baselines/reference/mergedDeclarations7.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
//// [tests/cases/compiler/mergedDeclarations7.ts] ////
|
||||
|
||||
//// [passport.d.ts]
|
||||
declare module 'passport' {
|
||||
namespace passport {
|
||||
interface Passport {
|
||||
use(): this;
|
||||
}
|
||||
|
||||
interface PassportStatic extends Passport {
|
||||
Passport: {new(): Passport};
|
||||
}
|
||||
}
|
||||
|
||||
const passport: passport.PassportStatic;
|
||||
export = passport;
|
||||
}
|
||||
|
||||
//// [test.ts]
|
||||
import * as passport from "passport";
|
||||
import { Passport } from "passport";
|
||||
|
||||
let p: Passport = passport.use();
|
||||
|
||||
//// [test.js]
|
||||
"use strict";
|
||||
var passport = require("passport");
|
||||
var p = passport.use();
|
21
tests/cases/compiler/mergedDeclarations7.ts
Normal file
21
tests/cases/compiler/mergedDeclarations7.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
// @filename: passport.d.ts
|
||||
declare module 'passport' {
|
||||
namespace passport {
|
||||
interface Passport {
|
||||
use(): this;
|
||||
}
|
||||
|
||||
interface PassportStatic extends Passport {
|
||||
Passport: {new(): Passport};
|
||||
}
|
||||
}
|
||||
|
||||
const passport: passport.PassportStatic;
|
||||
export = passport;
|
||||
}
|
||||
|
||||
//@filename: test.ts
|
||||
import * as passport from "passport";
|
||||
import { Passport } from "passport";
|
||||
|
||||
let p: Passport = passport.use();
|
|
@ -11,8 +11,4 @@
|
|||
|
||||
////function A</*genericName5*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -6,8 +6,4 @@
|
|||
|
||||
//// try {} catch(a/*catchVariable2*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -6,7 +6,4 @@
|
|||
|
||||
////class a/*className2*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -16,7 +16,4 @@
|
|||
|
||||
//// function func2({ a, b/*parameter2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,8 +4,4 @@
|
|||
|
||||
////enum a { /*enumValueName1*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -3,7 +3,4 @@
|
|||
////var aa = 1;
|
||||
////enum a { foo, /*enumValueName3*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -8,7 +8,4 @@
|
|||
|
||||
////var x = 0; enum /*enumName4*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -6,8 +6,4 @@
|
|||
|
||||
////function a/*functionName2*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,7 +4,4 @@
|
|||
|
||||
////interface a { /*interfaceValue1*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,7 +4,4 @@
|
|||
|
||||
////interface a { f/*interfaceValue2*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,7 +4,4 @@
|
|||
|
||||
////interface a { f; /*interfaceValue3*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -6,8 +6,4 @@
|
|||
|
||||
////interface a/*interfaceName2*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -22,8 +22,4 @@
|
|||
|
||||
////class bar10{ constructor(...a/*constructorParamter6*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
//// private a/*property7*/
|
||||
////}
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
goTo.eachMarker(() => {
|
||||
verify.not.completionListIsEmpty();
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
});
|
|
@ -11,7 +11,4 @@
|
|||
|
||||
////var a2, a/*varName4*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -25,7 +25,4 @@
|
|||
////foo;
|
||||
////var v10 = /reg/*inRegExp1*/ex/;
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//// var y : any = "", x = (a/*var5*/
|
||||
|
||||
////class C{}
|
||||
////var y = new C(
|
||||
////var y = new C(
|
||||
|
||||
//// class C{}
|
||||
//// var y = new C(0, /*var7*/
|
||||
|
@ -26,9 +26,4 @@
|
|||
|
||||
////var y = 10; y=/*var12*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
});
|
||||
|
||||
|
||||
goTo.eachMarker(() => verify.completionListAllowsNewIdentifier());
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
|
||||
////class bar7{ constructor(private a, /*constructorParamter6*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
goTo.eachMarker(() => {
|
||||
verify.not.completionListIsEmpty();
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
});
|
|
@ -10,7 +10,4 @@
|
|||
//// public static a/*property2*/
|
||||
////}
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -14,7 +14,4 @@
|
|||
//// [x/*5*/yz: number]: boolean;
|
||||
//// [/*6*/
|
||||
|
||||
for (let marker of test.markers()) {
|
||||
goTo.position(marker.position);
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
}
|
||||
goTo.eachMarker(() => verify.completionListAllowsNewIdentifier());
|
||||
|
|
|
@ -13,7 +13,4 @@
|
|||
////type T = {
|
||||
//// [xyz: /*5*/
|
||||
|
||||
for (let marker of test.markers()) {
|
||||
goTo.position(marker.position);
|
||||
verify.not.completionListAllowsNewIdentifier();
|
||||
}
|
||||
goTo.eachMarker(() => verify.not.completionListAllowsNewIdentifier());
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
////funcE({ /*E*/ });
|
||||
////funcF({ /*F*/ });
|
||||
|
||||
|
||||
for (const marker of test.markers()) {
|
||||
goTo.position(marker.position);
|
||||
goTo.eachMarker(() => {
|
||||
verify.completionListContains("hello");
|
||||
verify.completionListContains("world");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,8 +3,4 @@
|
|||
////"/*1*/ /*2*/\/*3*/
|
||||
//// /*4*/ \\/*5*/
|
||||
|
||||
test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,8 +4,4 @@
|
|||
//// /*4*/ \\\/*5*/
|
||||
//// /*6*/
|
||||
|
||||
test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -4,8 +4,4 @@
|
|||
////
|
||||
/////*6*/`asdasd${/*7*/ 2 + 1.1 /*8*/} 12312 {
|
||||
|
||||
test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListItemsCountIsGreaterThan(0)
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListItemsCountIsGreaterThan(0));
|
||||
|
|
|
@ -4,8 +4,4 @@
|
|||
////
|
||||
////`asdasd$/*7*/{ 2 + 1.1 }/*8*/ 12312 /*9*/{/*10*/
|
||||
|
||||
test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
});
|
||||
goTo.eachMarker(() => verify.completionListIsEmpty());
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
////function F(pref: (a/*1*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
goTo.eachMarker(() => {
|
||||
verify.not.completionListIsEmpty();
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
});
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
////var y : (s:string, list/*2*/
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
goTo.eachMarker(() => {
|
||||
verify.not.completionListIsEmpty();
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,12 +3,9 @@
|
|||
// @Filename: justAComment.ts
|
||||
//// // We want to check off-by-one errors in assessing the end of the comment, so we check twice,
|
||||
//// // first with a trailing space and then without.
|
||||
//// // /*0*/
|
||||
//// // /*0*/
|
||||
//// // /*1*/
|
||||
//// // We also want to check EOF handling at the end of a comment
|
||||
//// // /*2*/
|
||||
|
||||
test.markers().forEach((marker) => {
|
||||
goTo.position(marker.position);
|
||||
verify.noDocCommentTemplate();
|
||||
});
|
||||
goTo.eachMarker(() => verify.noDocCommentTemplate());
|
||||
|
|
|
@ -3,7 +3,4 @@
|
|||
// @Filename: functionDecl.ts
|
||||
////f/*0*/unction /*1*/foo/*2*/(/*3*/) /*4*/{ /*5*/}
|
||||
|
||||
test.markers().forEach((marker) => {
|
||||
goTo.position(marker.position);
|
||||
verify.noDocCommentTemplate();
|
||||
});
|
||||
goTo.eachMarker(() => verify.noDocCommentTemplate());
|
||||
|
|
|
@ -3,7 +3,4 @@
|
|||
// @Filename: regex.ts
|
||||
////var regex = /*0*///*1*/asdf/*2*/ /*3*///*4*/;
|
||||
|
||||
test.markers().forEach((marker) => {
|
||||
goTo.position(marker.position);
|
||||
verify.noDocCommentTemplate();
|
||||
});
|
||||
goTo.eachMarker(() => verify.noDocCommentTemplate());
|
||||
|
|
|
@ -117,8 +117,10 @@ declare namespace FourSlashInterface {
|
|||
markerByName(s: string): Marker;
|
||||
}
|
||||
class goTo {
|
||||
marker(name?: string): void;
|
||||
marker(name?: string | Marker): void;
|
||||
eachMarker(action: () => void): void;
|
||||
rangeStart(range: Range): void;
|
||||
eachRange(action: () => void): void;
|
||||
bof(): void;
|
||||
eof(): void;
|
||||
implementation(): void;
|
||||
|
@ -192,6 +194,8 @@ declare namespace FourSlashInterface {
|
|||
* `start` should be included in `references`.
|
||||
*/
|
||||
referencesOf(start: Range, references: Range[]): void;
|
||||
rangesAreOccurrences(isWriteAccess?: boolean): void;
|
||||
rangesAreRenameLocations(findInStrings?: boolean, findInComments?: boolean): void;
|
||||
/**
|
||||
* Performs `referencesOf` for every range on the whole set.
|
||||
* If `ranges` is omitted, this is `test.ranges()`.
|
||||
|
|
|
@ -12,13 +12,4 @@
|
|||
//// abstract bar(): void;
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(ranges.length);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
|
@ -11,16 +11,7 @@
|
|||
//// abstract bar(): void;
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(ranges.length);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker("1");
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
|
|
|
@ -13,11 +13,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -17,11 +17,4 @@
|
|||
//// public test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -17,11 +17,4 @@
|
|||
//// public test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////let A = class Foo {
|
||||
//// public static foo;
|
||||
//// public [|static|] foo;
|
||||
//// [|static|] a;
|
||||
//// constructor(public y: string, private x: string) {
|
||||
//// }
|
||||
|
@ -19,11 +19,4 @@
|
|||
//// public static test2() {}
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -46,11 +46,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -44,11 +44,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
////declare [|const|] enum E {
|
||||
////}
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
goTo.position(range.start);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachRange(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
////export [|const|] enum E {
|
||||
////}
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
goTo.position(range.start);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachRange(() => verify.occurrencesAtPositionCount(0));
|
|
@ -18,15 +18,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,15 +18,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -53,11 +53,4 @@
|
|||
//// [|declare|] function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -61,11 +61,4 @@
|
|||
////[|declare|] module dm { }
|
||||
////export class EC { }
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -53,11 +53,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -61,11 +61,4 @@
|
|||
////declare module dm { }
|
||||
////[|export|] class EC { }
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -22,15 +22,9 @@
|
|||
////}
|
||||
////[|else|] { }
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -22,11 +22,4 @@
|
|||
////}
|
||||
////else { }
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -22,11 +22,4 @@
|
|||
////}
|
||||
////else { }
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -12,13 +12,7 @@
|
|||
// It would be nice if in the future,
|
||||
// We could include that last 'else'.
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(2);
|
|
@ -18,10 +18,8 @@
|
|||
////[|{| "isWriteAccess": true |}x|] += 1;
|
||||
////[|{| "isWriteAccess": true |}x|] <<= 1;
|
||||
|
||||
goTo.rangeStart(test.ranges()[0]);
|
||||
|
||||
var firstRange = test.ranges()[0];
|
||||
goTo.position(firstRange.start, firstRange.fileName);
|
||||
|
||||
test.ranges().forEach((range) => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, range.marker.data.isWriteAccess);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// break label1;
|
||||
//// continue label1;
|
||||
|
@ -63,17 +63,10 @@
|
|||
////
|
||||
////label7: while (true) continue label5;
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// break label1;
|
||||
//// continue label1;
|
||||
|
@ -63,17 +63,10 @@
|
|||
////
|
||||
////label7: while (true) continue label5;
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// break label1;
|
||||
//// continue label1;
|
||||
|
@ -63,16 +63,9 @@
|
|||
////
|
||||
////label7: while (true) continue label5;
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// [|continue|];
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// break label1;
|
||||
//// continue label1;
|
||||
|
@ -63,17 +63,10 @@
|
|||
////
|
||||
////label7: while (true) continue label5;
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// break label1;
|
||||
//// continue label1;
|
||||
|
@ -63,17 +63,10 @@
|
|||
////
|
||||
////label7: while (true) continue label5;
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// br/*5*/eak label1;
|
||||
//// co/*6*/ntinue label1;
|
||||
|
@ -63,8 +63,4 @@
|
|||
////
|
||||
////label7: while (true) co/*10*/ntinue label5;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachMarker(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
//// default:
|
||||
//// continue;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// // these cross function boundaries
|
||||
//// br/*5*/eak label1;
|
||||
//// co/*6*/ntinue label1;
|
||||
|
@ -63,8 +63,4 @@
|
|||
////
|
||||
////label7: while (true) co/*10*/ntinue label5;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachMarker(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -34,8 +34,4 @@
|
|||
////[|public|] [|static|] [|protected|] [|private|] f;
|
||||
////[|protected|] [|static|] [|public|] g;
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachRange(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -5,12 +5,4 @@
|
|||
//// return 0;
|
||||
////})
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(2);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences();
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -15,11 +15,5 @@
|
|||
////}
|
||||
////
|
||||
////(new C()).[|abc|];
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range);
|
||||
});
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
});
|
||||
verify.rangesAreOccurrences();
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -19,15 +19,9 @@
|
|||
//// [|return|] true;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,15 +19,9 @@
|
|||
//// return true;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,10 +19,4 @@
|
|||
//// return true;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -26,17 +26,11 @@
|
|||
//// r/*4*/eturn 8675309;
|
||||
////}
|
||||
|
||||
// Note: For this test, these 'return's get highlighted as a result of a parse recovery
|
||||
// Note: For this test, these 'return's get highlighted as a result of a parse recovery
|
||||
// where if an arrow function starts with a statement, we try to parse a body
|
||||
// as if it was missing curly braces. If the behavior changes in the future,
|
||||
// a change to this test is very much welcome.
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
for (var i = 1; i <= test.markers().length; i++) {
|
||||
goTo.marker("" + i);
|
||||
|
|
|
@ -23,12 +23,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -23,12 +23,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -23,12 +23,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -54,11 +54,4 @@
|
|||
//// declare function foo(): string;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -3,11 +3,4 @@
|
|||
////function foo(a: "[|option 1|]") { }
|
||||
////foo("[|option 1|]");
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
|
||||
for (let range of ranges) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
}
|
||||
}
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -3,8 +3,4 @@
|
|||
////var x = "[|string|]";
|
||||
////function f(a = "[|initial value|]") { }
|
||||
|
||||
const ranges = test.ranges();
|
||||
for (let r of ranges) {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(1);
|
||||
}
|
||||
goTo.eachRange(() => verify.occurrencesAtPositionCount(1));
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
////
|
||||
//// public method3() {
|
||||
//// var x = () => [|super|].superMethod();
|
||||
////
|
||||
////
|
||||
//// // Bad but still gets highlighted
|
||||
//// function f() {
|
||||
//// [|super|].superMethod();
|
||||
|
@ -50,15 +50,9 @@
|
|||
//// static super = 20;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
////
|
||||
//// public method3() {
|
||||
//// var x = () => super.superMethod();
|
||||
////
|
||||
////
|
||||
//// // Bad but still gets highlighted
|
||||
//// function f() {
|
||||
//// super.superMethod();
|
||||
|
@ -50,15 +50,9 @@
|
|||
//// static super = 20;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
////}
|
||||
|
||||
function checkRange(r: FourSlashInterface.Range, expectedOccurences: FourSlashInterface.Range[]): void {
|
||||
goTo.position(r.start);
|
||||
goTo.rangeStart(r);
|
||||
if (expectedOccurences.length) {
|
||||
for (const expected of expectedOccurences) {
|
||||
verify.occurrencesAtPositionContains(expected);
|
||||
|
|
|
@ -20,8 +20,4 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
goTo.eachRange(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -18,12 +18,4 @@
|
|||
//// [|case|] 16:
|
||||
////}
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -18,12 +18,4 @@
|
|||
//// case 16:
|
||||
////}
|
||||
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -16,11 +16,4 @@
|
|||
//// [|break|];
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
|
|
@ -10,16 +10,5 @@
|
|||
//// contin/*2*/ue foo;
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
verify.occurrencesAtPositionCount(test.ranges().length);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.occurrencesAtPositionCount(0);
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
goTo.eachMarker(() => verify.occurrencesAtPositionCount(0));
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
//// }
|
||||
////
|
||||
//// public static staticB = this.staticMethod1;
|
||||
////
|
||||
////
|
||||
//// public static staticMethod1() {
|
||||
//// this;
|
||||
//// this;
|
||||
|
@ -140,15 +140,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
//// }
|
||||
////
|
||||
//// public static staticB = this.staticMethod1;
|
||||
////
|
||||
////
|
||||
//// public static staticMethod1() {
|
||||
//// this;
|
||||
//// this;
|
||||
|
@ -140,15 +140,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
//// }
|
||||
////
|
||||
//// public static staticB = this.staticMethod1;
|
||||
////
|
||||
////
|
||||
//// public static staticMethod1() {
|
||||
//// this;
|
||||
//// this;
|
||||
|
@ -140,15 +140,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
//// }
|
||||
////
|
||||
//// public static staticB = this.staticMethod1;
|
||||
////
|
||||
////
|
||||
//// public static staticMethod1() {
|
||||
//// this;
|
||||
//// this;
|
||||
|
@ -140,15 +140,9 @@
|
|||
//// }
|
||||
////}
|
||||
|
||||
test.ranges().forEach(r => {
|
||||
goTo.position(r.start);
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
});
|
||||
verify.rangesAreOccurrences(false);
|
||||
|
||||
goTo.marker();
|
||||
test.ranges().forEach(range => {
|
||||
for (const range of test.ranges()) {
|
||||
verify.occurrencesAtPositionContains(range, false);
|
||||
});
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue