2015-03-02 23:41:44 +01:00
|
|
|
/// <reference path='fourslash.ts'/>
|
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
// @noLib: true
|
|
|
|
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod1 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// var mod1var = 1;
|
|
|
|
//// function mod1fn() {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// class mod1cls {
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// interface mod1int {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// namespace mod1mod {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// var m1X = 1;
|
|
|
|
//// function m1Func() {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// class m1Class {
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// interface m1Int {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
|
|
|
//// export var m1eX = 1;
|
|
|
|
//// export function m1eFunc() {
|
|
|
|
//// }
|
|
|
|
//// export class m1eClass {
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// export interface m1eInt {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// namespace m1Mod { }
|
|
|
|
//// export namespace m1eMod { }
|
2015-03-02 23:41:44 +01:00
|
|
|
//// }
|
|
|
|
//// export var mod1evar = 1;
|
|
|
|
//// export function mod1efn() {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// export class mod1ecls {
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// export interface mod1eint {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// export namespace mod1emod {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// var mX = 1;
|
|
|
|
//// function mFunc() {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// class mClass {
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// interface mInt {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
|
|
|
//// export var meX = 1;
|
|
|
|
//// export function meFunc() {
|
|
|
|
//// }
|
|
|
|
//// export class meClass {
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// export interface meInt {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// namespace mMod { }
|
|
|
|
//// export namespace meMod { }
|
2015-03-02 23:41:44 +01:00
|
|
|
//// }
|
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////// EXTENDING NAMESPACE 1
|
|
|
|
////namespace mod1 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// export var mod1eexvar = 1;
|
|
|
|
//// var mod1exvar = 2;
|
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod2 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// var mod2var = "shadow";
|
|
|
|
//// function mod2fn() {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// class mod2cls {
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// namespace mod2mod { }
|
2015-03-02 23:41:44 +01:00
|
|
|
//// interface mod2int {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
|
|
|
//// export var mod2evar = 1;
|
|
|
|
//// export function mod2efn() {
|
|
|
|
//// }
|
|
|
|
//// export class mod2ecls {
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// export interface mod2eint {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// bar: any;
|
|
|
|
//// foob(bar: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// export namespace mod2emod { }
|
2015-03-02 23:41:44 +01:00
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod2 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// export var mod2eexvar = 1;
|
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod3 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// var shwvar = "shadow";
|
|
|
|
//// function shwfn(shadow: any) {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob() { }
|
|
|
|
//// }
|
|
|
|
//// class shwcls {
|
|
|
|
//// constructor(public shadow: any) { }
|
|
|
|
//// private cVar = 1;
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// interface shwint {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// sivar: string;
|
|
|
|
//// sifn(shadow: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// /*shadowNamespaceWithNoExport*/
|
2017-05-25 00:24:49 +02:00
|
|
|
//// var tmp: /*shadowNamespaceWithNoExportType*/
|
2015-03-02 23:41:44 +01:00
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod4 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// export var shwvar = "shadow";
|
|
|
|
//// export function shwfn(shadow: any) {
|
|
|
|
//// var bar = 1;
|
|
|
|
//// function foob(){ }
|
|
|
|
//// }
|
|
|
|
//// export class shwcls {
|
|
|
|
//// constructor(shadow: any) { }
|
|
|
|
//// public cFunc() { }
|
|
|
|
//// public ceFunc() { }
|
|
|
|
//// public ceVar = 1;
|
|
|
|
//// static csVar = 1;
|
|
|
|
//// static csFunc() { }
|
|
|
|
//// }
|
|
|
|
//// export interface shwint {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// sivar: string;
|
|
|
|
//// sifn(shadow: any): any;
|
|
|
|
//// }
|
2015-04-27 01:12:48 +02:00
|
|
|
//// /*shadowNamespaceWithExport*/
|
2017-05-25 00:24:49 +02:00
|
|
|
//// var tmp: /*shadowNamespaceWithExportType*/
|
2015-03-02 23:41:44 +01:00
|
|
|
////}
|
|
|
|
////
|
2015-04-27 01:12:48 +02:00
|
|
|
////namespace mod5 {
|
2015-03-02 23:41:44 +01:00
|
|
|
//// import Mod1 = mod1;
|
|
|
|
//// import iMod1 = mod1.mod1emod;
|
2015-04-27 01:12:48 +02:00
|
|
|
//// /*namespaceWithImport*/
|
2017-05-25 00:24:49 +02:00
|
|
|
//// var tmp: /*namespaceWithImportType*/
|
2015-03-02 23:41:44 +01:00
|
|
|
////}
|
|
|
|
////
|
|
|
|
////function shwfn() {
|
|
|
|
//// var sfvar = 1;
|
|
|
|
//// function sffn() { }
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////class shwcls {
|
|
|
|
//// private scvar = 1;
|
|
|
|
//// private scfn() { }
|
|
|
|
//// public scpfn() { }
|
|
|
|
//// public scpvar = 1;
|
|
|
|
//// static scsvar = 1;
|
|
|
|
//// static scsfn() { }
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////interface shwint {
|
|
|
|
//// (bar: any): any;
|
|
|
|
//// new (bar: any): any;
|
|
|
|
//// sivar: any;
|
|
|
|
//// sifn(bar: any): any;
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////var shwvar = 1;
|
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
const commonValues: ReadonlyArray<FourSlashInterface.ExpectedCompletionEntry> =
|
|
|
|
[1, 2, 3, 4, 5].map(n => ({ name: `mod${n}`, text: `namespace mod${n}` }));
|
|
|
|
const commonTypes: ReadonlyArray<FourSlashInterface.ExpectedCompletionEntry> =
|
|
|
|
[1, 2, 4].map(n => ({ name: `mod${n}`, text: `namespace mod${n}` }));
|
2017-05-25 00:24:49 +02:00
|
|
|
|
2018-10-29 18:03:25 +01:00
|
|
|
verify.completions(
|
|
|
|
{
|
|
|
|
marker: ["shadowNamespaceWithNoExport", "shadowNamespaceWithExport"],
|
|
|
|
exact: [
|
|
|
|
{ name: "shwfn", text: "function shwfn(shadow: any): void" },
|
|
|
|
{ name: "shwvar", text: "var shwvar: string" },
|
|
|
|
{ name: "shwcls", text: "class shwcls" },
|
|
|
|
"tmp",
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.globalThisEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
...commonValues,
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.undefinedVarEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
...completion.statementKeywordsWithTypes,
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
marker: ["shadowNamespaceWithNoExportType", "shadowNamespaceWithExportType"],
|
|
|
|
exact: [
|
|
|
|
{ name: "shwcls", text: "class shwcls" },
|
|
|
|
{ name: "shwint", text: "interface shwint" },
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.globalThisEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
...commonTypes,
|
|
|
|
...completion.typeKeywords,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "namespaceWithImport",
|
|
|
|
exact: [
|
|
|
|
"Mod1",
|
|
|
|
"iMod1",
|
|
|
|
"tmp",
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.globalThisEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
{ name: "shwfn", text: "function shwfn(): void" },
|
|
|
|
...commonValues,
|
|
|
|
{ name: "shwcls", text: "class shwcls" },
|
|
|
|
{ name: "shwvar", text: "var shwvar: number" },
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.undefinedVarEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
...completion.statementKeywordsWithTypes,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "namespaceWithImportType",
|
|
|
|
exact: [
|
|
|
|
"Mod1",
|
|
|
|
"iMod1",
|
2019-05-16 23:46:10 +02:00
|
|
|
completion.globalThisEntry,
|
2018-10-29 18:03:25 +01:00
|
|
|
...commonTypes,
|
|
|
|
{ name: "shwcls", text: "class shwcls" },
|
|
|
|
{ name: "shwint", text: "interface shwint" },
|
|
|
|
...completion.typeKeywords,
|
|
|
|
],
|
2017-05-25 00:24:49 +02:00
|
|
|
}
|
2018-10-29 18:03:25 +01:00
|
|
|
);
|