Intellisense should offer "constructor" property (Javascript)
Type: Feature Request
The intellisense (autocomplete) when used in the context of an ES6 class does not offer the constructor property when referenced from the this reference:
Conversely, this property is available after a simple object has been created:
VS Code version: Code 1.100.2 (848b80aeb52026648a8ff9f7c45a9b0a80641e2e, 2025-05-14T21:47:40.416Z) OS version: Windows_NT x64 10.0.19045 Modes: Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2
This is intentional; many rarely-used things (specifically from Object) are not shown by default
Ok, but unless I'm misreading the docs, there is literally only one property of Object that's not deprecated, and that's the constructor property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#instance_properties
I don't know if I fully understand how "rarely-used" is determined, but personally I use this property a lot (referenced from the this pointer) in the context of inheritance.
What petition do I need to sign to have this removed from the "rarely-used" list 🙂
hasOwnProperty, propertyIsEnumerable, isPrototypeOf are also things you can access on any Object.
yes.. these are methods on object instances, but afaik constructor is the only instance-scoped "property" inherited by all objects.
Regardless, I think I'm suggesting the rubric for "rarely-used" could be made configurable, or at least published. Perhaps a way to override this behavior in jsconfig.json?
Maybe this is a performance optimization (?), but it's at the expense of correctness and just looks like a bug, particularly because auto complete does resolve constructor when accessed from an external reference/pointer.
This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes.