This is a major mode for Emacs to support editing Structurizr DSL files, based on Structurizr treesitter. Currently it supports font-locking, CSS color highlighting and indentation.
The most basic configuration to use this mode would be something like the following:
(use-package structurizr
:mode ("\\.dsl\\'" . structurizr-mode))With the configuration above, after visiting a .dsl file it will try to parse it with treesitter.
The code should register the Github repository for Structurizr treesitter grammar, and it should ask to install it automatically. In any case it can also be installed manually (M-x [Enter] treesit-install-language-grammar [Enter] structurizr [Enter]).
If you want, in addition, to use Eglot you will have to install the C4 DSL Language Server. After installing it you will have to customize (M-x customize-variable) the variable structurizr-language-server-path, in order to point to the c4-language-server executable.
Eglot might fail to start sometimes, due to a startup syncrhonization issue, and all you have to do is retry (i.e. rerun the eglot command).