After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 553894 - Support Groovy Syntax
Support Groovy Syntax
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-26 06:50 UTC by Christian Helmbold
Modified: 2017-12-29 10:42 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
groovy language file (5.45 KB, patch)
2008-10-31 21:13 UTC, Luis Arias
none Details | Review
gsp language file (5.65 KB, patch)
2008-10-31 21:13 UTC, Luis Arias
none Details | Review
groovy mime file (280 bytes, patch)
2008-10-31 21:14 UTC, Luis Arias
none Details | Review
gsp mime file (270 bytes, patch)
2008-10-31 21:14 UTC, Luis Arias
none Details | Review
Add a language file for Groovy (14.93 KB, patch)
2017-12-23 21:57 UTC, Роман Донченко
committed Details | Review

Description Christian Helmbold 2008-09-26 06:50:36 UTC
Add syntax highlighting for the Groovy language.
Comment 1 Paolo Borelli 2008-10-05 12:46:29 UTC
Unfortunately we do not know all the programming languages, so we do not know groovy syntax.

A groovy.lang file for gtksourceview would be welcome if you or someoneelse contributes it.

see http://live.gnome.org/Gedit/NewLanguage for instructions.
Comment 2 Luis Arias 2008-10-31 21:13:11 UTC
Created attachment 121749 [details] [review]
groovy language file

Groovy language file from here:

http://henyoonline.blogspot.com/2008/07/setting-up-gedit-for-groovy-and-grails.html
Comment 3 Luis Arias 2008-10-31 21:13:47 UTC
Created attachment 121750 [details] [review]
gsp language file

gsp language file from:

http://henyoonline.blogspot.com/2008/07/setting-up-gedit-for-groovy-and-grails.html
Comment 4 Luis Arias 2008-10-31 21:14:28 UTC
Created attachment 121751 [details] [review]
groovy mime file

groovy mime file from:

http://henyoonline.blogspot.com/2008/07/setting-up-gedit-for-groovy-and-grails.html
Comment 6 Luis Arias 2008-10-31 21:17:04 UTC
These files work great with gedit.   Please include them in your next release.  Actually it looks like the mime files need to go in another source package.  I will find it and submit them too.
Comment 7 Luis Arias 2008-10-31 21:18:02 UTC
Ooops, I forgot to mention I filed a bug on this downstream:

https://bugs.edge.launchpad.net/ubuntu/+source/gtksourceview/+bug/291789
Comment 8 Paolo Borelli 2008-11-01 11:08:28 UTC
The files do not carry a license, you should check with the author if they are released under the LGPL license (and out of courtesy you should also probably ask if he's ok with the fact that you are submitting them for upstream inclusion).

The right place for asking about the mime type is the package shared-mime-info which tracks its bugs on bugs.freedesktop.org
Comment 9 Luis Arias 2008-11-01 16:59:49 UTC
I asked the author permission earlier through a comment on their blog but I neglected to ask about the license.  I have posted another comment for information on the license.

Yes thanks I found out about shared-mime-info and I have posted a bug there for including the mime files here:

https://bugs.freedesktop.org/show_bug.cgi?id=18329

Thanks !
Comment 10 Jessie Evangelista 2008-11-21 08:30:58 UTC
Hi guys.

I'm the blogger at henyoonline.blogspot.com mentioned by Luis. I modified the post following stating that:

"
The above 4 files are not under any restrictive license. They are for anyone who may want them for any use they may wish to put them to.
"

Is the above statement enough? Am ok for with upstream inclusion. Am just glad to be of some help. 

Comment 11 Paolo Maggi 2008-11-21 14:27:07 UTC
Do you agree if we include it in gtksourceview upstream relicensing them as LGPL v.2.1 or later?
Comment 12 Jessie Evangelista 2009-03-30 06:05:27 UTC
(In reply to comment #11)
> Do you agree if we include it in gtksourceview upstream relicensing them as
> LGPL v.2.1 or later?
> 

I have no problem with including them files in gtksourceview upstream and relicensing them as LGPL v.2.1 or later? Am not very familiar with the different licensing schemes. Just make sure its unrestrictive as much as possible.

Comment 13 Jessie Evangelista 2009-10-21 07:45:34 UTC
Hi Paolo Maggi.

I agree that you can include the files in gtksourceview and relicensing them as LGPL v.2.1
Comment 14 Ignacio Casal Quinteiro (nacho) 2009-10-21 18:03:40 UTC
Hi jessie,

could you please provide an example for each language file no more than 10 lines?
Comment 15 Ludovic Claude 2010-01-05 09:40:57 UTC
An example of Groovy code:
class Employee {
	def name, salary
	boolean manager
	String toString() { return name }
}

def emps = [new Employee(name:'Guillaume', manager:true, salary:200),
	new Employee(name:'Graeme', manager:true, salary:200),
	new Employee(name:'Dierk', manager:false, salary:151),
	new Employee(name:'Bernd', manager:false, salary:50)]

def managers(emps) {
	emps.findAll { e -> e.isManager() }
}

assert emps[0..1] == managers(emps) // [Guillaume, Graeme]

An example of GSP code:

<select onchange="${remoteFunction(controller:'example', action:'continentSelected',update:'continent', params:'\'continent=\' + this.value' )}">
   <option>select continent</option>
   <option>America</option>
   <option>Asia</option>
   <option>Europa</option>
   <option>Africa</option>
   <option>Australia</option>
</select>
<div/>
<div id="continent">
   Selected continent:
</div>

I hope to see Groovy support in the next release of GEdit!
Thanks.
Comment 16 Роман Донченко 2017-12-23 21:56:54 UTC
I've written a more up-to-date language file for Groovy and will attach it (as a patch) in a moment.

Note that I have no experience with Grails, so I won't be doing one for GSP.
Comment 17 Роман Донченко 2017-12-23 21:57:58 UTC
Created attachment 365912 [details] [review]
Add a language file for Groovy

This was originally based on java.lang (hence the extra copyright lines),
although Groovy is sufficiently different from Java that only the overall
structure and keyword lists have survived from the original file.

Add a test file, as well.
Comment 18 Sébastien Wilmet 2017-12-29 10:42:35 UTC
Review of attachment 365912 [details] [review]:

Thanks for your patch.

I've pushed it on the master branch: commit b22eb9da513cc5e58298c670ed7995e9be4e5907