-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP] Suppress method completions when typing php tags (#3237)
* [PHP] Suppress method completions when typing php tags Resolves https://github.com/sublimehq/sublime_text/issues/5256 The fix consists of two parts: 1. Extending the completion's selector by - punctuation.section.embedded.begin 2. Making sure to highlight incomplete <?php tags punctuation.section.embedded.begin Note: If this isn't acceptable we might want to scope incomplete tags using a `meta` scope and add this to the selector (1.) as well. We just need to ensure ST sees the correct scope while typing the opening php tag in order to not add those methods to the list of available completions. * [PHP] Fix php snippet This commit makes sure to correctly complete the `<?php | ?>` snippet depending on whether `php` or `<?php` was entered. In the latter case we might want to apply `php (begin tag)` snippet which doesn't add a second `<?`. Before this commit: <?ph| => <?<?php | ?> With this commit: <?ph| => <?php | ?> * [PHP] Use separate patterns for incomplete php tags Keep scoping to suppress completions while not pushing/popping contexts until tag is complete. May help to prevent some false positives or confusion about non-running but highlighted code.
- Loading branch information
Showing
5 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_PHP_OPEN_TAG:php} $0 ?>]]></content> | ||
<tabTrigger>php</tabTrigger> | ||
<scope>embedding.php text.html punctuation.section.embedded.begin.php</scope> | ||
<description><?php … ?></description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[<?${TM_PHP_OPEN_TAG:php} $0 ?>]]></content> | ||
<tabTrigger>php</tabTrigger> | ||
<scope>embedding.php text.html - source.php</scope> | ||
<scope>embedding.php text.html - source.php - punctuation.section.embedded.begin.php</scope> | ||
<description><?php … ?></description> | ||
</snippet> |