Defining a Brackets language for Vue components using the vue mode for CodeMirror results in the language being resolved to an unknown language for the Brackets code hinter when using Stylus in the style tag. This breaks potential Stylus code hint providers.
From what I understand, the issue seems to be with the Brackets language for Stylus being defined as if Stylus was a variation of the CSS mode (a MIME mode) in CodeMirror, when in reality it is completely separate. This results in the CodeMirror mode that Brackets tries to resolve being stylus, while due to this part of LanguageManager the Stylus Brackets language is mapped to the text/x-styl CodeMirror mode.
I managed to find two possible solutions:
Adding a mapping from text/x-styl to stylushere in LanguageManager like this:
var stylus = getLanguage("stylus");
_setLanguageForMode("stylus", stylus);
Changing the mode for Stylus in language/languages.json from ["stylus", "text/x-styl"] to "stylus"
CodeMirror defines the Vue component mode here using the htmlmixed mode with a tags option.
Steps to Reproduce
Define a language using the vue mode for CodeMirror by running the code below
Issue by opl- Monday May 15, 2017 at 22:55 GMT Originally opened as https://github.com/adobe/brackets/issues/13378
Description
Defining a Brackets language for Vue components using the vue mode for CodeMirror results in the language being resolved to an unknown language for the Brackets code hinter when using Stylus in the style tag. This breaks potential Stylus code hint providers.
From what I understand, the issue seems to be with the Brackets language for Stylus being defined as if Stylus was a variation of the CSS mode (a MIME mode) in CodeMirror, when in reality it is completely separate. This results in the CodeMirror mode that Brackets tries to resolve being
stylus
, while due to this part of LanguageManager the Stylus Brackets language is mapped to thetext/x-styl
CodeMirror mode.I managed to find two possible solutions:
text/x-styl
tostylus
here in LanguageManager like this:mode
for Stylus inlanguage/languages.json
from["stylus", "text/x-styl"]
to"stylus"
CodeMirror defines the Vue component mode here using the htmlmixed mode with a
tags
option.Steps to Reproduce
<style lang="stylus">
tagExpected behavior: The code hints should work (though Brackets currently doesn't show any code hints for Stylus files).
Actual behavior: An error is logged.
Versions
Windows 7 64 bit, Brackets 1.10.0