New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting noErrorTruncation to false truncates inferred type of variables/functions; which are not errors #26238
Comments
|
Weird. I thought I finally "fixed" it but, even with Is there a Turning on |
The same for me. TypeScript 3.2.2 |
|
I'm pretty sure it has something to do with |
|
The ellipses makes it very hard to debug Pick, Omit, etc, when things went wrong. |
|
@xbtsw Using edit: Something like |
|
@aleclarson maybe I should say “when things not went as intended”. As you probably noticed the problems not always manifest itself as an error. Sometimes debugging is done by hovering on an inferred type. |
|
I'm still on 3.5.1. This is kind of blocking my attempts at continuous integration =/ I do a character-by-character comparison of So, different working directory name lengths = different ellipsis positions = failing CI If |
|
It's not just CI, it's usability problem. I actually like browsing (and copying) the type from the hover tip in the VSCode, and when it gets truncated it's pretty much useless. // from https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json
let foo = {
"text": "My added comments to this Tweet ---> https:\/\/t.co\/LinkToTweet",
"user": {
"screen_name": "TweetQuoter"
},
"quoted_status": {
"text": "original message",
"user": {
"screen_name": "OriginalTweeter"
},
"place": {
},
"entities": {
},
"extended_entities": {
}
},
"place": {
},
"entities": {
"hashtags": [
],
"urls": [
{
"url": "https://t.co/W1FqVrsjQk",
"expanded_url": "https://twittercommunity.com/t/rt-with-comment-aka-quote-tweets-now-may-have-media-attached-across-twitter-apis/125539",
"display_url": "twittercommunity.com/t/rt-with-comm…",
"unwound": {
"url": "https://twittercommunity.com/t/rt-with-comment-aka-quote-tweets-now-may-have-media-attached-across-twitter-apis/125539",
"status": 200,
"title": "RT with comment, aka Quote Tweets, now may have media attached across Twitter APIs",
"description": "Today we’re announcing a new feature that allows userspeople on Twitter to add a GIF, video, or photo to their Retweet with comments, aka Quote Tweets. Developers will start to see additional media metadata included in the payload for Quote Tweets. Quote Tweets with media will be rendered very similarly to Tweets with media across our APIs. This rendering is an addition to the existing media field, so this should not be a breaking change for application owners, if they are already ingesting med..."
},
"indices": [
162,
185
]
},
{
"url": "https://t.co/lXs26mCkIl",
"expanded_url": "https://twitter.com/TwitterSupport/status/1125479034513645569",
"display_url": "twitter.com/TwitterSupport…",
"indices": [
186,
209
]
}
],
"user_mentions": [
],
"symbols": [
],
"media": [
{
"id": 1125490782532657153,
"id_str": "1125490782532657153",
"indices": [
210,
233
],
"media_url": "http://pbs.twimg.com/tweet_video_thumb/D56L51LV4AEEC8-.jpg",
"media_url_https": "https://pbs.twimg.com/tweet_video_thumb/D56L51LV4AEEC8-.jpg",
"url": "https://t.co/T9MBCHZWcD",
"display_url": "pic.twitter.com/T9MBCHZWcD",
"expanded_url": "https://twitter.com/TwitterDev/status/1125490788736032770/photo/1",
"type": "animated_gif",
"video_info": {
"aspect_ratio": [
101,
165
],
"variants": [
{
"bitrate": 0,
"content_type": "video/mp4",
"url": "https://video.twimg.com/tweet_video/D56L51LV4AEEC8-.mp4"
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"small": {
"w": 202,
"h": 330,
"resize": "fit"
},
"large": {
"w": 202,
"h": 330,
"resize": "fit"
},
"medium": {
"w": 202,
"h": 330,
"resize": "fit"
}
}
}
]
},
"extended_entities": {
"media": [
{
"id": 1125490782532657153,
"id_str": "1125490782532657153",
"indices": [
210,
233
],
"media_url": "http://pbs.twimg.com/tweet_video_thumb/D56L51LV4AEEC8-.jpg",
"media_url_https": "https://pbs.twimg.com/tweet_video_thumb/D56L51LV4AEEC8-.jpg",
"url": "https://t.co/T9MBCHZWcD",
"display_url": "pic.twitter.com/T9MBCHZWcD",
"expanded_url": "https://twitter.com/TwitterDev/status/1125490788736032770/photo/1",
"type": "animated_gif",
"video_info": {
"aspect_ratio": [
101,
165
],
"variants": [
{
"bitrate": 0,
"content_type": "video/mp4",
"url": "https://video.twimg.com/tweet_video/D56L51LV4AEEC8-.mp4"
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"small": {
"w": 202,
"h": 330,
"resize": "fit"
},
"large": {
"w": 202,
"h": 330,
"resize": "fit"
},
"medium": {
"w": 202,
"h": 330,
"resize": "fit"
}
}
}
]
}
}; |
|
|
|
Yes agree here, it would be huge to at least have some tool - perhaps even something dedicated that would allow us to see the fully expanded and normalized type that typescript will use. Perhaps a custom "peek" style popup for it so that we can choose to view it only when we need to in the case of large types that would make processing type extreme. |
|
same issue +1 |
|
The ellipsis makes it especially difficult to debug type issues (not type errors) involving For example in a type that involves |
|
This is an issue that keeps popping up for me. Any motion on it? |
|
Having this problem as well. Investigating and debugging this issue led me to find this being introduced in merge #24258. Typescript starts truncating the output when it reaches the default hard-limit of TypeScript/src/services/utilities.ts Line 1993 in 57e2fe0
For people using VS Code, a quick fix would be opening |
|
Thank you for your efforts sleuthing this out @Hati- ! I would hope to see this value bound as a configurable TS preference. However it is awesome to know that there is a way to hack around the limitation. |
|
Thanks again for the hack! I just wanted to call out that if your VSCode config specifies the |
|
The hack is good to know about, but it isn't really a solution for me. What I'm running into is that I often want to hover a type and want see the entire type (no "..."), but when I'm trying to read an error, showing entire type definitions can sometimes make the error utterly unreadable. So, some finer grained control is really needed here. Ideally, there'd be some integration between TypeScript and VSCode to provide a toggle to choose between "verbose" (types expanded) and "compact" (types truncated). |
|
Make this vscode feature please - it's annoying to configure manually. |

AnyhowStep commentedAug 6, 2018
TypeScript Version: 3.0.1
Search Terms: noErrorTruncation
In TS 2.9, if
noErrorTruncationis unset, or set tofalse, hovering the cursor over an identifier for type inference in VS code would bring up a tooltip with the inferred type.In TS 3.0, if
noErrorTruncationis unset, or set tofalse, the tooltip with the inferred type will be truncated with ellipsis.Code
TS 2.9, with
noErrorTruncation : falseTS 3.0 with
noErrorTruncation : falseExpected behavior:
noErrorTruncationis about truncating errors.The tooltips displaying inferred types aren't errors, and should not be affected by this flag.
Actual behavior:
noErrorTruncationaffects tooltips displaying inferred types.If anyone else is having this problem, just go to your
tsconfig.json, add the following line,and restart VS code (or your editor of choice)
The text was updated successfully, but these errors were encountered: