It is currently March 28th, 2024, 8:57 am

RainLexer 2.20.0 (syntax highlighter for Notepad++)

Plugins and Addons popular with the Community
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by jsmorley »

oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: RainLexer 2.6.0 (syntax highlighter for Notepad++)

Post by oZone »

jsmorley wrote: December 8th, 2019, 2:58 pm Done..

I'm ambivalent about "deprecated" items. I could argue it either way. Since they still work, and in the interests of backwards compatibility, I can argue that they still should be highlighted. In the interest of weaning folks off of them, I could argue they shouldn't. I opted for the more conservative "leave them in" for now, while I chew on it.
There are other deprecated options, but for these I couldn't find any information. So I was curious if they still work and what is their function.

I think it would be good if deprecated options had different highlight color.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainLexer 2.6.0 (syntax highlighter for Notepad++)

Post by jsmorley »

oZone wrote: December 8th, 2019, 3:25 pm I think it would be good if deprecated options had different highlight color.
I considered that as well, but I'm not sure I like it. Since a color in and of itself doesn't indicate what it is trying to say, having some arbitrary color for "deprecated" items doesn't tell the user much other than "something about this is different". Red for errors is pretty self-evident, but any other color you might select doesn't really say "deprecated" to me.

I think if we want to deprecate stuff from RainLexer, we just remove it so it isn't highlighted. That pretty much says "I don't recognize this", which might be best.

I'm not a fan of "hounding" people about using deprecated options or values. I do like a gentle reminder when it comes up, but there are just boatloads of existing skins out there that people get and use, and I like a light-touch on this.

To be honest, I'm also not sure what all is involved in adding a whole new "category" to RainLexer. I'm in no way any expert on the underlying code.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: RainLexer 2.6.0 (syntax highlighter for Notepad++)

Post by oZone »

jsmorley wrote: December 8th, 2019, 3:32 pm I considered that as well, but I'm not sure I like it. Since a color in and of itself doesn't indicate what it is trying to say, having some arbitrary color for "deprecated" items doesn't tell the user much other than "something about this is different". Red for errors is pretty self-evident, but any other color you might select doesn't really say "deprecated" to me.

I think if we want to deprecate stuff from RainLexer, we just remove it so it isn't highlighted. That pretty much says "I don't recognize this", which might be best.

I'm not a fan of "hounding" people about using deprecated options or values. I do like a gentle reminder when it comes up, but there are just boatloads of existing skins out there that people get and use, and I like a light-touch on this.

To be honest, I'm also not sure what all is involved in adding a whole new "category" to RainLexer. I'm in no way any expert on the underlying code.
There is also option to use italic, bold font, something similar to user-defined variables and in-built variables, but I see your point.

Currently I am busy (Christmas is coming), but I will try to look into it.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by jsmorley »

Part of the problem with a new category for deprecated stuff is that aside from the fact that I have no idea how to do it, in my view it quickly gets more complex than it might seem at first blush. There are several types of "deprecation" that would need to be accounted for (or not):

1) A deprecated option name.
2) A deprecated value for a valid option.
3) The all-too-common !Rainmeter... prefix added to bang names. The ! is valid and needed, the Rainmeter isn't.
4) The !Execute bang, that isn't an option or a value, but shouldn't be used to either execute an external command or stack up multiple bangs.
5) Things like "Author", which are still valid, but have moved which section they need to be in. Author as an example was previously in [Rainmeter] and now should be in [MetaData].

I think I see a rabbit with a big pocket watch...
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by oZone »

jsmorley wrote: December 8th, 2019, 3:45 pm Part of the problem with a new category for deprecated stuff is that aside from the fact that I have no idea how to do it, in my view it quickly gets more complex than it might seem at first blush. There are several types of "deprecation" that would need to be accounted for:

1) A deprecated option name.
2) A deprecated value for a valid option.
3) The all-too-common !Rainmeter... prefix added to bang names.
4) The !Execute bang, that isn't an option or a value, but shouldn't be used to either execute an external command or stack up multiple bangs.
5) Things like "Author", which are still valid, but have moved which section they need to be in. Author as an example was previously in [Rainmeter] and now should be in [MetaData].
1) and 2) should be easy to implement,
3) rainlexer ignore it, so code for this would need to be rewritten
4) !Execute bang is not even highlighted (not in rainlexer.xml)
5) this will be hard

So if I want to implemented it I would do only 1), 2) and 4)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by jsmorley »

oZone wrote: December 8th, 2019, 4:16 pm 1) and 2) should be easy to implement,
3) rainlexer ignore it, so code for this would need to be rewritten
4) !Execute bang is not even highlighted (not in rainlexer.xml)
5) this will be hard

So if I want to implemented it I would do only 1), 2) and 4)
Fair enough...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by jsmorley »

I think there must be something baked in to detect and then allow the Rainmeter... prefix on !Bangs. It's not specifically defined in the xml, but still works as long as the underlying bang is valid.


1.png
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by oZone »

jsmorley wrote: December 8th, 2019, 4:27 pm I think there must be something baked in to detect and then allow the Rainmeter... prefix on !Bangs. It's not specifically defined in the xml, but still works as long as the underlying bang is valid.
yup

Code: Select all

// Skip rainmeter before comparing the bang
if (bangs.InList(&buffer[(strncmp(buffer, "rainmeter", 9) == 0) ? 9 : 0]))
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: RainLexer 2.8.0 (syntax highlighter for Notepad++)

Post by oZone »

oZone wrote: December 8th, 2019, 4:16 pm 1) and 2) should be easy to implement,
3) rainlexer ignore it, so code for this would need to be rewritten
4) !Execute bang is not even highlighted (not in rainlexer.xml)
5) this will be hard

So if I want to implemented it I would do only 1), 2) and 4)
So I tried to implemented it, so far it works.
I haven't checked if there are another deprecated items, so there may some missing.
I decided to use for deprecated items same coloring as valid items, but italic font to differentiate them.
I haven't tested it extensively, but here it is.
File Removed
Last edited by oZone on December 14th, 2019, 2:11 pm, edited 1 time in total.
Post Reply