2019-03-14 21:58:57 +01:00
|
|
|
///<reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// @allowJs: true
|
|
|
|
// @Filename: /Foo.js
|
|
|
|
//// /*global*/
|
|
|
|
////class classA {
|
|
|
|
//// /*class*/
|
|
|
|
////}
|
|
|
|
////class Test7 {
|
|
|
|
//// constructor(/*constructorParameter*/){}
|
|
|
|
////}
|
|
|
|
////function foo() {
|
|
|
|
/////*insideFunction*/
|
|
|
|
////}
|
2019-05-16 23:46:10 +02:00
|
|
|
const warnings = [
|
|
|
|
{ name: "classA", sortText: completion.SortText.JavascriptIdentifiers },
|
|
|
|
{ name: "Test7", sortText: completion.SortText.JavascriptIdentifiers },
|
|
|
|
{ name: "foo", sortText: completion.SortText.JavascriptIdentifiers }
|
|
|
|
];
|
2019-03-14 21:58:57 +01:00
|
|
|
verify.completions(
|
|
|
|
{ marker: "global", exact: completion.globalsInJsPlus(["foo", "classA", "Test7"]) },
|
2019-05-16 23:46:10 +02:00
|
|
|
{
|
|
|
|
marker: "class",
|
|
|
|
isNewIdentifierLocation: true,
|
|
|
|
exact: [
|
|
|
|
...warnings,
|
|
|
|
...completion.classElementInJsKeywords
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
marker: "constructorParameter",
|
|
|
|
isNewIdentifierLocation: true,
|
|
|
|
exact: warnings
|
|
|
|
},
|
2019-03-14 21:58:57 +01:00
|
|
|
{ marker: "insideFunction", exact: completion.globalsInJsInsideFunction(["foo", "classA", "Test7"]) },
|
2019-05-16 23:46:10 +02:00
|
|
|
);
|