Using Geany with TADS (mostly Tads 2)

After I got FrobTADS working, I was curious about using the Pi as a coding platform. I mostly use vim, but once I found IDE’s helpful. TADSWorkbench is Windows-only, I think. Also, I think of TWB as being more oriented towards T3? That may be a faulty recollection.

So it looks like Geany is installed by default and it looks reasonable. But I cannot find any evidence online that anyone has invested in customising Geany for TADS? (For example, Amir Karger long ago provided a TADS syntax file for vim, which is hugely helpful). Let me know if there’s a better choice (I haven’t tried running TWB with Wine, for example), but it looks like Geany and TADSWorkbench are both based on Scintilla and it would be possible to copy the TWB syntax highlighting to Geany if that doesn’t violate the TWB license (but I think it might). It might also be sufficient to use C++ syntax highlighting. Any thoughts?

I also added build commands and my results are so-so. I focused on TADS 2 games, I’d like to compile and run. You add new commands through Build > Set Build Commands. You can enter commands and a Perl-ish regex for the error. The docs say that the regex should capture a filename and a line number.

Compile is: /usr/local/bin/tadsc -i/usr/local/share/frobtads/tads2 %f
Run is: lxterminal -e "/bin/sh frob %e"
The regex is: ^([^\(]+)\(([0-9]+)\): error

The compilation and error highlighting seems to work, but running with frob is unusable. frob needs to run in a window and it looks like lxterminal is the default terminal for the Pi, so this should open a window, run frob against the game file. And that happens, but the window closes immediately. This command does the same: lxterminal -e "/bin/sh frob ditch" Not sure why yet.

Finally, spell-checking is a mixed bag. I see Geany flagging spelling errors, but they seem to be random and all the ones I can see are for TADS syntax. When I make a spelling error, it’s not highlighted. I would love to have this working, but it’s the bit I have the least insight into.

MS Visual Studio Code is also available and usually installed by default on the RPi 4. It is more flexible and capable than Genie. If it is not installed, you can install it from the Preferences Menu > Recommended Software > Programming > Visual Studio Code.

I found that the easiest and most reliable way to install VS Code.

There is an Inform package available for VS Code. There is not TADS extension available, unfortunately. I have found that you can tailor syntax highlighting readily.

It is worth a try.

also Kate has TADS 3 syntax highlight (whose work reasonably well with Tads 2), together with Inform 6 syntax highlighting (a fundamental thing in inform 6, with these [; and similiar unusual constructs…)

Also, there’s Hugo syntax hiliting definitons around, so Kate cover all of the classic “Big Three”… hence is my editor of choice for IF (nothing against Vi and EMACS, must be clear !!)

Best regards from Italy,
dott. Piergiorgio.

I found the Visual Studio link and installed it. It wasn’t installed by default. I’m sure there great educational benefit to knowing VS, but it’s been many years since I found it comprehensible. It’s also a little slow on the Pi.There’s a lengthy into, was that supposed to explain the interface? Because one of the first things it did was drop me into extensions without a lot of explanation and it was so slow… I didn’t see TADS and so I installed something for C++ and skipped the rest.

Do, when I open a T2 file, it thinks it’s a Perl test file. It says I can customise run & debug by creating a custom launch.json.I’ll have to google that…

The syntax highlighting for Perl wasn’t too far off. If I used VS in my day job, I’d probably love it, but I’m thinking that Geany or Kate would be better.

Just to be clear, VS is very different from VS Code. VS is very heavy and full fledged IDE. VS Code is an extensible text editor.

1 Like

In the lower right bottom tool bar of VS Code, you can click the “Perl” syntax button. I use C++ syntax and it does pretty well.

I installed Kate, it is not a great implementation on the RPi. Not as good as Geany.

Jeff

1 Like

Good to know. Clearly we haven’t even begun to probe the depths of my ignorance about VS/VSC :slight_smile:

1 Like

I agree, the C++ syntax highlighting works well and that bar had escaped my notice.

1 Like

I suspect that C++ syntax highlighting in TADS 2 should work at least until #pragma C- …

Best regards from Italy,
dott. Piergiorgio.