Spin ctags
Hi.
An off-shoot of some work i'm doing for SimpleIDE is a spin ctags program. The ctags program searches files for language symbols and creates a lookup method for different editors. If you are a VI or EMACS user, it is a great benefit. I've only tested it with VIM.
The editor must understand UTF16 fonts like the Parallax font to be useful with such files. Linux VIM automatically translates the files. For other editors, one can use the iconv program to convert Parallax files to ASCII.
The ctags program will create a tags file (or TAGS with -e) that will make tags for spin files specified on the command line as:
$ ctags *.spin c:/spinlib/*.spin
Some current limits/issues:
If you need a source pointer for some reason it's in the propside.googlecode.com repository. There are two ctags folders. I'm only using ctags-5.8 long term so that's where you'll find the source. Also, I'm not actually using the ctags program for generating spin tags in SimpleIDE because I need a better database than ctags can provide.
An off-shoot of some work i'm doing for SimpleIDE is a spin ctags program. The ctags program searches files for language symbols and creates a lookup method for different editors. If you are a VI or EMACS user, it is a great benefit. I've only tested it with VIM.
The editor must understand UTF16 fonts like the Parallax font to be useful with such files. Linux VIM automatically translates the files. For other editors, one can use the iconv program to convert Parallax files to ASCII.
The ctags program will create a tags file (or TAGS with -e) that will make tags for spin files specified on the command line as:
$ ctags *.spin c:/spinlib/*.spin
Some current limits/issues:
- Using tags with an editor that does not support the parallax font will be disappointing. While the ctags program itself doesn't seem to have trouble with the font.
- The ctags program will not automatically look up the correct object for symbols. The user must know to do this manually. This could be enhanced for spin.
- There is at least one bug where a symbol like "dat0 long $55" will be tagged as "0".
Comments
Not vim on my Debian box here. What am I missing?
$ file Servo32_Ramp_v2.spin Servo32_Ramp_v2.spin: Little-endian UTF-16 Unicode English text, with CRLF line terminators
Opening in vim gives a screen full of garbage and dos2unix barfs:
$ dos2unix Servo32_Ramp_v2.spin
dos2unix: Skipping binary file Servo32_Ramp_v2.spin
Only way out is with iconv:
$iconv -f UTF-16 -t ASCII Servo32_Ramp_v2.spin
Which always throws up when it hits graphics chars in the file:
iconv: illegal input sequence at position 29288
Which happens to be the box around the license text. So try again with the -c option
BINGO it works!
God I hate all the internationalization nonsense. And who thought graphics chars in source files was a good idea?
I have a simplified chinese font installed for testing - maybe that affects it. No idea.
Your help for early testing of the SpinSIDE would be very useful at this point.
The QPlainTextEdit is supposed to do all this for us. Need some verification though.
Hope my spin ctags effort is useful otherwise.
The source browser parser in SimpleIDE certainly benefited from it.
Thanks.
--Steve
I'll see what I can do.
Propably someone we know.
[*]vi -t symbol
[*]vim -t symbol
[/LIST]
[*]Put cursor over a symbol then Ctrl+] (Ctrl and Right Bracket)
[*]ESC, :ta symbol
[*]ESC, :pop
[/LIST]
It is possible modify the ctag program to find a symbol based on scope, but I haven't added that.
[*]ctags *.spin
[/LIST]
[*]ctags main.spin FullDuplexSerial.spin
[/LIST]