ORX syntax highlighter,auto-completion for np++

jimjim
edited January 2012 in Projects - Tools
Hi everyone,

This is my second post. But I am not here to ask any question, I am here to share something. I don't know if it would help anyone. I have made an ORX config syntax highlighter and auto keyword-completion for notepad++. I have not found anything this kind in this forum, if anybody has better solution then please share it with us.

The main feature is

1. It differentiates int/bool and vector/float. So when I see a code I know how would be its value.

2. And the most amazing thing for me is auto complete. When I type a single letter it shows me all ORX config keyword so that I can choose the right keyword. A simple demonstration is given here.
1.jpg

Though,it may not be helpful for those who knows ORX but can be helpful for new users like me. But notepad++ is only for windows. So if anyone has made this kind of things for other cross-platform editor or any better syntax highlighter for notepad++ then please share it with us.

I have attached a zip file which contains two xml files, orx.xml and orx_syntax.xml. I am using notepad++ version 5.9.6.2, which is the current version I think. Now ,what to do to use this features :

Step 1: Start notepad++, click 'View' -> 'User Defined Dialogue' another sub window will pop up.

Step 2: Click 'Import' and then select orx_syntax.xml , when you get a pop up menu saying "Import Successful" then the ORX syntax highlighter is correctly imported. To see the change restart notepad++. Now when you click 'Language' from menu bar, you will see 'orx' at the bottom of the list. Now you can use ORX syntax highlighter selecting ORX.

Step 3: To use ORX auto code-complete feature go to the directory where notepad++ is installed, for me it is "C:Program FilesNotepad++". Then go to directory pluginsAPIs and copy the orx.xml file in this folder. You will also see c.xml, cpp.xml, java.xml, hlml.xml and even xml.xml in this folder.
To see the effect restart the notepad++.

Step 4: This is the final step. Open any orx configuration file and select ORX as language and you are done :)

You can press ctrl+shift to bring the keyword box or you can enable auto-completion by selecting
'Settings'-> 'Preferences' -> 'Backup/auto-completion'
and
clicking 'Enable auto-completion on each input' , 'function completion' and 'Function parameters hint on input'.

I am not very good at making tutorial, in fact this first time I am doing anything like this, so there may be mistakes. So, Pardon me if I have done any mistakes so far.
:)

Here is the attachment , contains orx.xml and orx_syntax.xml
https://forum.orx-project.org/uploads/legacy/fbfiles/files/orx_npp_syntax.zip

