Notepad++ Rules syntax highlight
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Notepad++ Rules syntax highlight
I have started on a highlight file for Rules using the text editor Notepad++.
Please feel free to contribute or use. It's the UDL file that you import into Notepad++
https://github.com/Grovkillen/ESP_Easy_ ... adPlusPlus
Please feel free to contribute or use. It's the UDL file that you import into Notepad++
https://github.com/Grovkillen/ESP_Easy_ ... adPlusPlus
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
- budman1758
- Normal user
- Posts: 301
- Joined: 15 Apr 2017, 05:13
- Location: Riverside CA USA
Re: Notepad++ Rules syntax highlight
Just tried to import that. Using the "user language editor" import function and all I got was "import failed"
Am I going about it wrong? (very possible)
Am I going about it wrong? (very possible)
"The glass is twice as big as it needs to be".
Re: Notepad++ Rules syntax highlight
Have you tried to rename the file to 'ESP_Easy_rules.xml'? After import you have the new option like this...
- Attachments
-
- 2018.03.12 19-30-42.png (2.36 KiB) Viewed 13084 times
Last edited by vader on 12 Mar 2018, 19:33, edited 1 time in total.
- budman1758
- Normal user
- Posts: 301
- Joined: 15 Apr 2017, 05:13
- Location: Riverside CA USA
Re: Notepad++ Rules syntax highlight
No. But I will now.
"The glass is twice as big as it needs to be".
- budman1758
- Normal user
- Posts: 301
- Joined: 15 Apr 2017, 05:13
- Location: Riverside CA USA
Re: Notepad++ Rules syntax highlight
Found the problem. Instead of downloading the zip file from git I just right clicked the udf file and chose save as.
Downloaded the zip and it worked fine.
This is a great addition. Kudos!!
Downloaded the zip and it worked fine.
This is a great addition. Kudos!!
"The glass is twice as big as it needs to be".
Re: Notepad++ Rules syntax highlight
Fine! Thank you
Peter
Peter
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Notepad++ Rules syntax highlight
Great to see that you find it useful.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Notepad++ Rules syntax highlight
Updated with more operators and AND/OR tests.
https://github.com/Grovkillen/ESP_Easy_ ... adPlusPlus
Renamed the ext to XML.. sorry for the mistake
https://github.com/Grovkillen/ESP_Easy_ ... adPlusPlus
Renamed the ext to XML.. sorry for the mistake
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Notepad++ Rules syntax highlight
Thanks for doing this saved me lots of time i started reading the instructions to make the file and got lost, one issue if the letters "on" are in a variable or event name they get highlighted.
Yours,
Paul V.
Yours,
Paul V.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Notepad++ Rules syntax highlight
I've looked into this and the UDL2 engine is not that great. So it's either the "on" or the "if" that will be interpreted as code by the code folder. I wish I could use regex to make the highlighting better but until Notepad++ releases the UDL3 engine we're pretty much left on our own.
BUT this is why I plan to make an "IDE" for the rules that will let you do this inside the GUI of the unit.
BUT this is why I plan to make an "IDE" for the rules that will let you do this inside the GUI of the unit.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Notepad++ Rules syntax highlight
Hello Grokvillen,
Hope you are still with us ....
I installed on a new computer the latest notepad++ 8-1-9
I used the esp easy language on my previous computer and found it very usefull. (disk crash and dead!)
Downloaded the zip file on github and change it to .xml but the import failed.
Is this version of the xml file too old ?
Thanks in advance for your answer
Patou
Hope you are still with us ....
I installed on a new computer the latest notepad++ 8-1-9
I used the esp easy language on my previous computer and found it very usefull. (disk crash and dead!)
Downloaded the zip file on github and change it to .xml but the import failed.
Is this version of the xml file too old ?
Thanks in advance for your answer
Patou
Re: Notepad++ Rules syntax highlight
I just downloaded the XML file from Jimmy's GitHub page: https://github.com/Grovkillen/ESP_Easy_ ... adPlusPlus
Saved it into the folder which opens if you select to load a user defined language folder.
See the screenshot to show it is working
It may need some update to add keywords introduced since the last update of this file.
Saved it into the folder which opens if you select to load a user defined language folder.
See the screenshot to show it is working
It may need some update to add keywords introduced since the last update of this file.
- Attachments
-
- 2021-11-04 00_18_32-_new 28 - Notepad++.png (29.75 KiB) Viewed 7206 times
Re: Notepad++ Rules syntax highlight
Just made a PR for updating to all currently known commands and events.
https://github.com/Grovkillen/ESP_Easy_ ... lus/pull/1
You can of course already fetch that XML file for testing.
https://github.com/Grovkillen/ESP_Easy_ ... lus/pull/1
You can of course already fetch that XML file for testing.
Re: Notepad++ Rules syntax highlight
Hello
It works my file was corrupted !!
Please note the new language appears after you reopen the program
Thanks
Patou
It works my file was corrupted !!
Please note the new language appears after you reopen the program
Thanks
Patou
Re: Notepad++ Rules syntax highlight
Hello
I have extended the work of Grokvillen with all the commands present actually in the doc.
General commands and plugin specific commands have different colors.
I am not familiar with the Github update of files.
So please find in attachment the new .xml file.
Please double check and publish it to Github.
Thanks for the important and super quick support.
https://drive.google.com/file/d/1GjP-ok ... sp=sharing
Patou
I have extended the work of Grokvillen with all the commands present actually in the doc.
General commands and plugin specific commands have different colors.
I am not familiar with the Github update of files.
So please find in attachment the new .xml file.
Please double check and publish it to Github.
Thanks for the important and super quick support.
https://drive.google.com/file/d/1GjP-ok ... sp=sharing
Patou
Re: Notepad++ Rules syntax highlight
Your link was not (yet) public, so I sent you a request for access.
Re: Notepad++ Rules syntax highlight
Done hope is now available
Re: Notepad++ Rules syntax highlight
It is.
Apparently you didn't base it on the latest changes I made as the list of events is shorter now.
You also have some control URL commands in the Keywords8
This is the list of events I had in the latest version:
I will now try the file, instead of just looking at the diff
Apparently you didn't base it on the latest changes I made as the list of events is shorter now.
You also have some control URL commands in the Keywords8
Code: Select all
/control?cmd=relay
/control?cmd=relaypulse
/control?cmd=ydim
Code: Select all
Clock#Time=
GPIO#
Login#Failed
MQTT#Connected
MQTT#Disconnected
MQTTimport#Connected
MQTTimport#Disconnected
Rules#Timer=
System#Boot
System#BootMode
System#Sleep
System#Wake
TaskExit#
TaskInit#
Time#Initialized
Time#Set
WiFi#APmodeDisabled
WiFi#APmodeEnabled
WiFi#ChangedAccesspoint
WiFi#ChangedWiFichannel
WiFi#Connected
Re: Notepad++ Rules syntax highlight
Found a bug in it, when folding.
if...endif match OK, but on...endon do not match.
If you fold an "on" part, all till the end of the file is folded.
Or at least it doesn't work if you have an if...endif nested in an on...endon
if...endif match OK, but on...endon do not match.
If you fold an "on" part, all till the end of the file is folded.
Or at least it doesn't work if you have an if...endif nested in an on...endon
Re: Notepad++ Rules syntax highlight
Ah foudn a way to fix it, the on...endon must be folded using the Folding in comment style, as we don't have multiline comments anyway.
Will make a new version of it.
Will make a new version of it.
Re: Notepad++ Rules syntax highlight
Attached the updated file, with the changes made by Patou, added the events and tweaked the nesting a bit more to allow some formatting in strings and highlight %...% along with system events.
I also added the , and the # to the list of operators, so they are clearly noticable when looking over the rules.
Created a new PR for it, including a number of screenshots: https://github.com/Grovkillen/ESP_Easy_ ... lus/pull/2
I also added the , and the # to the list of operators, so they are clearly noticable when looking over the rules.
Created a new PR for it, including a number of screenshots: https://github.com/Grovkillen/ESP_Easy_ ... lus/pull/2
- Attachments
-
- userDefinedLang-ESP_Easy_rule2021.zip
- (2.04 KiB) Downloaded 186 times
Re: Notepad++ Rules syntax highlight
Perfect ...
I shall test in the coming days
Have a nice wk
Patou
I shall test in the coming days
Have a nice wk
Patou
Re: Notepad++ Rules syntax highlight
@Patou & @TD-er, Thanks for updating this.
- Thomas
- Thomas
Re: Notepad++ Rules syntax highlight
And now it would be cool to have somebody doing it for vs code...
For all the poor mac user.
For all the poor mac user.
Who is online
Users browsing this forum: No registered users and 29 guests