This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Return LESS/SCSS instead of CSS language when in a LESS/SCSS file#7346
Merged
peterflynn merged 1 commit intomasterfrom Mar 29, 2014
Merged
Return LESS/SCSS instead of CSS language when in a LESS/SCSS file#7346peterflynn merged 1 commit intomasterfrom
peterflynn merged 1 commit intomasterfrom
Conversation
Member
|
LGTM |
peterflynn
added a commit
that referenced
this pull request
Mar 29, 2014
Return LESS/SCSS language instead of CSS language when in a LESS/SCSS file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).@peterflynn