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
Discuss: Restricting language subset used for sublanguage detection #1212
Comments
Good catch, thanks. And that should be fixable in a fairly straightforward way. I'll try to get to this one before the next release. |
😄 Thanks! |
I think the problem here is misstated - or at least the implied solution is not correct. If the same filters used for language were applied to sublanguage someone could easily break many grammars without realizing it. I don't think this is how users would expect things to behave in general. Perhaps this merely requires a documentation fix, but I'm not so sure. Many languages are vitally dependent on particular sublanguages and if I only specified the parent language in the subset I would NOT expect that to restrict the sublanguage subset - hence badly breaking the parent language. Some examples:
I'm not sure what the proper solution here is, but I wanted to add these notes. |
Was that the real problem here? I wonder if we couldn't simply remove ActionScript completely (from the autodetect list for Thoughts? |
I think it can be a solution for this particular issue. In general we lack a mechanism to limit sublanguages (outside from the grammar). I agree that
but could a separate restriction of sublanguage subset be convenient in some cases? |
Perhaps. Though I think it'd be very hacky and still subject to the caveats I mentioned above (far more likely to break things than to fix things). If you're fine will removing ActionScript from the auto-detection for If so perhaps when/if it does we'll have more information and perhaps that'll lead to better ideas. |
I'm fine with it. |
When limiting auto highlight to a language subset, it only works for top-level languages. So when parsing some HTML with JavaScript inside with:
the JavaScript may still be interpreted as ActionScript, for example. 😕
The text was updated successfully, but these errors were encountered: