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 03-22-2009, 01:39 AM   #1
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default vJass syntax highLight for gEdit

What is Gedit?
Gedit is a simple text tool with many highlights for Linux with Gnome. It is free and open source software and is not available for Windows, so yes, if you are a Windows user, this is not for you.
You can have more information about Gedit at: http://projects.gnome.org/gedit/

Hi guys, a few days ago I was working on Linux... when suddenly I wanted to code warcraft (lol). However, I don't have it installed on Linux due a few problems and so JNGP can not help me. So, the next logical solution would be to make something light that could aid me making my codes, which is why I decided to create this plugin for Gedit, a plugin that allows people to have syntax highlight checker in Gnome for vJass.
This plugin allows the user to have highlights to all non-BJ functions and to automatically view ".j" files. This plugin is the most possible user friend there can be with the limitations of Gedit .lang files, I can't add anything else or it won't run because it will be to big (damn stupid compilers xD ). It gave me lots of work and hell to make this thing work, please I hope Linux people enjoy it xD

Click image for larger version

Name:	vJassPlugin.jpg
Views:	452
Size:	124.3 KB
ID:	41463

History:
Hidden information:

Version 1.0:
- Initial public release

Version 1.1:
- Added "local" and "elseif" to keywords
- Improved the documentation in many points

Version 1.2:
- Added Credits to the comments of the header of the file
- Completed the game variable type highlight

Version 1.3:
- Completed the list of keywords
- Added more people to credits

Version 1.4:
- Added more keywords
- Fixed a small exploit with word nothing
- Closed the file, it cannot support anything esle


How to install?

There are two files: vJass.lang and vJass.xml and they go to separate folders.

