Open davidtheclark opened 7 years ago
Another twist: filePath
seems to work without scopeName
and independent of it. If I want JavaScript highlighting, set scopeName: 'scope.js'
and filePath: 'foo.css'
, I get CSS highlighting. If I set scopeName: 'scope.css'
and filePath: 'foo.js'
, I get JS highlighting.
@davidtheclark would love a PR to the docs 👍 sorry about the confusion.
@bcoe I started trying to write this — then realized I'm not sure what's going on 😬
I'm looking at https://github.com/atom/highlights/blob/595860901279927947077f1853d2d3d82046232a/src/highlights.coffee#L150-L153 and thinking:
scopeName
is used to get the grammar if you've registered a non-standard grammar that applies.fileName
is used to get the grammar if you haven't.Is that right?
In trying to follow the example in the README, I found that I was stuck with
null-grammar
unless I provided afilePath
option.scopeName
alone wouldn't do, as the example suggests.Is there something I'm missing? Or should I make a PR to add this to the docs?