Syntax highlighting for source maps / non-JavaScript languages
Reported by
itai...@gmail.com,
Sep 19 2017
|
|||||
Issue descriptionUserAgent: 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.
,
Sep 19 2017
,
Sep 20 2017
@Reporter: Could you please provide sample test file for further triaging from chrome TE end.
,
Sep 21 2017
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
,
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.
,
Oct 3 2017
,
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 |
|||||
Comment 1 by ligim...@chromium.org
, Sep 19 2017