And I didn’t read too carefully
Dev Build 3145
They do indeed work when I change the syntax to plain text, but I want them to work when the syntax is php.
How do I go about this?
The new references are great, I noticed that symbolIndexTransformation applies to the reference index too. Could it use a separate Transformation (e.g. referenceIndexTransformation)? This would allow to index a region as a symbol with a symbolIndexTransformation as well as a reference with a different referenceIndexTransformation
@devcarlos They are currently scoped differently:
!
: embedding.php text.html.basic meta.embedded.block.php source.php meta.group.php keyword.operator.logical.php
==
: embedding.php text.html.basic meta.embedded.block.php source.php meta.group.php keyword.operator.comparison.php
If the syntax is changed to capture and scope !==
together, then they will be transformed into the proper ligature.
Most likely you are running into https://github.com/sublimehq/Packages/issues/1195, or some variant.
Yep, also works in comments, but notice the colour of my comment has changed too? Is this something that is going to be fixed in the next update?
Thanks but i’m still a little confused to how i’d go about fixing this? is there something I can do on my end or do I need to wait for an update to be pushed out?
You can try to contribute to the Default packages (specifically PHP), but you’ll have to read up on syntax files. Or create an issue over in the Default packages, and maybe one of the contributors will take a look. Now that ligatures are available, I’m almost certain, someone with the know how will be bugged enough to fix it .
Repo is here: https://github.com/sublimehq/Packages.
I don’t think that is strictly necessary. I’m working on something else right at the moment, but I’ll work on getting fixes merged soon.
@wbond will there be an option to use something like Fira Code as our secondary font for ligatures only and our primary font for everything else?
I know people in Atom do that with CSS to add Fira Code ligatures to other fonts like Operator Mono, or some other font that doesn’t cost 200 bucks . Some people like Fira Code, but others only like the ligatures.
Yeah I was playing around with that before when I stumbled across the github repo which explained it, it’s painful to come back to Sublime and see my Roboto Mono font without ligatures, specifically the arrow, it just looks so clean.
I was thinking it shouldn’t be too hard to add something like “ligature_font” or “symbol_font” I’ve never been too good at naming things
Awesome job on the ligatures!
With Fira Code and build 3147 on macOS 10.13, I see ligature weirdness that doesn’t seem to depend on the formatting, like these in plain text files:
HTH,
Neb
Thanks for the report - Sublime Text has some internal rules to further subdivide text into tokens, beyond what the syntax definition indicates. I’ll tweak that for the next build so it doesn’t interfere with ligatures
Despite of a certain use case, a separate referenceIndexTransformation
for the list of references would be consequent. Why?
ST uses
-
symbolTransformation
to transform the localSymbolList
of a view -
symbolIndexTransformation
to transform the globalIndexedSymbolList
Therefore using
-
referenceTransformation
or -
referenceIndexTransformation
to transform the references in the globalIndexedReferenceList
would extend the existing structure best.
References are defined by separate scopes which the showInIndexedReferenceList
attribute is assigned to. Why not using a separate pattern for transformation as well in order to avoid cross references with the normal symbolIndex, which contains the definition but not the usage of a symbol?
Basically it is possible to manipulate a symbol/reference in nearly any way. The used transformations may be different for function definitions and function calls.
Let’s say you want to add different unicode characters as icons in front of those entries or do any other type specific stuff to the symbols’/reference’s label before printed to a quick panel. Other examples might be different indention or added keywords, …
Those transformations can be done by a plugin after requesting the window.lookup_references_in_index(...)
call, but maybe there will be a built-in quick panel like Goto Reference
in the future, which displays the references of a symbol under the cursor directly from the index?
Ligatures have some funny effects in certain situations. Have a look onto the animation. It shows what happens if one selects 3 dots which are handled as ligatures. The font being used is Fira Code
.