2016-10-04 01:29:06 +02:00
/// <reference path='fourslash.ts'/>
2016-10-15 01:04:51 +02:00
// @Filename: file.ts
////export var x = 10;
////export var y = 10;
////export default class C {
////}
// @Filename: a.ts
////import { /*1*/ } from "./file.ts"; // no globals in imports - export found
2016-10-05 22:32:12 +02:00
//@Filename: file.tsx
2016-10-15 01:04:51 +02:00
/////// <reference path="/*2*/..\services\services.ts" /> // no globals in reference paths
////import { /*3*/ } from "./file1.ts"; // no globals in imports - export not found
////var test = "/*4*/"; // no globals in strings
/////*5*/class A { // insert globals
2016-10-04 01:29:06 +02:00
//// foo(): string { return ''; }
////}
////
2016-10-15 01:04:51 +02:00
////class /*6*/B extends A { // no globals after class keyword
2016-10-04 01:29:06 +02:00
//// bar(): string {
2016-10-15 01:04:51 +02:00
//// /*7*/ // insert globals
2016-10-04 01:29:06 +02:00
//// return '';
//// }
////}
////
2016-10-15 01:04:51 +02:00
////class C</*8*/ U extends A, T extends A> { // no globals at beginning of generics
2016-10-04 01:29:06 +02:00
//// x: U;
2016-10-15 01:04:51 +02:00
//// y = this./*9*/x; // no globals inserted for member completions
//// /*10*/ // insert globals
2016-10-04 01:29:06 +02:00
////}
2016-10-15 01:04:51 +02:00
/////*11*/ // insert globals
////const y = <div /*12*/ />; // no globals in jsx attribute found
////const z = <div =/*13*/ />; // no globals in jsx attribute with syntax error
////const x = `/*14*/ ${/*15*/}`; // globals only in template expression
2016-10-18 23:04:21 +02:00
////var user = </*16*/User name=/*17*/{ /*18*/window.isLoggedIn ? window.name : '/*19*/'} />; // globals only in JSX expression (but not in JSX expression strings)
2016-10-04 01:29:06 +02:00
goTo . marker ( "1" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "2" ) ;
2016-10-04 21:48:44 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-04 01:29:06 +02:00
goTo . marker ( "3" ) ;
2016-10-04 21:48:44 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-04 01:29:06 +02:00
goTo . marker ( "4" ) ;
2016-10-04 21:48:44 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-15 01:04:51 +02:00
goTo . marker ( "5" ) ;
2016-10-04 01:29:06 +02:00
verify . completionListIsGlobal ( true ) ;
2016-10-15 01:04:51 +02:00
goTo . marker ( "6" ) ;
2016-10-04 21:48:44 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-15 01:04:51 +02:00
goTo . marker ( "7" ) ;
2017-08-05 01:10:33 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-04 01:29:06 +02:00
goTo . marker ( "8" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "9" ) ;
2016-10-15 01:04:51 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-04 01:29:06 +02:00
goTo . marker ( "10" ) ;
2017-04-28 00:46:07 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-05 22:32:12 +02:00
goTo . marker ( "11" ) ;
2016-10-15 01:04:51 +02:00
verify . completionListIsGlobal ( true ) ;
goTo . marker ( "12" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "13" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "14" ) ;
2016-10-05 22:32:12 +02:00
verify . completionListIsGlobal ( false ) ;
2016-10-15 01:04:51 +02:00
goTo . marker ( "15" ) ;
2016-10-18 23:04:21 +02:00
verify . completionListIsGlobal ( true ) ;
goTo . marker ( "16" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "17" ) ;
verify . completionListIsGlobal ( false ) ;
goTo . marker ( "18" ) ;
verify . completionListIsGlobal ( true ) ;
goTo . marker ( "19" ) ;
verify . completionListIsGlobal ( false ) ;