File: navigationItemsSpecialPropertyAssignment.ts

package info (click to toggle)
node-typescript 4.8.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 523,068 kB
  • sloc: javascript: 1,735,777; makefile: 7; sh: 1
file content (41 lines) | stat: -rw-r--r-- 1,236 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
/// <reference path="fourslash.ts"/>

// @noLib: true
// @allowJs: true

// @Filename: /a.js
////[|exports.x = 0|];
////[|exports.y = function() {}|];
////function Cls() {
////    [|this.instanceProp = 0|];
////}
////[|Cls.staticMethod = function() {}|];
////[|Cls.staticProperty = 0|];
////[|Cls.prototype.instanceMethod = function() {}|];

const [rX, rY0, rInstanceProp, rStaticMethod, rStaticProp, rInstanceMethod] = test.ranges();
verify.navigateTo(
    { pattern: "x", expected: [{ name: "x", kind: "const", range: rX }] },
    {
        pattern: "y",
        expected: [{ name: "y", kind: "function", range: rY0 }],
    },
    {
        pattern: "instanceProp",
        expected: [
            { name: "instanceProp", kind: "property", range: rInstanceProp, containerName: "Cls", containerKind: "function" },
        ],
    },
    {
        pattern: "staticMethod",
        expected: [{ name: "staticMethod", kind: "method", range: rStaticMethod }],
    },
    {
        pattern: "staticProperty",
        expected: [{ name: "staticProperty", kind: "property", range: rStaticProp }],
    },
    {
        pattern: "instanceMethod",
        expected: [{ name: "instanceMethod", kind: "method", range: rInstanceMethod }],
    },
);