LSP for Typst (tinymist) configuration woes

I am struggling to get the LSP for Typst (tinymist) working to format my code. It works fine to get me errors in my code, but no formatting on save! The relevant bits of configuration are below, although I am :100: certain I might have missed something…

require("conform").setup({
	-- Map of filetype to formatters
	formatters_by_ft = {
                …
		typst = { "tinymist" },
       }
}

require("mason-lspconfig").setup({
	ensure_installed =
		…
		"tinymist",
		…
	},
})

vim.lsp.config["tinymist"] = {
	cmd = { "tinymist" },
	filetypes = { "typst" },
	settings = {
		formatterMode = "typstyle",
	},
}

Yet, when I save a typst file, I get [LSP] Format request failed, no matching language server.

What am I doing wrong? And more importantly, how can I debug these things in the future?

In desperation, I tried to move to the new lsp-config… Oh boy.

This is what I have now:

vim.lsp.enable("tinymist")

and in .config/nvim/lsp/tinymist.lua, the following:

return {
    cmd = { "tinymist" },
    filetypes = { "typst" },
    settings = {
      formatterMode = "typstyle",
    },
}

The LSP works just fine (I can see errors and warnings), but the auto-formatting still does not!

LspInfo gives me this:

vim.lsp:                                                                  2 ⚠️

- LSP log level : WARN
- Log path: /home/yg/.local/state/nvim/lsp.log
- Log size: 190 KB

vim.lsp: Active Clients ~
- tinymist (id: 1)
  - Version: ? (no serverInfo.version response)
  - Root directory: ~/Documents/typst/test
  - Command: { "tinymist" }
  - Settings: {
      formatterMode = "typstyle"
    }
  - Attached buffers: 1

Note that the two warnings are about two LSP servers not being configured properly… It should be irrelevant for this discussion.

On all :w, I get a notifcation: [LSP] Format request failed, no matching language server.

:enraged_face: