Open timkelty opened 8 years ago
Another example of this:
source.gfm markup.code.html.gfm source.html.basic
source.html.basic
should work, but Emmet expansions don't work because it is only targeting the grammar "name", not the scope.This seems related: https://github.com/emmetio/emmet-atom/pull/43
More reference: https://discuss.atom.io/t/why-do-so-many-packages-ignore-scope-and-only-use-grammar-name/24724
Within that, you are in a code block, with html formatting, which changes the scope to: source.gfm markup.code.html.gfm source.html.basic
editor.getGrammar().scopeName
won’t help here because editor.getGrammar()
returns root grammar, not context one (which should be retrieved with editor.scopeDescriptorForBufferPosition().getScopesArray()
Thanks, @sergeche
This would fix #325 for vue
files.
It seems unfortunate to use
.name
, as that is only the top-level name.For instance, I recently discovered emmet expansion was broken in a
source.css.postcss
scope. If emmet used the scopeName, which would besource.css.postcss
instead of just name, which is just,postcss
it wouldn't have to make exceptions for each sub-scope.https://github.com/emmetio/emmet-atom/blob/master/lib/editor-proxy.coffee#L203-L204