Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Return LESS/SCSS instead of CSS language when in a LESS/SCSS file #6625

Open
core-ai-bot opened this issue Aug 30, 2021 · 1 comment

Comments

@core-ai-bot
Copy link
Member

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 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).

@peterflynn


njx included the following code: https://github.com/adobe/brackets/pull/7346/commits

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Saturday Mar 29, 2014 at 00:21 GMT


LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant