Packages: shell highlighting broken if no space follows <<<

Created on 21 Sep 2016  路  8Comments  路  Source: sublimehq/Packages

Most helpful comment

What is almost certainly happening is that Shell Script allows embedded heredocs of the syntaxes Markdown, HTML, Python, Ruby, AppleScript and Textile. One of those syntaxes on your machine must be from a third-party package, and must have a scope that includes Shell Script directly (for embedding), or includes it via another include.


The one possible way to stem the tide of such recursion errors is for Sublime Text to add functionality that allows omitting a context when embedded. Then, we'd add an embed: directive like include: that would just skip contexts marked with skip_embedding: true. So, you could allow Shell Script to embed PHP, but it would include a version of PHP that does not highlight heredocs with embedded languages. This could also potentially make with_prototype more useful, since that can easily lead to include recursion.

This would almost certainly work fine in practice, since it would be kind of crazy for someone to embed PHP with a heredoc of a Shell Script inside of a Shell Script heredoc. And if they did, it would seem perfectly fine to not syntax highlight the innermost Shell Script code.

All 8 comments

I just get this error no matter what
screen shot 2016-09-22 at 08 16 33

Build 3124 breaks the shell syntax (25000 sanity limit) for me as well on Ubuntu 16.04

Interesting... there is no real change between 3124 and 3114 for shellscript.

You may temporary switch to use https://packagecontrol.io/packages/ShellScriptImproved before there is a official shellscript re-write.

If you are hitting the recursion error it means you have a third party syntax installed that is creating an include loop. This is very likely an HTML syntax, but may be something like JavaScript.

Or some markdown flavor.

@jfcherng thanks, it's a fix for now ...

What is almost certainly happening is that Shell Script allows embedded heredocs of the syntaxes Markdown, HTML, Python, Ruby, AppleScript and Textile. One of those syntaxes on your machine must be from a third-party package, and must have a scope that includes Shell Script directly (for embedding), or includes it via another include.


The one possible way to stem the tide of such recursion errors is for Sublime Text to add functionality that allows omitting a context when embedded. Then, we'd add an embed: directive like include: that would just skip contexts marked with skip_embedding: true. So, you could allow Shell Script to embed PHP, but it would include a version of PHP that does not highlight heredocs with embedded languages. This could also potentially make with_prototype more useful, since that can easily lead to include recursion.

This would almost certainly work fine in practice, since it would be kind of crazy for someone to embed PHP with a heredoc of a Shell Script inside of a Shell Script heredoc. And if they did, it would seem perfectly fine to not syntax highlight the innermost Shell Script code.

The one possible way to stem the tide of such recursion errors is for Sublime Text to add functionality that allows omitting a context when embedded. Then, we'd add an embed: directive like include: that would just skip contexts marked with skip_embedding: true. So, you could allow Shell Script to embed PHP, but it would include a version of PHP that does not highlight heredocs with embedded languages. This could also potentially make with_prototype more useful, since that can easily lead to include recursion.

Related: https://github.com/SublimeTextIssues/Core/issues/1534

Was this page helpful?
0 / 5 - 0 ratings