| 05-10-2007, 02:48 AM | #1 | |||
Hi guys: Probably there are people asking... what is Notepad++?? well, this program is a very enhanced notepad, with many (but many) interesting functions to edit, and visualize text. Its features are impressive and they can be seen here. This program is free and it can be downloaded here. In the recent versions of this program, they offer the possibility to create a custom Syntax Highlighting and Syntax Folding. After testing and learning about it, I decided to make one for vJASS because I love the highlighting. I think the result is good enough and uses the last JASSHelper syntax, so you will have highlighting for libraries, structs, methods, etc. How to install it??:
Screenshot .:
I hope this can be useful for people new with vJASS. Comments and suggestions are always welcome.
|
| 05-10-2007, 04:05 AM | #2 |
Sexy! Pluse repo! Btw, you should include a comment that it requires saving the file as .j or .ai before the settings take effect. Edit: There is an error... (it happens with JassCraft aswell, except notepad wraps the error) using call SetTableReal("(MCS-UC)" , "\"", 0.404) will cause the string highlight to wrap. |
| 05-10-2007, 04:23 AM | #3 |
I once dropped notepad++ because it didn't let me pick a different highlighting for //! over //
Also, I thought you needed a plugin for auto complete? Or have they added a way to do it without plugins? |
| 05-10-2007, 12:19 PM | #4 |
No, there is not neccesary to make a plugin for that, they've added the API files, (*.api) where you put in list all the most common functions. In this case I'll do a file called vJASS.API with all the common.j and common.ai function and variable names, and you just have to do CTRL+SPACE to access the list. |
| 05-10-2007, 10:31 PM | #5 |
Awesome. Can it also correct function capitalization like JassCraft does? (Turns getunitx into GetUnitX upon typing the "(" ) EDIT: found a bug, if you use function in a code callback like in a timer, it creates a [+] fold button. |
| 05-10-2007, 11:03 PM | #6 |
In theory it doesn't, but I'm planning to add autocompletion functionality by adding a command list, so in some way, you can do what are you asking. Thanks for your comments, I'll see how to fix them. |
| 05-11-2007, 11:44 PM | #7 |
Nice, but lacking a few things, in my opinion -- <Keywords name="Words4">debug SCOPE_PREFIX SCOPE_PRIVATE bj_ EVENT_ UNIT_ ITEM_ EFFECT_ SOUND_ CAMERA_ DAMAGE_ ATTACK_ GAME_ MAP_ PLAYER_ RACE_ TEXTMAP_ VERSION_ WEAPON_</Keywords> Replacing "Words4" with that would highlight warcraft's constants as well, what about adding that? (Or making constants have their own highlighting) Also, you forgot 'elseif' in "Words2", and 'not' in "Words1" Finally, what about moving 'interface' to "Folder+" and 'endinterface' to "Folder-"? (though don't do that with methods unless there's a way to tell them not to try to fold when they're in an interface) |
| 05-12-2007, 12:40 AM | #8 |
Thanks for your comments :) @Ammorth: I tried to fix it, but it's impossible, I think we have to live with it :( @PurplePoot: About the Words4 section, I've added those, I think it's a good idea. About interface, I've decided not to add it because you can use in vJASS function interfaces, which bugs with folding. Here's an example about this feature: JASS:function interface Arealfunction takes real x returns real // as you can see, this doesn't fold, but notepad++ will show it // as a fold keyword, closing all the code above that line :P function double takes real x returns real return x*2.0 endfunction function triple takes real x returns real return x*2.0 endfunction function Test1 takes real x, Arealfunction F returns real return F.evaluate(F.evaluate(x)*F.evaluate(x)) endfunction function Test2 takes nothing returns nothing local Arealfunction fun = Arealfunction.double //syntax to get pointer to function call BJDebugMsg( R2S( Test1(1.2, fun) )) call BJDebugMsg( R2S( Test1(1.2, Arealfunction.triple ) )) //also possible... endfunction And the same happens with function and method, when you call a callback code, for instance. Those keywords will have disabled the folding to avoid this kind of issues. |
| 05-12-2007, 01:07 AM | #9 |
you don't get to use method in callback, but it would still mess with interface. you just get to wish notepad++ was more flexible. |
| 05-12-2007, 01:15 AM | #10 | |
Quote:
Updated the file. @Vexorian: Probably this is offtopic, are you going to implement properties get and set?? so I can add it to the highlighter. |
| 05-12-2007, 02:06 AM | #11 |
Note: You didn't need to add TEXTMAP_FLAG_, I already gave you TEXTMAP_ and you put that in too :p |
| 05-12-2007, 02:26 AM | #12 | |
Quote:
|
| 05-16-2007, 02:51 AM | #13 |
IMPORTANT UPDATE: Now you can use autocompletion for vJASS. You must add the vJASS.api file contained in the zip file, and extract it to Your_Notepad++_Dir\plugins\APIs. Now you can use the auto completion by pressing CTRL+SPACE and you will see the list of functions. Press ENTER to autocomplete the desired text. Now the common.j and common.ai files will be highlighted, making more easier your coding process :) Please check the first post and update your files :D |
| 06-22-2007, 09:07 AM | #14 | ||
I don't understand the highlighting procedure. Quote:
Can you please explain this step? Quote:
Press CTRL+SPACE where? Inside Notepad ++? Also does Notepad ++ indent after certain keywords? |
| 06-23-2007, 11:15 PM | #15 |
My apologies for my late response, I don't know why I didn't see this thread :P The important part of this is:
If you create a new file and you want to select the vJASS highlighting, click on the menu Language > vJASS, and it will highlight it for you :) About the autocompletion functionality, it works when you are writing code, just write part of the command and press CTRL+SPACE and a list box will appear. If you write more in the command, the list box updates automatically narrowing the functions which begin with the word that you are writing. To select the word, just press ENTER or make double click with the mouse. tell me if it works now. About the autoindent.... no, it doesn't do that, it only remember the last indent done I'm afraid. |
