SciTE Ruby Lexer

G’day fellow Rubyists,

I am currently rewriting the Scintilla Ruby Lexer and Folder code from
scratch. A code snapshot of today is available from
http://www.tua.ch/ruby > Current (source code and windows binaries of
SciTE with new lexer).

I would like folding and highlighting to be as Ruby-like as possible.
However, I need your help for this: Is there anything that bugs you
SciTE users about your editor in connection to Ruby ? Flood me with
suggestions; I am keeping a todo list here.


kaspar

semantics & semiotics
code manufacture

www.tua.ch/ruby

I don’t know if this will help you. I took a brief look at your LexRuby.cxx
but realized that I am not into Scintillas lexing system.

You may find inspiration by looking at the syntax coloring code I have
made (entirely in Ruby).
http://neoneye.dk/syntax.html

BTW: your tar.gz file didn’t have a top dir, which may mess other peoples
unpack directory up. I suggest you fix it.

···

Kaspar Schiess eule@space.ch wrote:

I am currently rewriting the Scintilla Ruby Lexer and Folder code from
scratch. A code snapshot of today is available from
tua.ch - und andere Domains günstig und einfach online kaufen auf top-domains.ch > Current (source code and windows binaries of
SciTE with new lexer).

I would like folding and highlighting to be as Ruby-like as possible.
However, I need your help for this: Is there anything that bugs you
SciTE users about your editor in connection to Ruby ? Flood me with
suggestions; I am keeping a todo list here.


Simon Strandgaard

“Kaspar Schiess” eule@space.ch wrote in message

I would like folding and highlighting to be as Ruby-like as possible.
However, I need your help for this: Is there anything that bugs you
SciTE users about your editor in connection to Ruby ? Flood me with
suggestions; I am keeping a todo list here.

A short wish list, some may be outside "folding/highlighting’

(1)--------- Compact folds

The following:

···

==================
#A’s are for doing

this kind of stuff

-class A

  • def f
    stuff
    end
    end

-class B
def f;end
end

When folded at class A should show:

+class A

-class B
def f;end
end

i.e. Fold should hide the corresponding ‘end’, excess whitespace/newlines
AFTER that end, and aligned comments and excess whitespace BEFORE before the
start. This should apply to all foldable constructs. The -/+ option that
appears today on “end” and serves to fold/unfold following whitespace and
comments is not useful, even counterintuitive.

(2)--------- Multiple buffers/files
Probably ignorance on my part. I have only been able to view one file/butter
at a time in a Scite window; so I have to open multiple Scite windows
instead. I would really like to be able to split the window (horizontally or
vertically) and see more than one buffer.

(3)---------- Debugger?
Again, probably ignorance on my part. Any way to connect Scite to ruby
debugger?

I don’t know if this will help you. I took a brief look at your
LexRuby.cxx
but realized that I am not into Scintillas lexing system.
…I wasn’t either. :wink:

You may find inspiration by looking at the syntax coloring code I have
made (entirely in Ruby).
http://neoneye.dk/syntax.html
Thank you, I certainly will.

BTW: your tar.gz file didn’t have a top dir, which may mess other peoples
unpack directory up. I suggest you fix it.
I have changed that. Sorry for messing up your dl directory and probably
others.


kaspar

semantics & semiotics
code manufacture

www.tua.ch/ruby

Its Me wrote:

(3)---------- Debugger?
Again, probably ignorance on my part. Any way to connect Scite to ruby
debugger?

Well, kind of…

FreeRIDE uses the same Scintilla edit control that is used by Scite, but
also includes an integrated debugger, source navigation by
module/class/method, and soon to have Ruby refactoring support:

http://freeride.rubyforge.org/

Curt

“Kaspar Schiess” eule@space.ch wrote in message

I would like folding and highlighting to be as Ruby-like as possible.
However, I need your help for this: Is there anything that bugs you
SciTE users about your editor in connection to Ruby ? Flood me with
suggestions; I am keeping a todo list here.

A short wish list, some may be outside "folding/highlighting’

(1)--------- Compact folds

The following:

#A’s are for doing

this kind of stuff

