You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new Editor.getModeForRange() assumes that the modes being returned by TokenUtils.getModeAt() will properly map to the right language in the current document. These modes aren't actually accurate in general when one language uses a mime-type version of a CodeMirror mode that is also used by another language. For example, our CSS language uses the css mode, and our LESS language uses the "text/x-less" configuration of the css mode.
We currently have a hack for dealing with HTML and XML. This PR adds similar hacks for LESS and SCSS. Looking at languages.json, there are a few other cases that might be similar, but in the other cases the commenting syntax is the same, so we wouldn't run into this specific issue. Nevertheless, we should eventually try to make this more accurate by requesting support in CM for accurately looking up the mime-type in use for a given location (filed as #7345).
Issue by njx
Friday Mar 28, 2014 at 22:00 GMT
Originally opened as adobe/brackets#7346
For #7268.
The new
Editor.getModeForRange()
assumes that the modes being returned byTokenUtils.getModeAt()
will properly map to the right language in the current document. These modes aren't actually accurate in general when one language uses a mime-type version of a CodeMirror mode that is also used by another language. For example, our CSS language uses the css mode, and our LESS language uses the "text/x-less" configuration of the css mode.We currently have a hack for dealing with HTML and XML. This PR adds similar hacks for LESS and SCSS. Looking at
languages.json
, there are a few other cases that might be similar, but in the other cases the commenting syntax is the same, so we wouldn't run into this specific issue. Nevertheless, we should eventually try to make this more accurate by requesting support in CM for accurately looking up the mime-type in use for a given location (filed as #7345).@
peterflynnnjx included the following code: https://github.com/adobe/brackets/pull/7346/commits
The text was updated successfully, but these errors were encountered: