Skip to content

tads-working-group/tads3-mode

 
 

Repository files navigation

tads3-mode

This TADS 3 Emacs mode was modified by Alexis Purslane alexispurslane@pm.me from Brett Witty brettwitty@brettwitty.net's modification of Stephen Granade's tads2-mode.el to support TADS 3.

This version of the plugin requires Emacs 28.1 (the latest, currently) or later.

Changes my version adds:

  • syntax highlighting for properties when they're being accessed using dot notation
  • syntax highlighting for properties and variables when they're being set
  • syntax highlighting for function and method names when they're being called or defined
  • different syntax highlighting for double-quoted description strings than regular single quoted strings
  • syntax highlighting for substitutions inside strings (only inside the strings, too, using Emacs' anchored highlighters) and are a different font (italic sans serif)
  • syntax highlighting for class names (just based on whether it's an identifier that starts with an uppercase letter)
  • syntax highlighting for numbers
  • Some updates to make it compatible with versions of Emacs since v24 (it was erroring out)
  • Clearer specification of what something is in the imenu list of objects, functions, modifications, etc.
  • Significantly updated code for modern Emacs Lisp/modern Emacs versions
  • An in-editor build system that lets you compile the project the current file belongs to, even if the project root is in a parent directory, with a single key combination, and puts the output of the compiler in a split window where you can click on errors to jump to them in your code.
  • In-editor running in your interpreter of choice
  • Somewhat context-aware autocompletion generated from all of your project files and the libraries listed in your t3m build file whenever you save a new modification!
  • Crude jump-to-definition support with xrefs (it is very difficult to truly figure out where something was defined in TADS 3 because of how dynamic it is, but it works well for objects, classes, functions, just ends up being more of an occurence check for methods, sub-objects, and properties)
  • Completion using completion-at-point-functions instead of hard-coding a company-mode backend
  • Support for company-kinds (not limited to company mode), so you can have icons in your completion popup if you like that sort of thing

Roadmap

  • Autocompletetion
  • Compilation, Error-checking and jump-to-error
  • Add source file to t3m
  • Running the game in editor and refreshing it on build
  • Jump to definition
  • Running test scripts
  • Spellcheck that knows how to deal with TADS text
  • Word count that understands TADS text
  • Strings viewer (the compiler can output all strings)
  • Uploading the plugin to MELPA
  • Refactoring tools
  • Documentation for thing at point

Old Problems

  • Multiline C-style comments like: /* This is a comment */ still have font-lock problems. Multiline font-locking is known to be difficult.
  • In such comments, an apostrophe (') will try to match with something nonsense later on.
  • You cannot move to sub-objects via tads-next-object.

Dependencies

  • Emacs 29.1 or newer
  • GNU Awk

Installation

Installation is simple. git clone this repository somewhere in your load path (somewhere under ~/.emacs.d/) or add wherever you put it to your load path, and then add this code to your configuration file (init.el, config.el under DOOM, etc.):

(autoload 'tads3-mode "tads3" "TADS 3 editing mode." t)
(setq auto-mode-alist
      (append (list (cons "\\.t$" 'tads3-mode))
              auto-mode-alist))

Screenshots

A screenshot showing syntax highlighting for methods, if statements, properties, and so on A screenshot showcasing string substitution syntax highlighting A screenshot showing double quoted strings and double quoted string substitution A screenshot showing the compliation window with a clickable error A screenshot showing the imenu jump to object/method/function/class/property definition fuzzy popup A screenshot showing autocompletion, where only top-level objects, classes, and functions are suggested when not accessing a property A screenshot showing autocompletion, where only sub-objects, methods, and properties are suggested when accessing a property A screenshot showing how autocompletion has general type aware annotations

About

An (updated) TADS 3 mode for Emacs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 97.9%
  • Awk 2.1%