-class A

  • def f
    stuff
    end
    end

-class B
def f;end
end

When folded at class A should show:

+class A

-class B
def f;end
end

i.e. Fold should hide the corresponding ‘end’, excess whitespace/newlines
AFTER that end, and aligned comments and excess whitespace BEFORE before the
start. This should apply to all foldable constructs. The -/+ option that
appears today on “end” and serves to fold/unfold following whitespace and
comments is not useful, even counterintuitive.

(2)--------- Multiple buffers/files
Probably ignorance on my part. I have only been able to view one file/butter
at a time in a Scite window; so I have to open multiple Scite windows
instead. I would really like to be able to split the window (horizontally or
vertically) and see more than one buffer.

Try this:
Edit SciTE.properties
Add:
tabbar.visible=1
tabbar.multiline=1
If that does not work I can send you my SciTE.properties file, I do use
tabs and multiple buffers and I rarely open more than one Scite window.

Yours,

Jean-Hugues

···

At 02:39 01/05/2004 +0900, you wrote:

(3)---------- Debugger?
Again, probably ignorance on my part. Any way to connect Scite to ruby
debugger?


Web: @jhr is virteal, virtually real
Phone: +33 (0) 4 92 27 74 17

Its Me wrote:

A short wish list, some may be outside "folding/highlighting’

Your whishes were:
a) Folding improovement:
Actually the old Ruby lexer and folder was just a Python lexer. Hence
the end does not fold. I will see to improoving that, but my first stage
was lexer improvement (nested strings).

b) Multiple Buffers:
This is a FAQ on the SciTE list :wink: There is a way to do it, as was
posted elsewhere on this thread.

c) Debugger:
FreeRIDE includes one… and will hopefully include my lexer, making it
the perfect IDE… might even adopt using it.

Glad I can make it :wink:


kaspar

semantics & semiotics
code manufacture

www.tua.ch/ruby

Its Me:

(2)--------- Multiple buffers/files
Probably ignorance on my part. I have only been able to view one
file/butter
at a time in a Scite window; so I have to open multiple Scite windows
instead. I would really like to be able to split the window (horizontally
or
vertically) and see more than one buffer.

This is a fairly core restriction: while SciTE can have multiple files
loaded at once and can display tabs to switch between them, there is no way
to see the contents of more than one file at at time. I am unlikely to agree
to lifting this restriction as I want SciTE to remain simple. For more
complex tasks, a more featureful application would be a better fit. If
others wish to start a project that adds multiple views to an extended
version of SciTE then I’ll try to help out so that they can continue to
benefit from enhancements to my version of SciTE.

For Ruby development, I feel you are much better off with an application
designed around the needs of Ruby including integration of debugging, use of
Ruby-compatible regular expressions, and an understanding of the files that
make up a Ruby project and the links between them. It would be a good idea
to develop such an application in a sensible high level language like Python
:wink: rather than C++. FreeRIDE seems to be on the right track.

Neil

[snip]

BTW: your tar.gz file didn’t have a top dir, which may mess other peoples
unpack directory up. I suggest you fix it.
I have changed that. Sorry for messing up your dl directory and probably
others.

Don’t worry, history has learned me to always make a dir for that tar.gz
I wish to untar, so no accident here.

IMHO its just good practice to make a top-dir :slight_smile:

···

Kaspar Schiess eule@space.ch wrote:


Simon Strandgaard

Perhaps this can be tackled from a different angle:
(Disclaimer - I have little experience in windowing systems, so I’m
not sure about the feasibility of embedding an external application in
a window widget - but I’ll just let my imagination run wild this one
time :wink: )
You can have multiple SciTE windows open… So instead of modifying
SciTE to provide two buffers, could an application wrapper be written
to open two SciTE windows and place them in a split frame? That is,
embedding two SciTE instances in one window. Then you’d have the best
of both worlds - SciTE remains simple, and you have your two open
buffers which you can see at the same time. Again, this is just a
crazy idea of mine… I don’t guarantee that it works or even that
it’s feasible. Cheers

···

On Sat, 1 May 2004 09:14:06 +0900, Neil Hodgson nhodgson@bigpond.net.au wrote:

