TypeScript/tests/cases/fourslash/navigationBarFunctionPrototype2.ts
Titian Cernicova-Dragomir fa9e0fa8e8 Better outlining spans for prototype methods (#32782)
* Changed outlining to better outline ES5 classes (functions assigned to prototype)

* Changed outlining to better outline ES5 classes (properties assigned to functions)

* Fixed some small bugs when merging es5 class nodes. Added tests for new es5 class outline.

* Added support for interlaced ES5 classes (where an ES5 class's members are mixed with other declarations).

* Fixed crash in outline when assigning {} to the prototype.

* Added support for nested es5 declarations.

* Added support for prototype assignment for es5 classes.
2019-08-29 09:19:04 -07:00

65 lines
1 KiB
TypeScript

/// <reference path="fourslash.ts"/>
// @Filename: foo.js
////A.prototype.a = function() { };
////A.prototype.b = function() { };
////function A() {}
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "A",
"kind": "class",
"childItems": [
{
"text": "a",
"kind": "function"
},
{
"text": "b",
"kind": "function"
},
{
"text": "constructor",
"kind": "constructor"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "A",
"kind": "class"
}
]
},
{
"text": "A",
"kind": "class",
"childItems": [
{
"text": "a",
"kind": "function"
},
{
"text": "b",
"kind": "function"
},
{
"text": "constructor",
"kind": "constructor"
}
],
"indent": 1
}
]);