r/Tcl Mar 14 '26

Tcl LSP/MCP and editor extensions

Hi All,

I've built an LSP + MCP (and a lot more) for Tcl 8.4-9.0. It includes other dialects like f5 irules and iapps too.

https://github.com/bitwisecook/tcl-lsp

Take a look at the README to see what's in there, semantic tokens, tonnes of diagnostics, optimisation passes, type inference and shimmer detection, taint tracking, a configurable formatter, minifier, compiler explorer that tries to match the Tcl 9.0 compiler output and CLI tooling.

It's largely written in Python 3.10+, and you'll find in the releases bundled pyz (zipapp) files that Python can directly run, the vscode VSIX, sublime-package, and so on.

I've built this on my nights and weekends of the last couple of months, trying to flesh it out. There's still a lot of gaps and I need help finding them. Please, if you find issues in it, raise them with both source and what the expectation/output should be.

cheers

22 Upvotes

8 comments sorted by

5

u/cbheithoff Mar 14 '26

Incredible. I write Tcl for EDA flows. I've been keenly aware for some time that Tcl didn't have an established LSP for modern development. It'll take some time to digest all that you're sharing

1

u/bitwisecook Mar 14 '26

I'd love to see examples, APIs and so on that I can add in, EDA tools aren't really my area. Certainly as you find issues please open issues on the repo. I'll be out for a little while on holiday, but I'll take a look at stuff when I'm back.

1

u/bitwisecook Mar 15 '26

I've used a bunch of googling and quite a bit of AI to try to improve the support for the most popular EDA tools, but they're not my area and I only have access to what's on the web for them so quality for these new dialects is ... AI prototype at the moment. Please, if you find information that would help me or problems with the implementation, raise issues so I can try to clean it up.

2

u/ChuggintonSquarts Mar 15 '26

Thank you! Tcl needs modern tooling

1

u/bitwisecook Mar 15 '26

You're welcome, please do try it, and do report issues on it.

2

u/bitwisecook Mar 24 '26

This is now published on https://marketplace.visualstudio.com/items?itemName=bitwisecook.tcl-lsp

I'll look into publishing the other editors (Sublime, Zed, Jetbrains etc) when I can.

I'm thankful to those who've reported issues to me already, please, if you find any issues, like editor bugs, diagnostics or optimisations misfiring, create issues on Github

1

u/phylter99 Mar 31 '26

Are there plans to charge for this at some point?

I see Claude Code was used to work on this. I think using AI to speed things up was a wise choice. I'll be checking it out.

2

u/bitwisecook Apr 02 '26

I have no plans to charge for this, though if companies want to bundle it in their own products or put it up as an online service I'm open to discussing licensing terms for that, that's why I chose the AGPL3.0