2015-10-15 02:36:03 +02:00
|
|
|
///<reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// Invocations of 'require' stop top-level variables from becoming global
|
|
|
|
|
2015-11-13 22:44:57 +01:00
|
|
|
// @allowJs: true
|
2015-10-15 02:36:03 +02:00
|
|
|
|
|
|
|
// @Filename: mod1.js
|
|
|
|
//// var x = require('fs');
|
|
|
|
//// /*1*/
|
|
|
|
|
|
|
|
// @Filename: mod2.js
|
|
|
|
//// var y;
|
|
|
|
//// if(true) {
|
|
|
|
//// y = require('fs');
|
2018-05-01 22:00:13 +02:00
|
|
|
//// }
|
2015-10-15 02:36:03 +02:00
|
|
|
//// /*2*/
|
|
|
|
|
|
|
|
// @Filename: glob1.js
|
|
|
|
//// var a = require;
|
|
|
|
//// /*3*/
|
|
|
|
|
|
|
|
// @Filename: glob2.js
|
|
|
|
//// var b = '';
|
|
|
|
//// /*4*/
|
|
|
|
|
|
|
|
// @Filename: consumer.js
|
|
|
|
//// /*5*/
|
|
|
|
|
2018-05-01 22:00:13 +02:00
|
|
|
verify.completions(
|
2019-05-16 23:46:10 +02:00
|
|
|
{
|
|
|
|
marker: "1",
|
|
|
|
includes: [
|
|
|
|
"x",
|
|
|
|
{ name: "a", sortText: completion.SortText.GlobalsOrKeywords },
|
|
|
|
{ name: "b", sortText: completion.SortText.GlobalsOrKeywords }
|
|
|
|
], excludes: "y"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "2",
|
|
|
|
includes: [
|
|
|
|
"y",
|
|
|
|
{ name: "a", sortText: completion.SortText.GlobalsOrKeywords },
|
|
|
|
{ name: "b", sortText: completion.SortText.GlobalsOrKeywords }
|
|
|
|
],
|
|
|
|
excludes: "x"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "3",
|
|
|
|
includes: [
|
|
|
|
"a",
|
|
|
|
{ name: "b", sortText: completion.SortText.GlobalsOrKeywords }
|
|
|
|
],
|
|
|
|
excludes: ["x", "y"]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "4",
|
|
|
|
includes: [
|
|
|
|
{ name: "a", sortText: completion.SortText.GlobalsOrKeywords },
|
|
|
|
"b"
|
|
|
|
],
|
|
|
|
excludes: ["x", "y"]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: ["5"],
|
|
|
|
includes: [
|
|
|
|
{ name: "a", sortText: completion.SortText.GlobalsOrKeywords },
|
|
|
|
{ name: "b", sortText: completion.SortText.GlobalsOrKeywords }
|
|
|
|
],
|
|
|
|
excludes: ["x", "y"]
|
|
|
|
},
|
2018-05-01 22:00:13 +02:00
|
|
|
);
|