Add morloc language support to Zed editor
See https://zed.dev/docs/extensions/languages
Zed is my daily driver, so it'd be nice to have there
Looks like the core for this would be a good Tree-sitter grammar. I need to make one anyway since this grammar is used in many of the newer editors (even my editor, neovim, supports it now). Looks like it has a great approach to grammars also.
The tree-sitter grammar is a bit more complex than I originally thought. It is a full lexer and parser that builds a concrete syntax tree for the language. I have a partially complete grammar now, but as always the trickiest bit is getting the indentation to be handled correctly.
Okay, thanks for working on this!
OK, I've finally got the tree-sitter parser working. All code in the morloc test suite passes the parser without error.
I've written a minimal extension: zed-morloc
But it is failing to build locally and raising only very vague error messages. This might be an issue with my Zed install (I hear the Linux Zed implementation is a bit janky). Could you try installing the extension @sckott ? Just clone the zed-morloc repo and then hit the "Install Dev Extension" in the Zed extensions tab.
Thanks @arendsee ! Sorry for the delay. Tried just now. and I was able to install it in Zed (I use Zed Preview as daily driver). However, I was not able to select "Morloc" after installing it for some example code.
Thanks @sckott for trying it out! Any helpful error messages by any chance?
i'll take a look and report back
2025-09-09T11:07:54-07:00 ERROR [language::language_registry] failed to load language Morloc:
Error loading brackets query
Caused by:
Query error at 4:3. Invalid node type \"
2025-09-09T11:07:54-07:00 ERROR [language_selector] failed to load language Morloc: Error loading brackets query
This looks like a problem in the brackets.scm file. The double quote matching expression, "\"", should probably be either "\\"" or '"'. I've pushed an update using the single-quotes solution.
On my Linux install, I still see a generic Failed to install grammar 'morloc' error message.
i'll check
tried the latest but it now doesn't have Morloc as an option when I go to select the language 🤔