Getting Emacs ada-mode working

Welcome to the forum!

Pity, but Emacs 29.3 locks up in a 100% loop on loading an ada source file.

i’ve spent some time wrangling ada-mode in an attempt to get it working, as i describe starting in this comment in another thread:

Interesting: trying to open the body file in Emacs causes Emacs to pause seemingly indefinitely, with the following message in the echo area, until i C-g.

waiting for wisi parser Ada start in buffer less_trivial_trie.adb

After the C-g, i can switch to that buffer without issues.

As i’m on Emacs 29.3 myself, with tree-sitter support having been added to Emacs in 29.1 (released 30 July 2023), i tried ada-ts-mode, and had a much better experience than i did with ada-mode:

[W]hat i did just now was install ada-ts-mode via Emacs’ package manager, without uninstalling ada-mode. It installed without issues. i then opened less_trivial_trie.adb - in doing so, i was informed that there was no tree-sitter grammar installed, and would i like to install one from <url>? i answered yes, it installed without issues, and the file was syntax-highlighted. :slight_smile: A very quick and painless process …

Looking at the source of ada-ts-mode.el, it doesn’t depend on ada-mode. It does, however, basically make itself the provider of ada-mode.

All in all, i’d say ada-ts-mode feels very promising indeed

One issue with ada-ts-mode at this point is its lack of indentation support, although that’s something the mode’s author is working on. However, one can nevertheless use the Ada Language Server for indentation; refer to this issue in the ada-ts-mode repo, in which the ada-ts-mode dev helped me get that set up.

Given the preceding, i’d say that, unless one can’t move to Emacs 29.1 or later for some reason, people should definitely give ada-ts-mode a go.