mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-10-26 11:08:40 +03:00
[language-php] Add a firstLineRegex
…
…so that the grammar-choosing logic picks the modern Tree-sitter grammar more consistently.
This commit is contained in:
parent
55e869c786
commit
8bf199ad72
@ -5,6 +5,15 @@ parser: 'tree-sitter-php'
|
|||||||
|
|
||||||
injectionRegex: 'php|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 `<?php` prefix.
|
||||||
|
#
|
||||||
|
# We can't compete with all that, but we can catch obvious instances of
|
||||||
|
# shebangs and `<?php`s. In fact, we must, or else the TextMate grammar will be
|
||||||
|
# ranked higher for certain files.
|
||||||
|
firstLineRegex: '^\\s*<\\?(?:php|PHP|=|\\s|$)|^\\#!.*(?:\\s|\\/)php\\d?'
|
||||||
|
|
||||||
treeSitter:
|
treeSitter:
|
||||||
parserSource: 'github:tree-sitter/tree-sitter-php#b569a5f2c0d592e67430520d1a0e1f765d83ceb0'
|
parserSource: 'github:tree-sitter/tree-sitter-php#b569a5f2c0d592e67430520d1a0e1f765d83ceb0'
|
||||||
grammar: 'tree-sitter/tree-sitter-php.wasm'
|
grammar: 'tree-sitter/tree-sitter-php.wasm'
|
||||||
|
Loading…
Reference in New Issue
Block a user