File: completionsRecommended_namespace.ts

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (46 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// <reference path="fourslash.ts" />

// @noLib: true

// @Filename: /a.ts
////export namespace Name {
////    export class C {}
////}
////export function f(c: Name.C) {}
////f(new N/*a0*/);
////f(new /*a1*/);

// @Filename: /b.ts
////import { f } from "./a";
// Here we will recommend a new import of 'Name'
////f(new N/*b0*/);
////f(new /*b1*/);

// @Filename: /c.ts
////import * as alpha from "./a";
// Here we will recommend 'a' because it contains 'Name' which contains 'C'.
////alpha.f(new a/*c0*/);
////alpha.f(new /*c1*/);

verify.completions(
    {
        marker: ["a0", "a1"],
        includes: { name: "Name", text: "namespace Name", kind: "module", kindModifiers: "export", isRecommended: true },
    },
    {
        marker: ["b0", "b1"],
        includes: {
            name: "Name",
            source: "/a",
            sourceDisplay: "./a",
            text: "namespace Name",
            kind: "module",
            kindModifiers: "export",
            hasAction: true,
            isRecommended: true,
            sortText: completion.SortText.AutoImportSuggestions
        },
        preferences: { includeCompletionsForModuleExports: true },
    },
    { marker: ["c0", "c1"], includes: { name: "alpha", text: "import alpha", kind: "alias", isRecommended: true } },
);