TypeScript/tests/cases/fourslash/commentsExternalModules.ts

86 lines
3.2 KiB
TypeScript
Raw Normal View History

2014-09-30 20:58:05 +02:00
/// <reference path='fourslash.ts' />
// @Filename: commentsExternalModules_file0.ts
2015-04-27 01:12:48 +02:00
/////** Namespace comment*/
////export namespace m/*1*/1 {
2014-09-30 20:58:05 +02:00
//// /** b's comment*/
//// export var b: number;
//// /** foo's comment*/
//// function foo() {
//// return /*2*/b;
//// }
//// /** m2 comments*/
2015-04-27 01:12:48 +02:00
//// export namespace m2 {
2014-09-30 20:58:05 +02:00
//// /** class comment;*/
//// export class c {
//// };
//// /** i*/
//// export var i = new c();
//// }
//// /** exported function*/
//// export function fooExport() {
//// return f/*3q*/oo(/*3*/);
//// }
////}
/////*4*/m1./*5*/fooEx/*6q*/port(/*6*/);
////var my/*7*/var = new m1.m2./*8*/c();
// @Filename: commentsExternalModules_file1.ts
/////**This is on import declaration*/
2016-02-13 00:40:47 +01:00
////import ex/*9*/tMod = require("./commentsExternalModules_file0");
2014-09-30 20:58:05 +02:00
/////*10*/extMod./*11*/m1./*12*/fooExp/*13q*/ort(/*13*/);
////var new/*14*/Var = new extMod.m1.m2./*15*/c();
goTo.file("commentsExternalModules_file0.ts");
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("1", "namespace m1", "Namespace comment");
2014-09-30 20:58:05 +02:00
goTo.marker('2');
verify.completionListContains("b", "var b: number", "b's comment");
verify.completionListContains("foo", "function foo(): number", "foo's comment");
2014-09-30 20:58:05 +02:00
goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("foo's comment");
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("3q", "function foo(): number", "foo's comment");
2014-09-30 20:58:05 +02:00
goTo.marker('4');
2015-04-27 01:12:48 +02:00
verify.completionListContains("m1", "namespace m1", "Namespace comment");
2014-09-30 20:58:05 +02:00
goTo.marker('5');
verify.completionListContains("b", "var m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace m1.m2");
2014-09-30 20:58:05 +02:00
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("exported function");
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("6q", "function m1.fooExport(): number", "exported function");
2014-09-30 20:58:05 +02:00
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("7", "var myvar: m1.m2.c");
2014-09-30 20:58:05 +02:00
goTo.marker('8');
verify.completionListContains("c", "constructor m1.m2.c(): m1.m2.c", "");
verify.completionListContains("i", "var m1.m2.i: m1.m2.c", "i");
2014-09-30 20:58:05 +02:00
goTo.file("commentsExternalModules_file1.ts");
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("9", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration");
2014-09-30 20:58:05 +02:00
goTo.marker('10');
2016-02-13 00:40:47 +01:00
verify.completionListContains("extMod", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration");
2014-09-30 20:58:05 +02:00
goTo.marker('11');
verify.completionListContains("m1", "namespace extMod.m1");
2014-09-30 20:58:05 +02:00
goTo.marker('12');
verify.completionListContains("b", "var extMod.m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace extMod.m1.m2");
2014-09-30 20:58:05 +02:00
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("exported function");
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("13q", "function extMod.m1.fooExport(): number", "exported function");
2014-09-30 20:58:05 +02:00
2016-09-09 18:02:55 +02:00
verify.quickInfoAt("14", "var newVar: extMod.m1.m2.c");
2014-09-30 20:58:05 +02:00
goTo.marker('15');
verify.completionListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", "");
verify.completionListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i");