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

Issue 766709 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

Syntax highlighting for source maps / non-JavaScript languages

Reported by itai...@gmail.com, Sep 19 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.18 Safari/537.36

Steps to reproduce the problem:
1. Bundle a TypeScript/CoffeeScript/Scala project with source maps
2. Open it in Chrome and go to Source tab in devtools
3. Look at the source maps file

What is the expected behavior?
CodeMirror editor correctly picks the syntax highlighting for TypeScript/JSX/CoffeeScript/etc files.

What went wrong?
CodeMirror displays them all with JavaScript syntax highlighting

Did this work before? N/A 

Chrome version: 62.0.3202.18  Channel: beta
OS Version: OS X 10.13.0
Flash Version: 

CodeMirror should pick the syntax highlighting based on file extension.
 
Labels: Needs-Triage-M62
Labels: Hotlist-HighSierra
Cc: sc00335...@techmahindra.com
Labels: Triaged-ET Needs-Feedback
@Reporter: Could you please provide sample test file for further triaging from chrome TE end.
Labels: -Type-Bug -Pri-2 OS-Chrome OS-Linux OS-Windows Pri-3 Type-Feature
Status: Untriaged (was: Unconfirmed)
Attached is an example typescript file. Confirmed on version 63.0.3213.3 (Official Build) dev (64-bit) with this.

JSX seems odd though, as that is defined [1] in the available types. If you could provide a sample file here that would be awesome. Also verify the *mime types* the files are being sent as. The file extension is not relevant since they aren't guaranteed to be accurate representations of the files contents.

[1] https://github.com/ChromeDevTools/devtools-frontend/blob/43a848008eaa57a0fa988ca04b64dace13145b2d/front_end/cm_modes/module.json#L79
home.ts
182 bytes Download

Comment 5 by itai...@gmail.com, Sep 21 2017

Here is an JSX sample: https://github.com/ahfarmer/calculator/blob/master/src/component/ButtonPanel.js

I don’t think verifying the mime types is possible, given that we are dealing with sourcemaps here. Non-JavaScript codes cannot be executed directly.
Owner: einbinder@chromium.org
Status: Assigned (was: Untriaged)

Comment 7 by itai...@gmail.com, Nov 30 2017

If it’s okay, I think CodeMirror JSX should be enabled for normal `.js` files as well.

Sign in to add a comment