TypeScript this
Type Information Dosen't Surface Properly in Editor
#12032
Labels
typescript
Typescript support issues
upstream
Issue identified as 'upstream' component related (exists outside of VS Code)
TypeScript
this
Type Information Dosen't Surface Properly in EditorEnvironment Information
Problem
In TypeScript 2.0, the shape of
this
for functions can be described using type annotations. However, the VS Code TypeScript editor does not properly surface this information. Thethis
variable in the function gets typed asany
within the function but the editor still enforces that use ofthis
in the function conform to the type information used to describethis
for the function. This results in the odd issue of the editor not providing any intellisense for thethis
due to it being typed asany
but still expects it conform to the shape ofthis
described by thethis
type annotation for the function.Reproduction
The following minimum TypeScript file will reproduce the issue in VS Code.
Expected Result
The VS Code TypeScript editor should properly surface the type information for
this
in functions and not just type it asany
to provide proper intellisense.The text was updated successfully, but these errors were encountered: