klorenz / atom-regex-railroad-diagrams

display regex as railroad diagram, if cursor moves to it
MIT License
250 stars 31 forks source link

:bug: fix #86 #95

Closed despairblue closed 6 years ago

despairblue commented 6 years ago

Some grammars don't have a name property set like https://github.com/reasonml-editor/language-reason/blob/master/grammars/reason-hover-type.json. This throws Cannot read property 'match' of undefined at activation time, thus rendering the whole plugin unusable.

Checking if the name prop exists before accessing it prevents that.

stefanwork commented 6 years ago

I am also having this problem. I ran this to get the list of packages that were causing it (it was only one package that I am not using fortunately, language-haskell). Hope this can get merged soon.

To find your incompatible packages, open the developer tools, then run the following in the Console:

atom.grammars.getGrammars().filter((g) => !g.name).map((g) => g.packageName)