Highlights for Literal Variables surrounded by " ` "
Example: `Content`
How to do this?
In Customize Theme Environment, there is no Possibility of Inclusion.
In the Syntax editor, I didn't understand how to do this.
I would like this highlight to be available for all Languages, or at least HTML, Javascript, PHP, Java.
Thanks
Highlights for Literal Variables surrounded by " ` ".
Re: Highlights for Literal Variables surrounded by " ` ".
If you want to use backtick char (`) to denote "characters" (I use terminology from the Theme Manager: characters, string, text), then I'm afraid I have bad news for you: it is impossible to use backtick and single quote at the same time for the same purpose -- at least for PHP, for which I made a quick test. Anyway, it can be set in the Syntax Editor (Options > Syntax > Char), but only the first char put there is used.
Why would you want to do it, anyway? Backticks in PHP do not delimit strings.
Why would you want to do it, anyway? Backticks in PHP do not delimit strings.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Re: Highlights for Literal Variables surrounded by " ` ".
Note that "Literal Strings" or "Template strings" has dozens of applications in javascript, html, less, php, among others.
I've already developed more elegant, maintainable, and much leaner code using this feature.
ECMA-262 and ISO/IEC 16262 since 2015 already have this as standard.
65% of what PHP, in real life, does is write server-side "pages" that will be interpreted and displayed by the client-side browser, many of them with quite complex functionality.
Don't be fooled by my simple questions...
I have much more expertise and multidisciplinary knowledge than you can imagine...
And on occasion, it is good to point out that as developers of this type of application, it is more beneficial for you to identify users' needs than to question the reason for these needs, since the vast majority are professionals in the area.
Thanks.
I've already developed more elegant, maintainable, and much leaner code using this feature.
ECMA-262 and ISO/IEC 16262 since 2015 already have this as standard.
65% of what PHP, in real life, does is write server-side "pages" that will be interpreted and displayed by the client-side browser, many of them with quite complex functionality.
Don't be fooled by my simple questions...
I have much more expertise and multidisciplinary knowledge than you can imagine...
And on occasion, it is good to point out that as developers of this type of application, it is more beneficial for you to identify users' needs than to question the reason for these needs, since the vast majority are professionals in the area.
Thanks.
Re: Highlights for Literal Variables surrounded by " ` ".
This is debatable, but that's not the point: the point is I'm not a developer of RJ TE and I didn't want to question (as in put in doubt) the reason for your needs, I was simply curious and hoped I would learn something new about use of backticks in PHP.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Highlights for Literal Variables surrounded by " ` ".
I experimented a bit and this is what I came up with.
In the JScript.syx file add the following in the [Block] section:
Is it enough or is anything missing?
In the JScript.syx file add the following in the [Block] section:
Code: Select all
[Block]
...
3_Name=Template literals
3_OnLine=0
3_AsString=0
3_Start=`
3_End=`
3_FirstOnLine=0
3_OnlyAfter=
3_HighlightKeywords=1
3_HighlightNumbers=1
3_HighlightSymbols=1
3_HighlightBlocks=1
3_HighlightStrings=0
3_HighlightChars=0
4_Name=Expressions
4_OnLine=0
4_AsString=0
4_Start=${
4_End=}
4_FirstOnLine=0
4_OnlyAfter=
4_HighlightKeywords=1
4_HighlightNumbers=1
4_HighlightSymbols=1
4_HighlightBlocks=1
4_HighlightStrings=0
4_HighlightChars=0
Is it enough or is anything missing?
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Highlights for Literal Variables surrounded by " ` ".
Except for in JavaScript I'm not sure this is widely used.
Backticks in PHP are used to create an Execution Operator.
I've added support for those as well.
But how are backticks used in LESS or HTML ?
Backticks in PHP are used to create an Execution Operator.
I've added support for those as well.
But how are backticks used in LESS or HTML ?
Re: Highlights for Literal Variables surrounded by " ` ".
Simple examples:
They are responsible for the reliable transmission of attribute states and properties. Many of these properties can take on complex values, including for integrity checking.
In JS they are extremely useful for creating templates.
Javascript is an interpreted language (in loco) that structures like:
"Something here" + variable + "Continuing something"...
They can degrade application performance quickly.
Many do not use, because they only do the basics, but if you look at the code of good frameworks (> 2015), they are full of this kind of structure!
In PHP, this example is Basic of Basic, and could be replaced without too much trouble, but there are much nobler uses in this language for " ` "!
Thanks for your support!
They are responsible for the reliable transmission of attribute states and properties. Many of these properties can take on complex values, including for integrity checking.
In JS they are extremely useful for creating templates.
Javascript is an interpreted language (in loco) that structures like:
"Something here" + variable + "Continuing something"...
They can degrade application performance quickly.
Many do not use, because they only do the basics, but if you look at the code of good frameworks (> 2015), they are full of this kind of structure!
In PHP, this example is Basic of Basic, and could be replaced without too much trouble, but there are much nobler uses in this language for " ` "!
Thanks for your support!
- Attachments
-
- Ex.jpg (61.76 KiB) Viewed 13339 times