wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 05-10-2007, 02:48 AM   #1
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default vJASS Syntax Highlighter for notepad++

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??:
First download and install Notepad++ in your PC.
  1. Type %APPDATA%\Notepad++ in Run box, then Enter, there will be a opened folder appears.
  2. in the 7z file, you'll find out a file named "userDefineLang.xml".
  3. Extract "userDefineLang.xml" into the opened folder.
  4. Launch Notepad++ and it's ready :)

In order to test it, open a new file, select the menu Language > vJASS. You should see highlighted the code in vJASS.

Screenshot
Zoom (requires log in)

.:
IMPORTANT UPDATE: Now you can use auto completion for vJASS. Select the vJASS.xml file contained in the 7z file, and extract it to Your_Notepad++_Installation_Dir\plugins\APIs (Example: C:\Program Files\Notepad++\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.

This list includes all the commands from common.j, common.ai and Blizzard.j

I hope this can be useful for people new with vJASS. Comments and suggestions are always welcome.

Changelog

(16/05/2007):
* Minor improvement. Added the debug as a keyword, sorry if it doesn't look as something different, but the api auto completion is more useful :P


(15/05/2007):

* Added vJASS.api file, so you can use auto completion in Notepad++
* Removed the constants differentiation to enable common.j and common.ai function highlighting. With this you will now if you are using a function from any of this libraries.


(11/05/2007):

* Added more constants definitions to the highlighter (Thanks Purplepoot)
* Removed the function and method folding so it doesn't generate bugs in notepad++.


(27/03/2009):
* Current version of Notepad++ has changed the API format, so it's mandatory to use this update for the current version of this program (Thanks Flame_Phoenix for the API list)
* Improved a little bit the highlighting and added new keywords.

Attached Images
File Type: jpg Clip_2.jpg (47.4 KB, 2214 views)
Attached Files
File Type: 7z vJass highlighter for N++.7z (14.8 KB, 1711 views)

Last edited by moyack : 03-28-2009 at 03:27 AM.
moyack is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 05-10-2007, 04:05 AM   #2
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

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.
Attached Images
File Type: jpg error.jpg (254.1 KB, 244 views)
__________________

Last edited by Ammorth : 05-10-2007 at 04:14 AM.
Ammorth is offline   Reply With Quote
Old 05-10-2007, 04:23 AM   #3
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

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?
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful

Last edited by Vexorian : 05-10-2007 at 04:25 AM.
Vexorian is offline   Reply With Quote
Old 05-10-2007, 12:19 PM   #4
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

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.

Last edited by moyack : 05-10-2007 at 06:05 PM.
moyack is offline   Reply With Quote
Old 05-10-2007, 10:31 PM   #5
1337D00D
User
 
1337D00D's Avatar
 
Join Date: Dec 2006
Posts: 67

1337D00D has little to show at this moment (2)

Default

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.

Last edited by 1337D00D : 05-10-2007 at 10:50 PM.
1337D00D is offline   Reply With Quote
Old 05-10-2007, 11:03 PM   #6
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

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.

Last edited by moyack : 05-10-2007 at 11:17 PM.
moyack is offline   Reply With Quote
Old 05-11-2007, 11:44 PM   #7
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

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)
PurplePoot is offline   Reply With Quote
Old 05-12-2007, 12:40 AM   #8
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

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:

Collapse 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.

Last edited by moyack : 05-12-2007 at 12:46 AM.
moyack is offline   Reply With Quote
Old 05-12-2007, 01:07 AM   #9
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

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.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 05-12-2007, 01:15 AM   #10
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Vexorian
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.
Yes, I agree with you :)

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.
moyack is offline   Reply With Quote
Old 05-12-2007, 02:06 AM   #11
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Note: You didn't need to add TEXTMAP_FLAG_, I already gave you TEXTMAP_ and you put that in too :p
PurplePoot is offline   Reply With Quote
Old 05-12-2007, 02:26 AM   #12
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by moyack
Yes, I agree with you :)

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.
properties are going to get added, I am also planning to add /* */
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 05-16-2007, 02:51 AM   #13
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

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
moyack is offline   Reply With Quote
Old 06-22-2007, 09:07 AM   #14
Silvenon
User
 
Silvenon's Avatar
 
Join Date: May 2007
Posts: 492

Submissions (1)

Silvenon will become famous soon enough (63)Silvenon will become famous soon enough (63)Silvenon will become famous soon enough (63)

Send a message via MSN to Silvenon
Default

I don't understand the highlighting procedure.

Quote:
3. Do the same procedure 1. to the PC destination. Copy the "userDefineLang.xml" into the opened folder.

Can you please explain this step?

Quote:
Now you can use the auto completion by pressing CTRL+SPACE and you will see the list of functions.

Press CTRL+SPACE where? Inside Notepad ++? Also does Notepad ++ indent after certain keywords?
Silvenon is offline   Reply With Quote
Old 06-23-2007, 11:15 PM   #15
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

My apologies for my late response, I don't know why I didn't see this thread :P

The important part of this is:
  1. Install Notepad++
  2. Download the zip file
  3. in the run box, you type "%APPDATA%\Notepad++" (without the quotes)
  4. Open the zip file and copy the "userDefineLang.xml" file into that folder
  5. And voila!!

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.

Last edited by moyack : 06-23-2007 at 11:17 PM.
moyack is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:22 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services