Comments

  • edited January 2012
    Brilliant work! Thank you very much for this, I look forward to making much use of it!
  • edited January 2012
    Oh excellent! The auto-completion will be of much help! Thanks again for your contribution.

    If it's not too much trouble, do you think you could add a quick section in the wiki (probably in the tutorial/setup section: http://orx-project.org/wiki/en/orx/tutorials/main)?
  • edited January 2012
    Also, if it's ok with you, I'll add it on the svn in the tools section. If you want to modify it later, I can give you write access to the svn if you give me your sourceforge ID.
  • jimjim
    edited January 2012
    Hi everyone,

    Thank you all. I did not except this kind of feedback from you guys :) I thought this would not be much of a help, but now it seems it would be helpful. Actually I don't know how to add tutorial, so if anybody add this in the wiki, it will be fine for me. Anybody can use it and change it. If I add something then I will post it here, because I have no experience with SVN. There may be mistakes so if anybody point it out then it will be helpful :)

    Auto-completion works just fine but the function parameter may trouble some one, if anybody presses '=' after any keyword the parameter list will pop up and it will go down when pressing ';'
    Anyone can stop showing function parameter, from notepad++ 'Settings' if it becomes annoying.

    And thanks again, I have never got this much appreciation from anyone so I am very happy :)
  • jimjim
    edited January 2012
    Hey,

    I am back with a tiny change, I forgot to add 'pixel' as a keyword :P So, here is the one with 'pixel' added in both orx.xml and orx_syntax.xml , one has to go through the steps again if he does not add 'pixel' manually in the previous xmls. Please inform me if any other keyword is left out.

    NB: Before importing orx_syntax.xml again, one has to delete the previous ORX from language list, otherwise there will be two ORX in language list, which can be frustrating.
    https://forum.orx-project.org/uploads/legacy/fbfiles/files/orx_npp_syntax_v1.zip
  • edited January 2012
    Thanks for the update! :)
    I'll post in on the SVN myself then, sometimes during this week.
    As a frequent user of N++, I love it. I think I was just too lazy to even think of doing something like this myself. ;)
  • jimjim
    edited January 2012
    Don't mention ! I too am lazy, so that I don't have to type a few extra letter in the future I did it now.
  • edited January 2012
    I've tested it, and it works amazingly well.

    The one thing I've noticed that you're missing is that if you use a ; anywhere but on its own line, it doesn't grey what comes after it. Is there any way to fix that? It's not too big a problem, but it's just kinda weird to see a white, orange, or other colored comment when you're not paying too much attention and read the comment as code.
  • jimjim
    edited January 2012
    I think it has something to do with the language option for ORX, I am checking it now
  • jimjim
    edited January 2012
    I think notepad++ is treating ';' as an operator. To remove this from operator list, deselect ';' from your keyword list. To do it open 'user defined dialogue' box and select ORX from 'User Language'. Then click 'Operators' tab and remove ';' from your 'Activated keyword' list. This should fix it.

    If this does not do then click 'Comment & Number' tab and make sure 'Treat symbol as keyword' box is checked and ';' is given in the white box.

    I think I have found the fix, if you insert ';' immediately after any character without any white space before ';' , then it will not be treated as a comment symbol.

    So just use a blank space before ';' , this will definitely fix it and I hope so.
  • edited January 2012
    Got it working! Thank you!

    By the way, I think you missed a keyword:
    UseParentCamera.

    EDIT: Nope, I was wrong. The keyword is ParentCamera. No wonder! I thought something was off in my code. Your syntax highlighter has actually helped me catch a bug! you rock!
  • jimjim
    edited January 2012
    I am happy that it's working :)

    Let me know if anything is wrong or some changes are needed. How is the auto-complete function ?

    I am not currently doing anything as my exam is going on, so I am unable to use it in any project, if you are using it then it will be a kind of beta testing for this tool :)
  • edited January 2012
    I didn't even realize that it had autocompletion! I just turned it on... awesome. Great work you've done here!
  • jimjim
    edited January 2012
    It also has function parameter hint, if you don't know.
    Just go to Settings -> Preferences -> Backup/Auto-completion then click 'Function parameters hint on input' and you will see the magic :ohmy:
    auto.jpg


    And thanks :)
    auto 101K
  • jimjim
    edited March 2012
    Hi all,
    I noticed some config changes in the latest SVN so I have added those. So I added ShowDebug, FXDelayList , RGB , HSL , HSV.
    https://forum.orx-project.org/uploads/legacy/fbfiles/files/orx_npp_syntax_v2.zip
  • edited March 2012
    Hi jim,

    Thanks for the update! I should add a tool section on the wiki and you could link your file there if you wish.
  • jimjim
    edited March 2012
    Yeah, if you think so it can be done. But I don't know if it is good enough to be a tool. I am also trying to make this kind of tool for other editor, but don't know which is/are widely used. I am seeing Sublime text editor, but it is a bit difficult adding custom syntax in Sublime that np++, but I will give it a try.
  • edited March 2012
    It's indeed a valuable tool for orx users!

    I completely switched to Sublime Text 2 myself, so having syntax highlight/completion there would be awesome. :D

    It's using the Textmate language definition syntax, except with JSON instead of PList. I'm pretty sure you already have this link, but just in case: http://sublimetext.info/docs/en/reference/syntaxdefs.html
  • jimjim
    edited April 2012
    Hey,
    I was checking ORX tutorial 7, which is FX tutorial and I noticed I missed "Absolute". It is in the highlighter but not in the code-completion and thought to add it.
    So far I have checked Gray's tutorial and ORX tutorial 1-6 still many things to learn. But so far learning ORX has been great for me :) I wish I found ORX a year ago,but it is not too late. I will surely back if I have any questions so far no question.
    Thanks everybody and hail ORX :D

    Edit : Oooooops, I first tried to upload the orx.xml, then a message pops us saying only compress files allowed. Here is the file in zip, hehe............
    https://forum.orx-project.org/uploads/legacy/fbfiles/files/orx.zip
    orx 17.4K
  • edited April 2012
    Thanks for the update!

    I should definitely create a tools section in the wiki and you could update it there. I can also give you online storage space if you need it.

    I'm glad you still enjoy learning orx! Looking forward to seeing what you make with it. :)
  • edited April 2012
    Nice, thanks!

    Btw, there's a mailing list where all commits made on the SVN are published if you want to get automatically updated. =)
  • jimjim
    edited April 2012
    I did not know about the mailing list,but I definitely want to get automatic update.

    Edit: But I don't know what to do so that I get mail containing SVN update.
  • edited April 2012
  • jimjim
    edited April 2012
    Thanks iarwain, I am now subscribed :D
  • edited July 2012
    Thanks! :)
Sign In or Register to comment.