[scintilla:feature-requests] #1099 [PATCH] LexHTML: Add highlighting support for PHP functions and constants

0 views
Skip to first unread message

Alexander Cupacenko

unread,
Jan 27, 2015, 5:33:05 PM1/27/15
to scintill...@googlegroups.com

[feature-requests:#1099] [PATCH] LexHTML: Add highlighting support for PHP functions and constants

Status: open
Group: Committed
Labels: scintilla lexer php
Created: Tue Jan 27, 2015 10:33 PM UTC by Alexander Cupacenko
Last Updated: Tue Jan 27, 2015 10:33 PM UTC
Owner: Neil Hodgson

SciLexer allows only one distinct color for PHP keywords at the moment. However, most of the existing syntax highlighting color schemes (Monokai, Solarized, Oblivion, etc.) provide multiple distinct colors for PHP language functions (abs acos, acosh, addcslashes, addslashes, etc.) and constants (PHP_VERSION, PHP_INT_MAX, PHP_EOL, etc.) in addition to the language control keywords (if, else, while, foreach, etc.).

This is a great feature and it is a pity to miss it in Scintilla's SciLexer library. There are quite a few requests on the subject around, even here on source forge https://sourceforge.net/p/notepad-plus/discussion/331754/thread/f58b6b26 .

I have attached a patch which allows SciLexer-based text editors (Notepad++ and alike) to use separate colors for PHP keywords, function and constants highlighting.

Thank you,
Alex


Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

Neil Hodgson

unread,
Jan 27, 2015, 5:44:52 PM1/27/15
to scintill...@googlegroups.com
  • Group: Committed --> Won't_Implement
  • Comment:

This only enhances PHP and not any of the other languages handled by the HTML lexer. The HTML lexer needs an expansion that is fair to all of the languages involved and allows each language to defined multiple sets of differently styled identifiers. The method for this is to implement substyles with ILexerWithSubStyles. This would require changing the HTML lexer into an object lexer and is considerable work.

http://www.scintilla.org/ScintillaDoc.html#LexerObjects

Rejecting the patch as adding these features will make it more difficult for a proper rewrite that enhances the HTML lexer significantly.


[feature-requests:#1099] [PATCH] LexHTML: Add highlighting support for PHP functions and constants

Status: open
Group: Won't_Implement


Labels: scintilla lexer php
Created: Tue Jan 27, 2015 10:33 PM UTC by Alexander Cupacenko
Last Updated: Tue Jan 27, 2015 10:33 PM UTC
Owner: Neil Hodgson

ufku

unread,
Nov 24, 2015, 9:07:10 AM11/24/15
to scintill...@googlegroups.com

Just passing by and want to mention Emeditor's highlighter. It has the most customizable keyword highlighter i've ever seen. It provides a keyword-defining interface with regular expression support and allows you to assign these keywords to one of the 10 highlighter groups. You can even differentiate global variables from the regular ones for PHP. The best part is that it is independent of the language.

As a Notepad++ user i would love to see a similar implementation in scintilla.


[feature-requests:#1099] [PATCH] LexHTML: Add highlighting support for PHP functions and constants

Status: open
Group: Won't_Implement


Labels: scintilla lexer php
Created: Tue Jan 27, 2015 10:33 PM UTC by Alexander Cupacenko

Last Updated: Tue Jan 27, 2015 10:44 PM UTC
Owner: Neil Hodgson
Attachments:

Neil Hodgson

unread,
Jun 29, 2026, 8:13:13 PM (3 days ago) Jun 29
to scintill...@googlegroups.com

The HTML lexer is now able to style multiple sets of PHP keywords as 'substyles' of SCE_HPHP_WORD.

The APIs for substyles are documented at https://scintilla.org/ScintillaDoc.html#Substyles .


[feature-requests:#1099] [PATCH] LexHTML: Add highlighting support for PHP functions and constants

Status: open
Group: Won't_Implement


Labels: scintilla lexer php
Created: Tue Jan 27, 2015 10:33 PM UTC by Alexander Cupacenko

Last Updated: Tue Nov 24, 2015 02:07 PM UTC
Owner: Neil Hodgson
Attachments:

Neil Hodgson

unread,
Jun 29, 2026, 8:13:30 PM (3 days ago) Jun 29
to scintill...@googlegroups.com
  • status: open --> closed

[feature-requests:#1099] [PATCH] LexHTML: Add highlighting support for PHP functions and constants

Status: closed
Group: Won't_Implement


Labels: scintilla lexer php
Created: Tue Jan 27, 2015 10:33 PM UTC by Alexander Cupacenko

Last Updated: Tue Jun 30, 2026 12:13 AM UTC
Owner: Neil Hodgson
Attachments:

SciLexer allows only one distinct color for PHP keywords at the moment. However, most of the existing syntax highlighting color schemes (Monokai, Solarized, Oblivion, etc.) provide multiple distinct colors for PHP language functions (abs acos, acosh, addcslashes, addslashes, etc.) and constants (PHP_VERSION, PHP_INT_MAX, PHP_EOL, etc.) in addition to the language control keywords (if, else, while, foreach, etc.).

Reply all
Reply to author
Forward
0 new messages