TypeScript/tests/cases/fourslash/navigationItemsSpecialPropertyAssignment.ts
Andy efc1b7df08
More thoroughly test navigateTo (#25239)
* More thoroughly test navigateTo

* Fix #25233 and #25237

* Update API (#24966)
2018-07-02 19:25:27 -07:00

42 lines
1.2 KiB
TypeScript

/// <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 }],
},
);