GNOME Bugzilla – Bug 553894
Support Groovy Syntax
Last modified: 2017-12-29 10:42:56 UTC
Add syntax highlighting for the Groovy language.
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.
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
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
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
Created attachment 121752 [details] [review] gsp mime file gsp mime file from: http://henyoonline.blogspot.com/2008/07/setting-up-gedit-for-groovy-and-grails.html
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.
Ooops, I forgot to mention I filed a bug on this downstream: https://bugs.edge.launchpad.net/ubuntu/+source/gtksourceview/+bug/291789
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
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 !
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.
Do you agree if we include it in gtksourceview upstream relicensing them as LGPL v.2.1 or later?
(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.
Hi Paolo Maggi. I agree that you can include the files in gtksourceview and relicensing them as LGPL v.2.1
Hi jessie, could you please provide an example for each language file no more than 10 lines?
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.
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.
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.
Review of attachment 365912 [details] [review]: Thanks for your patch. I've pushed it on the master branch: commit b22eb9da513cc5e58298c670ed7995e9be4e5907