mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Implement getScope
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global variable reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////var /*1*/global = 2;
|
||||
////
|
||||
////class foo {
|
||||
//// constructor (public global) { }
|
||||
//// public f(global) { }
|
||||
//// public f2(global) { }
|
||||
////}
|
||||
////
|
||||
////class bar {
|
||||
//// constructor () {
|
||||
//// var n = global;
|
||||
////
|
||||
//// var f = new foo('');
|
||||
//// f.global = '';
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////var k = global;
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = global;
|
||||
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global variable reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////var /*1*/global = 2;
|
||||
////
|
||||
////class foo {
|
||||
//// constructor (public global) { }
|
||||
//// public f(global) { }
|
||||
//// public f2(global) { }
|
||||
////}
|
||||
////
|
||||
////class bar {
|
||||
//// constructor () {
|
||||
//// var n = global;
|
||||
////
|
||||
//// var f = new foo('');
|
||||
//// f.global = '';
|
||||
//// }
|
||||
////}
|
||||
////
|
||||
////var k = global;
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = global;
|
||||
|
||||
// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed
|
||||
edit.insert('');
|
||||
|
||||
goTo.marker("1");
|
||||
edit.insert('');
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(4);
|
||||
17
tests/cases/fourslash/referencesForGlobals2.ts
Normal file
17
tests/cases/fourslash/referencesForGlobals2.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global class reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////class /*2*/globalClass {
|
||||
//// public f() { }
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var c = /*1*/globalClass();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
17
tests/cases/fourslash/referencesForGlobals3.ts
Normal file
17
tests/cases/fourslash/referencesForGlobals3.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global interface reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////interface /*2*/globalInterface {
|
||||
//// f();
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var i: /*1*/globalInterface;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
17
tests/cases/fourslash/referencesForGlobals4.ts
Normal file
17
tests/cases/fourslash/referencesForGlobals4.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global module reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////module /*2*/globalModule {
|
||||
//// export f() { };
|
||||
////}
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = /*1*/globalModule;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
19
tests/cases/fourslash/referencesForGlobals5.ts
Normal file
19
tests/cases/fourslash/referencesForGlobals5.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// Global module reference.
|
||||
|
||||
// @Filename: referencesForGlobals_1.ts
|
||||
////module globalModule {
|
||||
//// export var x;
|
||||
////}
|
||||
////
|
||||
////import /*2*/globalAlias = globalModule;
|
||||
|
||||
// @Filename: referencesForGlobals_2.ts
|
||||
////var m = /*1*/globalAlias;
|
||||
|
||||
goTo.marker("1");
|
||||
verify.referencesCountIs(2);
|
||||
|
||||
goTo.marker("2");
|
||||
verify.referencesCountIs(2);
|
||||
Reference in New Issue
Block a user