mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
…to each PHP section in order to match the functionality of the TextMate grammar. This was a gigantic endeavor and involved doing several things that were on my “ugh, I’ll get around to it” list: * To make some of this stuff work, we were using two different PHP parser layers. The root one did the syntax highlighting and separated the HTML from the rest, and the deeper injection was there just so we could scope some ranges as `source.php`. That doesn’t work because of rules we have about shallower layers acting before deeper layers when iterating through syntax highlighting boundaries. I was trying to be too clever. Now the _root_ layer is the one that does no highlighting, and the _deeper_ layer is the one that exists to apply `source.php` _and then_ perform highlighting and indentation hinting and folding and whatnot. If we need to, we can move some of the queries to the root layer for whatever reason; maybe we come across a bug six months from now that could be fixed if we made the root layer in charge of folding. We have options. * All boundaries for `HighlightIterator`s now _either_ open one or more scopes _or_ close one or more scopes. If one boundary can close some scopes and open others, then boundaries on different layers that share a buffer position cannot possibly close/open in the correct order because they can't intermingle. This needed to happen and this was as good of an excuse as any to do it. * We needed to present sane PHP opening/closing ranges to the injection. Ironically, `tree-sitter-php` itself makes this nearly impossible because of how the tree is structured; it tries to hide the `<?php` and `?>` tags from the PHP layer and treat them as text, despite the fact that PHP is the thing that knows how to parse that. The best way to do this — at least until I encounter a reason why it can’t work — is to find all the `<?php`s and `?>`s, sort them, group them, and build fake node ranges. This is fine! I mean, it’s ridiculous, but it’s fine! The ranges that we hand off to another parser are allowed to be completely arbitrary! This lets us do what we were only approximating before: have _one_ PHP injection layer with _any number of_ content ranges, each of which begins with `<?php` and ends with `?>` without trying to claim any surrounding whitespace. This would be worth it even if we didn’t have to do any of this other stuff. * Each content range of the injection needs _either_ `meta.embedded.line.php` _or_ `meta.embedded.block.php` depending on whether the range begins and ends on the same line. This is not something I was willing to regress on because it's _hard_ to distinguish between PHP and non-PHP unless your editor helps you out, and because I wasn't going to go into a bunch of themes and tell them to treat `source.php` like `meta.embedded`. This also meant that we needed to be able to add _multiple_ “root” scope names per content range. But we already had a mode in which the `languageScope` injection option could be a callback, so it wasn't hard to make it a callback that could take extra parameters for the buffer and range. This isn't a feature that I'm eager for other grammars to use, or even necessarily know about, but it was what we needed to deliver feature parity here. And none of it would have been necessary if `tree-sitter-php` made more sensible choices. (Whatever. Maybe what I want isn't possible for some strange reason.) All existing tests pass. Tests have been written for the new `languageScope` features. Tests need to be written for PHP just like for all other language grammars, but that was on the to-do list anyway. If any of this turns out to be catastrophic, it’s easy to roll back, but tests are passing on my machine and I expect them to pass in CI. |
||
---|---|---|
.. | ||
about | ||
archive-view | ||
atom-dark-syntax | ||
atom-dark-ui | ||
atom-light-syntax | ||
atom-light-ui | ||
autocomplete-atom-api | ||
autocomplete-css | ||
autocomplete-html | ||
autocomplete-plus | ||
autocomplete-snippets | ||
autoflow | ||
autosave | ||
background-tips | ||
base16-tomorrow-dark-theme | ||
base16-tomorrow-light-theme | ||
bookmarks | ||
bracket-matcher | ||
command-palette | ||
dalek | ||
deprecation-cop | ||
dev-live-reload | ||
encoding-selector | ||
exception-reporting | ||
find-and-replace | ||
fuzzy-finder | ||
git-diff | ||
go-to-line | ||
grammar-selector | ||
image-view | ||
incompatible-packages | ||
keybinding-resolver | ||
language-c | ||
language-clojure | ||
language-coffee-script | ||
language-csharp | ||
language-css | ||
language-gfm | ||
language-git | ||
language-go | ||
language-html | ||
language-hyperlink | ||
language-java | ||
language-javascript | ||
language-json | ||
language-less | ||
language-make | ||
language-mustache | ||
language-objective-c | ||
language-perl | ||
language-php | ||
language-property-list | ||
language-python | ||
language-ruby | ||
language-ruby-on-rails | ||
language-rust-bundled | ||
language-sass | ||
language-shellscript | ||
language-source | ||
language-sql | ||
language-text | ||
language-todo | ||
language-toml | ||
language-typescript | ||
language-xml | ||
language-yaml | ||
line-ending-selector | ||
link | ||
markdown-preview | ||
notifications | ||
one-dark-syntax | ||
one-dark-ui | ||
one-light-syntax | ||
one-light-ui | ||
open-on-github | ||
package-generator | ||
pulsar-updater | ||
settings-view | ||
solarized-dark-syntax | ||
solarized-light-syntax | ||
spell-check | ||
status-bar | ||
styleguide | ||
symbol-provider-ctags | ||
symbol-provider-tree-sitter | ||
symbols-view | ||
tabs | ||
timecop | ||
tree-view | ||
update-package-dependencies | ||
welcome | ||
whitespace | ||
wrap-guide | ||
README.md |
Core Packages
This folder contains core packages that are bundled with Pulsar releases. Not all core packages are kept here; please see the table below for the location of every core package.
NOTE: There is an ongoing effort to migrate more Pulsar packages from their individual repositories to this folder. See RFC 003 for more details.
Package | Where to find it | Migration issue |
---|---|---|
about | ./about |
|
atom-dark-syntax | ./atom-dark-syntax |
|
atom-dark-ui | ./atom-dark-ui |
|
atom-light-syntax | ./atom-light-syntax |
|
atom-light-ui | ./atom-light-ui |
|
autocomplete-atom-api | ./autocomplete-atom-api |
|
autocomplete-css | ./autocomplete-css |
|
autocomplete-html | ./autocomplete-html |
|
autocomplete-plus | ./autocomplete-plus |
|
autocomplete-snippets | ./autocomplete-snippets |
|
autoflow | ./autoflow |
|
autosave | ./autosave |
|
background-tips | ./background-tips |
|
base16-tomorrow-dark-theme | ./base16-tomorrow-dark-theme |
|
base16-tomorrow-light-theme | ./base16-tomorrow-light-theme |
|
bookmarks | ./bookmarks |
|
bracket-matcher | ./bracket-matcher |
|
command-palette | ./command-palette |
|
dalek | ./dalek |
|
deprecation-cop | ./deprecation-cop |
|
dev-live-reload | ./dev-live-reload |
|
encoding-selector | ./encoding-selector |
|
exception-reporting | ./exception-reporting |
|
find-and-replace | ./find-and-replace |
|
fuzzy-finder | ./fuzzy-finder |
|
github | pulsar-edit/github |
|
git-diff | ./git-diff |
|
go-to-line | ./go-to-line |
|
grammar-selector | ./grammar-selector |
|
image-view | ./image-view |
|
incompatible-packages | ./incompatible-packages |
|
keybinding-resolver | ./keybinding-resolver |
|
language-c | ./language-c |
|
language-clojure | ./language-clojure |
|
language-coffee-script | ./language-coffee-script |
|
language-csharp | ./language-csharp |
|
language-css | ./language-css |
|
language-gfm | ./language-gfm |
|
language-git | ./language-git |
|
language-go | ./language-go |
|
language-html | ./language-html |
|
language-hyperlink | ./language-hyperlink |
|
language-java | ./language-java |
|
language-javascript | ./language-javascript |
|
language-json | ./language-json |
|
language-less | ./language-less |
|
language-make | ./language-make |
|
language-mustache | ./language-mustache |
|
language-objective-c | ./language-objective-c |
|
language-perl | ./language-perl |
|
language-php | ./language-php |
|
language-property-list | ./language-property-list |
|
language-python | ./language-python |
|
language-ruby | ./language-ruby |
|
language-ruby-on-rails | ./language-ruby-on-rails |
|
language-rust-bundled | ./language-rust-bundled |
|
language-sass | ./language-sass |
|
language-shellscript | ./language-shellscript |
|
language-source | ./language-source |
|
language-sql | ./language-sql |
|
language-text | ./language-text |
|
language-todo | ./language-todo |
|
language-toml | ./language-toml |
|
language-typescript | ./language-typescript |
|
language-xml | ./language-xml |
|
language-yaml | ./language-yaml |
|
line-ending-selector | ./line-ending-selector |
|
link | ./link |
|
markdown-preview | ./markdown-preview |
|
notifications | ./notifications |
|
one-dark-syntax | ./one-dark-syntax |
|
one-dark-ui | ./one-dark-ui |
|
one-light-syntax | ./one-light-syntax |
|
one-light-ui | ./one-light-ui |
|
open-on-github | ./open-on-github |
|
settings-view | ./settings-view |
|
package-generator | ./package-generator |
|
pulsar-updater | ./pulsar-updater |
|
snippets | pulsar-edit/snippets |
|
solarized-dark-syntax | ./solarized-dark-syntax |
|
solarized-light-syntax | ./solarized-light-syntax |
|
spell-check | ./spell-check |
|
status-bar | ./status-bar |
|
styleguide | ./styleguide |
|
symbols-view | pulsar-edit/symbols-view |
|
tabs | ./tabs |
|
timecop | ./timecop |
|
tree-view | ./tree-view |
|
update-package-dependencies | ./update-package-dependencies |
|
welcome | ./welcome |
|
whitespace | ./whitespace |
|
wrap-guide | ./wrap-guide |