os-patches icon indicating copy to clipboard operation
os-patches copied to clipboard

Ruby files always detected as Ruby on Rails

Open sixtyfive opened this issue 6 years ago • 2 comments

When opening a .rb file, Code selects "Ruby on Rails" as the programming language for syntax highlighting, but the file is not part of a Rails project. Not sure why Code isn't choosing "Ruby" (which is available as well) - tried with different files, they're always interpreted as "Ruby on Rails".

image

sixtyfive avatar Oct 17 '18 19:10 sixtyfive

From what I can tell so far this is caused by a patch made on top of gtksourceview specific to elementary-os.

It adds a new language spec at /usr/share/gtksourceview-3.0/language-specs/ruby_on_rails.lang which matches *.rb files. gtksourceview therefore can't distinguish between Ruby/RubyOnRails for *.rb files.

tmullender avatar May 08 '20 10:05 tmullender

Whatever the reason, I can assure you it'll flip off a good number of Ruby developers who usualy wish to be left alone with Rails.

sixtyfive avatar May 08 '20 15:05 sixtyfive

Closing because we no longer patch gtksourceview since OS 7, and I confirmed Code detect .rb files as "Ruby" on OS 8 Early Access.

ryonakano avatar Sep 16 '24 00:09 ryonakano