pascal-ts-mode

2025-07-22

I started this project: https://github.com/bolsen/pascal-ts-mode. (This time on Github because it can pop up on search engines quicker. But it is on Gitlab otherwise.)

opascal-mode is still used for indentation and other things not related to syntax highlighting. The mode is just for highlighting though. I spent only a few hours on it and code looks 100% better in Emacs. opascal-mode, which is in Emacs by default, doesn't do much that it looks weak on what it does highlight. Also, there is a ton of Object Pascal keywords that would never get highlighted.

I got motivated while learning Ada and saw that I installed ada-ts-mode before. This mode did such a good job highlighting Ada code that I had to fight through understanding tree sitter, which was added by default in Emacs since v29.

I started with this https://www.masteringemacs.org/article/lets-write-a-treesitter-major-mode, which bootstrapped me basically.

I might follow the pattern of ada-ts-mode and write a new LSP mode to properly handle LSP cases better (which I already mentioned prior, but in a repository which is more of a scratchpad than a proper library.)

I thought of continuing this theme of fixing the developer tooling outside of Lazarus, particularly just for me, but we'll see as I have time to think about those big problems (and continue to learn Pascal in the process.)

In: pascal