"Go to member" inside typescript doesn't work (source mapped javascript)
Reported by
verhelst...@gmail.com,
Sep 19 2016
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Steps to reproduce the problem: 1. Go to a website that has typescript + javascript + js.map 2. open dev tools 3. go to the file 4. press ctrl + shift + O to go to a member of the file 5. Search list is empty What is the expected behavior? When a source map is available the same behavior should occur as if you're looking at the javascript file. Eg: all members are searchable and when you click on a result, it should take you to that position in the code. What went wrong? the search list for members is not populated Did this work before? N/A Chrome version: 53.0.2785.116 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 23.0 r0
,
Sep 21 2016
,
Sep 25 2016
sure, here you go. The js, ts and js.map files are in the same location http://rxh.s3.amazonaws.com/projects/temp/find-member/index.html I'm also adding screenshots to illustrate the problem
,
Oct 2 2016
Thank you for providing more feedback. Adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 2 2016
We support only CSS and JS for now. In order to support this functionality for other languages, we'll need a good extension API - which we don't have for now.
,
Dec 7 2016
Wouldn't this work: * get the source-map for the JavaScript file * Get the list of functions for the minified JavaScript * Load the source-map in a source-map library, eg: https://github.com/mozilla/source-map#consuming-a-source-map * For each entry in the list of JavaScript functions get the equivalent location in the typescript file Or does the library have to be c++?
,
Dec 7 2016
Indeed, that approach might yield some results. However, it doesn't guarantee that every member in the TS file would be listed in the go-to-member dialog - which will bring confusion. I believe the only way forward here is to support "go-to-member" for ts files explicitly, preferably via extension.
,
Dec 8 2016
I agree with your first statement that it could create some confusion. It would still be helpful in 90% of the cases and for any language that has a source-map available. Your approach would require work for supporting every language: TS, Coffeescript, Dart, ... This doesn't seem like a maintainable way of implementing this. But since you guys will be the ones implementing this, it's up to you. :) |
||||
►
Sign in to add a comment |
||||
Comment 1 by brajkumar@chromium.org
, Sep 20 2016Labels: Needs-Feedback