From 8bf199ad725c61c5c3a686cecc02c1f6c12ff4ca Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Sat, 18 May 2024 16:04:25 -0700 Subject: [PATCH] =?UTF-8?q?[language-php]=20Add=20a=20`firstLineRegex`?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …so that the grammar-choosing logic picks the modern Tree-sitter grammar more consistently. --- .../grammars/modern-tree-sitter-php-html.cson | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/language-php/grammars/modern-tree-sitter-php-html.cson b/packages/language-php/grammars/modern-tree-sitter-php-html.cson index 77b49260f..d7d2c658c 100644 --- a/packages/language-php/grammars/modern-tree-sitter-php-html.cson +++ b/packages/language-php/grammars/modern-tree-sitter-php-html.cson @@ -5,6 +5,15 @@ parser: 'tree-sitter-php' injectionRegex: 'php|PHP' +# The TextMate grammar has an elaborate `firstLineMatch` pattern defined with +# Oniguruma; it catches hashbang syntax and complex vim/emacs modelines along +# with the typical `