New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 648411 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit 29 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

"Go to member" inside typescript doesn't work (source mapped javascript)

Reported by verhelst...@gmail.com, Sep 19 2016

Issue description

UserAgent: 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
 
Cc: brajkumar@chromium.org
Labels: Needs-Feedback
verhelstbert@ Could you please provide any sample URl or html file from where we can test this issue from chrome TE end.

Thanks!
Owner: lushnikov@chromium.org
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
js-find-member-does-work.jpg
205 KB View Download
ts-find-member-doesnt-work.jpg
194 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Oct 2 2016

Labels: -Needs-Feedback Needs-Review
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
Status: WontFix (was: Unconfirmed)
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.
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++?
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.
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