Its Me:

(2)--------- Multiple buffers/files
Probably ignorance on my part. I have only been able to view one
file/butter
at a time in a Scite window; so I have to open multiple Scite windows
instead. I would really like to be able to split the window (horizontally
or
vertically) and see more than one buffer.

This is a fairly core restriction: while SciTE can have multiple files
loaded at once and can display tabs to switch between them, there is no way
to see the contents of more than one file at at time. I am unlikely to agree
to lifting this restriction as I want SciTE to remain simple. For more
complex tasks, a more featureful application would be a better fit. If
others wish to start a project that adds multiple views to an extended
version of SciTE then I’ll try to help out so that they can continue to
benefit from enhancements to my version of SciTE.

For Ruby development, I feel you are much better off with an application
designed around the needs of Ruby including integration of debugging, use of
Ruby-compatible regular expressions, and an understanding of the files that
make up a Ruby project and the links between them. It would be a good idea
to develop such an application in a sensible high level language like Python
:wink: rather than C++. FreeRIDE seems to be on the right track.

Neil

Hi!

Simon Strandgaard wrote:

[snip]

BTW: your tar.gz file didn’t have a top dir, which may mess other peoples
unpack directory up. I suggest you fix it.
I have changed that. Sorry for messing up your dl directory and probably
others.

Don’t worry, history has learned me to always make a dir for that tar.gz
I wish to untar, so no accident here.

IMHO its just good practice to make a top-dir :slight_smile:

Using ‘mc’ hit F3 on any kind of supported archive to see if there
is a top-dir. FreeBSD does not install mc per default but it’s in the
ports.

For an uncompressed tar archive

tar tf archive.tar|head -1

is sufficient to see if there is a top-dir (use ‘tjf’ for ‘.tar.bz2’
and ‘txf’ for ‘.tar.gz’). It should print something that ends in a
slash and looks similar to the archive name :->

Josef ‘Jupp’ Schugt

···

Kaspar Schiess eule@space.ch wrote:

Its interesting to see how others deal with tar.gz files.

It would be nice if we had an ‘utopia untar’ which per default
ensured that the content got extracted into a top-dir. If the file
didn’t got one, a top-dir was created.

Same senario with unzip.

Maybe if untar+unzip+unrar were combined and named unpack.

Does such tool exist?

···

Josef ‘Jupp’ Schugt jupp@gmx.de wrote:

Simon Strandgaard wrote:

Kaspar Schiess eule@space.ch wrote:

BTW: your tar.gz file didn’t have a top dir, which may mess other peoples
unpack directory up. I suggest you fix it.
I have changed that. Sorry for messing up your dl directory and probably
others.

Don’t worry, history has learned me to always make a dir for that tar.gz
I wish to untar, so no accident here.

IMHO its just good practice to make a top-dir :slight_smile:

Using ‘mc’ hit F3 on any kind of supported archive to see if there
is a top-dir. FreeBSD does not install mc per default but it’s in the
ports.

For an uncompressed tar archive

tar tf archive.tar|head -1

is sufficient to see if there is a top-dir (use ‘tjf’ for ‘.tar.bz2’
and ‘txf’ for ‘.tar.gz’). It should print something that ends in a
slash and looks similar to the archive name :->


Simon Strandgaard

Its interesting to see how others deal with tar.gz files.

It would be nice if we had an ‘utopia untar’ which per default
ensured that the content got extracted into a top-dir. If the file
didn’t got one, a top-dir was created.

Same senario with unzip.

Maybe if untar+unzip+unrar were combined and named unpack.

Does such tool exist?


Simon Strandgaard

I’m not aware of the existence of such a tool, but I’m sure a small
script could be hacked up to do this… I’ve done similar ones before.
Also, if you bug me long enough I’ll probably give in and write you
one… Just don’t complain about my syntax horrors :wink: (seriously, I’m
not that bad, and I document well, so you’ll be able to hack it back
into your liking). Cheers!
-CWS

···

On Sun, 2 May 2004 08:50:31 +0900, Simon Strandgaard neoneye@adslhome.dk wrote: