atom / highlights

Syntax highlighter
https://atom.github.io/highlights
MIT License
529 stars 54 forks source link

filePath option required to avoid null-grammar #57

Open davidtheclark opened 7 years ago

davidtheclark commented 7 years ago

In trying to follow the example in the README, I found that I was stuck with null-grammar unless I provided a filePath 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?

davidtheclark commented 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.

bcoe commented 7 years ago

@davidtheclark would love a PR to the docs 👍 sorry about the confusion.

davidtheclark commented 7 years ago

@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:

Is that right?