ptomato / sublime_autotools

Autotools syntax highlighting for Sublime Text
GNU General Public License v3.0
17 stars 15 forks source link

Autoconf: fix references to external rules #10

Open pchaigno opened 4 years ago

pchaigno commented 4 years ago

While trying to use the Autoconf grammar in Linguist (turns out we can't use it after all since it's GPL v3), our compiler detected that some of the includes have broken references to external rules. This pull request fixes it.

ptomato commented 4 years ago

Thanks for the contribution! I'm a bit mystified though, you are correct that the current references are broken, I see a lot of errors in the Sublime Text console like this:

Error loading scope:source.shell.comment: Unable to find syntax file for scope source.shell.comment in Packages/Autotools/Autoconf.tmLanguage
Error loading scope:source.shell.case-clause: Unable to find syntax file for scope source.shell.case-clause in Packages/Autotools/Autoconf.tmLanguage

However, the change in this pull request seems not to work correctly either, but in a different way:

no such context scope:source.shell#comment in Packages/Autotools/Autoconf.tmLanguage
no such context scope:source.shell#case-clause in Packages/Autotools/Autoconf.tmLanguage

Do you know why this might be happening?

pchaigno commented 4 years ago

I'm guessing this is happening because no grammar with the scope source.shell has been imported in the environment where you're loading the present grammar. Or that grammar doesn't have rules comment and case-clause.

/cc @Alhadis might know more.

Alhadis commented 4 years ago

@ptomato It sounds like you're attempting to reference another grammar's rule which doesn't exist. Check the source.shell grammar and verify the repository object defines the keys comment and case-clause.