vJass.xml:
1 - This is an optional step. By making it you will be able to automatically have the vJass highlights mode when you open a ".j" file. It is not necessary to make the highlights work, but it is nice because this way you don't need to go to "View -> Highlight -> Others -> vJass".
2 - Go to "~/.local/share/mime/packages" (create it if it doesn't exist yet)
2.1 - Remember .local is a hidden folder, you have to enable the view of hidden folders
3 - paste this file there
4 - Go to "~/.local/share" and run: "update-mime-database mime" (if you can't run the command it is ok as well, but I advice to do so)

vJass.lang:
1 - This is the necessary step for you to have highlights working.
2 - copy this file to the following path: "/usr/share/gtksourceview-2.0/language-specs"

Note: All the process must be done with Gedit closed.

After this simple steps, Gedit will now syntax Highlight vJass from ".j" files =P
Have fun!
Attached Files
File Type: zip vJassHEGedit.zip (12.1 KB, 283 views)
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 04-19-2009 at 11:58 AM.
Flame_Phoenix is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-22-2009, 06:16 PM   #2
Barade
User
 
Barade's Avatar
 
Join Date: May 2006
Posts: 164

Barade is on a distinguished road (14)

Default

Sounds well but I would have prefered Kwrite/Kate.
Maybe I will test it next days.
__________________
Barade is offline   Reply With Quote
Old 03-22-2009, 06:57 PM   #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

Dude your thread title sounds like some spammer trying to boost google page ranks...

Quote:
Sounds well but I would have prefered Kwrite/Kate.
You could, like make it yourself...

I should really find out if there's a way for Jass in geany, I would be able to get rid of gvim as Jass is the only reason I have that installed. Yeah, I wish to have a geany vJass plugin, however those things are made.

Edit: Regarding this: It doesn't seem to highlight local or elseif...
__________________
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 03-22-2009, 08:25 PM   #4
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
Sounds well but I would have prefered Kwrite/Kate.
A KDE adept hein? Well, I suppose the files and extensions can't differ much, however the information available for Kate extensions is quite limited, and the foruns are not much of a help. If I do something for Kate, I will be sure to post it here.

Quote:
Dude your thread title sounds like some spammer trying to boost google page ranks...
I am sorry, my true intention was to be very specific. Can someone please change the title to:
vJass HighLight checker for Gedit please? I will add "What is Gedit" mini-section after the title is changed.

Quote:
I should really find out if there's a way for Jass in geany, I would be able to get rid of gvim as Jass is the only reason I have that installed. Yeah, I wish to have a geany vJass plugin, however those things are made.
Sounds very interesting. Let me make a quick search:

Quote:
Originally Posted by Geany FAQ
Q: Can I add custom filetypes by creating a filetypes.foo configuration file? (^)

A: No, this is not supported. Perhaps in future some basic support for this may be added.

Q: How do I add filetype support for language Foo? (^)

A: Please see the HACKING document.

Q: Can I extend Geany myself? (^)

A: Yes! You can write your own plugins in C. You can also write Lua scripts for Geany using the Lua plugin. See the Plugins page. Also note the Format->Send Selection to command is useful for piping text through a script/external program.

So, Hacking Geany seems to be quite legal... nice =P
For more info:
http://www.geany.org/Documentation/FAQ#QQuestions4

Quote:
Edit: Regarding this: It doesn't seem to highlight local or elseif...
Ohhh I forgot those xD
Well, problem is now Fixed version 1.1 released.

I really hope this gets approved xD

EDIT EDIT EDIT

New version released, 1.2, see "History" for more information.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 03-22-2009 at 08:26 PM.
Flame_Phoenix is offline   Reply With Quote
Old 03-24-2009, 10:32 AM   #5
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Bump, new version released, 1.3, see changelog for more info.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 03-24-2009, 11:34 PM   #6
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

approval bait.
__________________
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 03-25-2009, 10:09 AM   #7
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Thx for approval =D

I wonder if I can make a tutorial on how to have JNGP in Linux ... xD

Anyways, back on topic, I hope Gnome users enjoy this extension.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 03-25-2009 at 10:09 AM.
Flame_Phoenix is offline   Reply With Quote
Old 04-19-2009, 07:18 AM   #8
cokemonkey11
User
 
Join Date: Feb 2006
Posts: 28

cokemonkey11 has little to show at this moment (0)

Default



Thanks again bro. And I'd take you up on that JNGP in linux offer, it'd be nice to get back into mapping.
cokemonkey11 is offline   Reply With Quote
Old 04-19-2009, 08:46 AM   #9
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

*cough* bug, second nothing isnt highlighted.

add nothing to variable types ...
and add module, endmodule and implement.
And why is "threaded" highlighted as keyword ?

And when you highlight onDestroy, you should highlight onInit aswell ....and allocate and eventual even create / Create
__________________

Last edited by akolyt0r : 04-19-2009 at 09:19 AM.
akolyt0r is offline   Reply With Quote
Old 04-19-2009, 12:00 PM   #10
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
*cough* bug, second nothing isnt highlighted.
nothing is defined as a keyword. If it doesn't get highlighted it's because of gnome's poor gtk compiler.
Quote:
add nothing to variable types ...
and add module, endmodule and implement.
not sure if that will be possible. You see, gnome's gtk compiler is so weak, that it doesn't allow me to add anything else to the list. If I add more keywords and regular expressions to the list, the user will start seeing "Efficiency problems" on the plugin, and if I ignore this warning and add even more, the plugin will simply blow up gedit and nothing will be highlighted at all.

I will give this a better look however. Thx for rep.
As for the gnome plugin database, I make no idea on how to do that xD

EDIT EDIT EDIT


plugin updated, please read History for more information.
I will not fix nor add anything else about missing keywords or datatypes or missing things. The file is already giving me efficiency warnings, the source file is now considered to big. Any attempt at adding more information will blow the plugin. This is the best you can do with the current version of Gedit.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 04-19-2009 at 12:01 PM.
Flame_Phoenix is offline   Reply With Quote
Old 04-19-2009, 12:31 PM   #11
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

i added more keywords to my file myself, however i havent got any warnings ...
__________________
akolyt0r is offline   Reply With Quote
Old 04-19-2009, 01:49 PM   #12
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
i added more keywords to my file myself, however i havent got any warnings ...
Seriously, you don't believe me? Fine, do whatever you want.

I explicitly say for people NOT to add anything else to version 1.4 of Gedit HE, I will not take responsibility for what happens.
In your case, the HE still works because it has what I call of a "warning zone". Inside that warning zone, people who know how to work with Gedit via processes will find warnings about the extension of the file. You can add more and more information to the file, however, the "warning zone" will eventually run out of space, and when that happens, the plugin will stop working.

Gedit has a poor architecture, you are not able to see any warnings if you use its GUI. To see Gedit warnings you must open it like a foreground process using the terminal.

Basically, do this:
- Open terminal
- type: "gedit file.j"

After making this simple test, you will see Gedit user interface open and you will read the file. However, in the terminal you will see a huge text, saying that the file has an error, and that the error is "expression is too big" or something like this.

There is a reason why I tell people not to add anything else to the file ... that reason is that the more you add, the more unstable the plugin will be, until it reaches a point of not working at all, and I don't want that to happen.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 04-19-2009 at 02:11 PM.
Flame_Phoenix is offline   Reply With Quote
Old 04-19-2009, 03:06 PM   #13
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

yeah you are right...
However i found a REALLY nice way to fix this issue ...

Hidden information:

Although it took me about an hour to find this fix, since there is nearly no information avaiable about this error... i found it finally ;)
...use prefixes to shrink the definitions:
Code:
<context id="TriggerRegisterFunctions" style-ref="function">
			        <prefix>^TriggerRegister</prefix>
				<keyword>DeathEvent</keyword>
				<keyword>DestDeathInRegionEvent</keyword>
				<keyword>DialogButtonEvent</keyword>
				<keyword>DialogEvent</keyword>
				<keyword>DistanceBetweenUnits</keyword>
				<keyword>EnterRectSimple</keyword>
				<keyword>EnterRegion</keyword>
				<keyword>EnterRegionSimple</keyword>
				<keyword>FilterUnitEvent</keyword>
				<keyword>GameEvent</keyword>
				<keyword>GameStateEvent</keyword>
				<keyword>GameStateEventTimeOfDay</keyword>
				<keyword>LeaveRectSimple</keyword>
				<keyword>LeaveRegion</keyword>
				<keyword>LeaveRegionSimple</keyword>
				<keyword>PlayerAllianceChange</keyword>
				<keyword>PlayerChatEvent</keyword>
				<keyword>PlayerEvent</keyword>
				<keyword>PlayerEventAllianceChanged</keyword>
				<keyword>PlayerEventDefeat</keyword>
				<keyword>PlayerEventEndCinematic</keyword>
				<keyword>PlayerEventLeave</keyword>
				<keyword>PlayerEventVictory</keyword>
				<keyword>PlayerStateEvent</keyword>
				<keyword>PlayerUnitEvent</keyword>
				<keyword>PlayerUnitEventSimple</keyword>
				<keyword>TimerEvent</keyword>
				<keyword>TimerEventPeriodic</keyword>
				<keyword>TimerEventSingle</keyword>
				<keyword>TimerExpireEvent</keyword>
				<keyword>TrackableHitEvent</keyword>
				<keyword>TrackableTrackEvent</keyword>
				<keyword>UnitEvent</keyword>
				<keyword>UnitInRange</keyword>
				<keyword>UnitInRangeSimple</keyword>
				<keyword>UnitLifeEvent</keyword>
				<keyword>UnitManaEvent</keyword>
				<keyword>UnitStateEvent</keyword>
				<keyword>VariableEvent</keyword>
			</context>
other good prefixes would be:
Get...
Set...
Add...
Unit...
Destroy...
Convert...
Create...

you get the idea ...
__________________

Last edited by akolyt0r : 04-19-2009 at 03:20 PM.
akolyt0r is offline   Reply With Quote
Old 04-19-2009, 04:49 PM   #14
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
yeah you are right...
Glad to hear it =D

Quote:
However i found a REALLY nice way to fix this issue ...
If I understood correctly, your solution is "divide" everything into several contexts right?
Well, if that is the case, I am sorry to inform you, I tried that solution before, and it didn't work at the time. It was one of my first tentatives to fix the problem, and it didn't work, at least not for me.
I don't understand how it is possible to work for you ... do you still have that error if you add ALL other functions withing other contexts?
That is weird....

Anyway, unlike most people, you criticized my resource, but you also tried to find a solution. Although it doesn't work (at least it didn't at the time I was creating this) our action is correct, and you deserve a reward.
rep++
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 04-19-2009 at 04:51 PM.
Flame_Phoenix is offline   Reply With Quote
Old 04-19-2009, 04:59 PM   #15
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

you didnt notice that PREFIX-thingy didnt you ????
That cuts downt he size of the actual keywords...
(with Prefix TriggerRegister: "TriggerRegisterPlayerUnitEvent" will result in "PlayerUnitEvent" .. and that will cut down the size of the regular expression, which raises the limit ...for a pretty good ammount)

Quote:
Originally Posted by gtkSourceView EN => DE source
#. regex_new could fail, for instance if there are different
#. * named sub-patterns with the same name or if resulting regex is
#. * too long. In this case fixing lang file helps (e.g. renaming
#. * subpatterns, making huge keywords use bigger prefixes, etc.)
#: ../gtksourceview/gtksourcecontextengine.c:3191
#, c-format
msgid ""
"Cannot create a regex for all the transitions, the syntax highlighting "
"process will be slower than usual.\n"
"The error was: %s"
msgstr ""
"Regulärer Ausdruck konnte nicht für alle Umwandlungen erstellt werden. "
"Syntax-Hervorhebung wird langsamer als gewohnt sein.\n"
"Der Fehler war: %s"
__________________

Last edited by akolyt0r : 04-19-2009 at 05:08 PM.
akolyt0r 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 03:52 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