mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Added tests for completion lists in export clauses.
This commit is contained in:
parent
a3aa6e8bfb
commit
443752ace7
39
tests/cases/fourslash/completionListInExportClause01.ts
Normal file
39
tests/cases/fourslash/completionListInExportClause01.ts
Normal file
@ -0,0 +1,39 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: m1.ts
|
||||
////export var foo: number = 1;
|
||||
////export function bar() { return 10; }
|
||||
////export function baz() { return 10; }
|
||||
|
||||
// @Filename: m2.ts
|
||||
////export {/*1*/, /*2*/ from "m1"
|
||||
////export {/*3*/} from "m1"
|
||||
////export {foo,/*4*/ from "m1"
|
||||
////export {bar as /*5*/, /*6*/ from "m1"
|
||||
////export {foo, bar, baz as b,/*7*/} from "m1"
|
||||
function verifyCompletionAtMarker(marker: string, showBuilder: boolean, ...completions: string[]) {
|
||||
goTo.marker(marker);
|
||||
if (completions.length) {
|
||||
for (let completion of completions) {
|
||||
verify.completionListContains(completion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
verify.completionListIsEmpty();
|
||||
}
|
||||
|
||||
if (showBuilder) {
|
||||
verify.completionListAllowsNewIdentifier();
|
||||
}
|
||||
else {
|
||||
verify.not.completionListAllowsNewIdentifier();
|
||||
}
|
||||
}
|
||||
|
||||
verifyCompletionAtMarker("1", /*showBuilder*/ false, "foo", "bar", "baz");
|
||||
verifyCompletionAtMarker("2", /*showBuilder*/ false, "foo", "bar", "baz");
|
||||
verifyCompletionAtMarker("3", /*showBuilder*/ false, "foo", "bar", "baz");
|
||||
verifyCompletionAtMarker("4", /*showBuilder*/ false, "bar", "baz");
|
||||
verifyCompletionAtMarker("5", /*showBuilder*/ true);
|
||||
verifyCompletionAtMarker("6", /*showBuilder*/ false, "foo", "baz");
|
||||
verifyCompletionAtMarker("7", /*showBuilder*/ false);
|
||||
14
tests/cases/fourslash/completionListInExportClause02.ts
Normal file
14
tests/cases/fourslash/completionListInExportClause02.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////declare module "M1" {
|
||||
//// export var V;
|
||||
////}
|
||||
////var W;
|
||||
////declare module "M2" {
|
||||
//// export { /**/ } from "M1"
|
||||
////}
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListContains("V");
|
||||
verify.not.completionListContains("W");
|
||||
verify.not.completionListAllowsNewIdentifier();
|
||||
Loading…
x
Reference in New Issue
Block a user