-
Notifications
You must be signed in to change notification settings - Fork 358
Idea: improve/change grammar matching #384
Comments
The top-level scope should really only be |
@50Wliu Thanks for your response. The main issue with syntax themes is that most of them haven't any proper support for To patch this, I thought of assigning In addition, I've planned to create PRs for each default syntax theme to add a bare minimum of Slightly off-topic, I think Markdown can be considered both So, tl;dr: no proper standardization of scopes, so I'd like to use |
I'm planning to change the default scope used in
language-markdown
fromtext.md
tosource.text.md
(see burodepeper/language-markdown#83) for wider support by syntax themes. This will break themarkdown-preview:toggle
command, because it doesn't match with the default grammars anymore.Currently a match counts as valid when it is a 100% match (see https://github.com/atom/markdown-preview/blob/master/lib/main.coffee#L67-L68). I'd like to submit a PR to address this issue, but I'm considering whether to just add another grammar to the config (see https://github.com/atom/markdown-preview/blob/master/package.json#L46-L53) or to change the matching algorithm to allow partial matches.
I'm leaning towards the latter, because I've always interpreted scope names as css classes (and not ids) so a partial match seems to make sense. I would like your input on this, especially how a partial match could cause new issues that I might have overlooked in my naivety.
I reckon that the scope
text.md
in the config should match withtext.md
,md.text
,source.text.md
,source.md.text
, etc. as long as bothtext
andmd
are present in the current grammar. Obviously, this would be the case for all default grammars in the config (which could be simplified as a result of this).The text was updated successfully, but these errors were encountered: