Restoring ‘check syntax’ for ruby files in SciTE

I am somewhat embarrassed to admit that I still use SciTE to edit my ruby files for Watir, considering there are a lot more sophisticated IDEs out there that you can use (Netbeans is one).

When I am using a new version of SciTE I notice it seems to get rid of the options to check ruby syntax (often triggered by Control-1). This can be quickly fixed in the ruby.properties file (under ‘Options’) by ensuring the following properties appear after ‘if PLAT_WIN’:

if PLAT_WIN
command.go.*.rb=ruby $(FileNameExt)
command.go.subsystem.*.rb=1
command.go.*.rbw=rubyw $(FileNameExt)
command.go.subsystem.*.rbw=1
command.help.*.rb=$(CurrentWord)!c:\ruby\doc\ProgrammingRuby.chm
command.help.subsystem.*.rb=4
command.help.*.rbw=$(CurrentWord)!c:\ruby\doc\ProgrammingRuby.chm
command.help.subsystem.*.rbw=4

command.name.1.*.rb=Check Syntax
command.1.*.rb=ruby -cw $(FileNameExt)
command.name.1.*.rbw=Check Syntax
command.1.*.rbw=rubyw -cw $(FileNameExt)

command.name.2.*.rb=Code Profiler
command.2.*.rb=ruby -r profile $(FileNameExt)
command.name.2.*.rbw=Code Profiler
command.2.*.rbw=rubyw -r profile $(FileNameExt)

command.name.3.*.rb=Run irb
command.3.*.rb=irb.bat
command.subsystem.3.*.rb=2
command.name.3.*.rbw=Run irb
command.3.*.rbw=irb.bat
command.subsystem.3.*.rbw=2

command.name.4.*.rb=Debug
command.4.*.rb=ruby -d -r debug $(FileNameExt)
command.subsystem.4.*.rb=2
command.name.4.*.rbw=Debug
command.4.*.rbw= ruby -d -r debug $(FileNameExt)
command.subsystem.4.*.rbw=2

Make sure the help command points to your ruby install. That way you also get nice F1 help on any highlighted ruby syntax.

Important update: 22 August 2009:

Make sure the line 3 above reads

command.go.subsystem.*.rb=1

not ‘=2’, otherwise stdout won’t be shown back in SciTE.

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.

2 thoughts on “Restoring ‘check syntax’ for ruby files in SciTE”

Comments are closed.