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 316612 - Ruby coloration problems
Ruby coloration problems
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-18 08:34 UTC by Michael Witrant
Modified: 2005-12-30 16:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Fixes proposal (1.40 KB, patch)
2005-09-18 08:40 UTC, Michael Witrant
needs-work Details | Review

Description Michael Witrant 2005-09-18 08:34:32 UTC
Distribution/Version: Ubuntu 5.04

Enter this with Ruby coloration selected and the colors are wrong :

a = 1 / 2
b = 2 / 3 # The begining of this line is considered an regular expression
 =begin # This is considered a multiline comment, but it's wrong :
 =end # These two keywords must be at the begining of the line
Foo = 123 # Foo is a constant but not colored like constants
Comment 1 Michael Witrant 2005-09-18 08:40:35 UTC
Created attachment 52357 [details] [review]
Fixes proposal

* Adds coloration of symbols
* Only the first letter of a constant has to be upper case
* =begin and =end have to be at the begining of the line
* Regular expressions match changed, but it's still wrong
* Allows multiple flags to regular expressions

Regular expressions are very difficult to distingish with divisions. I think
their coloration should be dropped.
Comment 2 Paolo Maggi 2005-10-18 11:09:12 UTC
Thanks for you patch and sorry for the late reply.

I don't know Ruby so I have a couple of questions:
- do you think it is possible to fix the lack of coloration of symbols without
adding a new class for symbols? I don't want to add a new translatable string
since we are string frozen.
- Do you think users will complain if we drop regex coloration?

The patch looks good.
Comment 3 Michael Witrant 2005-10-19 10:34:54 UTC
1. Yes, you can consider symbols like strings
2. Maybe, but you can explain there's no easy way to detect regular expressions
in Ruby, especially by using regexps.
Comment 4 Michael Witrant 2005-10-19 10:47:29 UTC
You could keep the %r{ ... } syntax, but there are a few problems :
* many other symbols also work : %r(...), %r"...", %r$...$, etc.
* nested values aren't supported : with %r{ #{2+2} }, the last "}" isn't colored
as regex

Comment 5 Paolo Maggi 2005-12-30 16:12:17 UTC
Fixed in CVS HEAD.

I have committed the Michael's patch. As he suggested, I have then dropped regex coloration.

2005-12-30  Paolo Maggi  <paolo@gnome.org>

	* gtksourceview/language-specs/R.lang: s/Quote/Quoted

	* gtksourceview/language-specs/gtkrc.lang: s/Quote/Quoted

	* gtksourceview/language-specs/ini.lang: s/Quote/Quoted

	* gtksourceview/language-specs/ruby.lang: fixed bug #316612 (Ruby 
	coloration problems). Patch by Michael Witrant <mike@lepton.fr>