TypeScript/tests/cases/fourslash/navigationBarItemsSymbols4.ts
Wesley Wigham 293816875c
Support some late-bound special property assignments (#33220)
* Support some late-bound special property assignments

* Integrate PR feedback

* PR feedback

* Enable declaration on core tests

* Specialize type of binary expression used for late binding, speculative fix to navigation bar, merge check and type for elem/property accesses

* Add test showing current nav bar behavior (specifically the lack thereof)
2019-09-27 13:54:50 -07:00

95 lines
2.2 KiB
TypeScript

/// <reference path="fourslash.ts"/>
// @checkJs: true
// @allowJs: true
// @target: es6
// @Filename: file.js
////const _sym = Symbol("_sym");
////class MyClass {
//// constructor() {
//// // Dynamic assignment properties can't show up in navigation,
//// // as they're not syntactic members
//// // Additonally, late bound members are always filtered out, besides
//// this[_sym] = "ok";
//// }
////
//// method() {
//// this[_sym] = "yep";
//// const x = this[_sym];
//// }
////}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "_sym",
"kind": "const"
},
{
"text": "MyClass",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "method",
"kind": "method",
"childItems": [
{
"text": "x",
"kind": "const"
}
]
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "_sym",
"kind": "const"
},
{
"text": "MyClass",
"kind": "class"
}
]
},
{
"text": "MyClass",
"kind": "class",
"childItems": [
{
"text": "constructor",
"kind": "constructor"
},
{
"text": "method",
"kind": "method",
}
],
"indent": 1
},
{
"text": "method",
"kind": "method",
"childItems": [
{
"text": "x",
"kind": "const"
}
],
"indent": 2
}
]);