Editors
sloptor lsp is a language server over stdio. It runs the same census as the
diagnostics command over your unsaved buffers
and publishes the result as editor diagnostics with the source sloptor.
It reports what your TypeScript server can't: transformer diagnostics such as
noAny, unsupported Luau constructs, macro failures, comment-directive
refusals and internal compiler errors. The editor's own TypeScript server
reports TypeScript errors (TS####), so nothing shows up twice. Run it next to
that server, not instead of it.
The server checks edits shortly after you stop typing, and immediately on open
and save. Each check is a full compile of the project. It finds the project by
walking up from the file to the nearest tsconfig.json. A project without
node_modules/@rbxts there or in a parent directory isn't a roblox-ts
project. The server ignores its files.
To also show TypeScript errors, for an editor without a TypeScript server,
pass initializationOptions: { typeErrors: true }. The following snippets show
the option in its default, off state.
Neovim
Section titled “Neovim”Neovim 0.11 or later:
vim.lsp.config("sloptor", { cmd = { "sloptor", "lsp", "--stdio" }, filetypes = { "typescript", "typescriptreact" }, root_markers = { "tsconfig.json" }, init_options = { typeErrors = false },})vim.lsp.enable("sloptor")In languages.toml:
[language-server.sloptor]command = "sloptor"args = ["lsp", "--stdio"]config = { typeErrors = false }
[[language]]name = "typescript"language-servers = ["typescript-language-server", "sloptor"]
[[language]]name = "tsx"language-servers = ["typescript-language-server", "sloptor"]Zed only launches language servers that an extension registers. The sloptor
repository has one in editors/zed. Open the command palette, run
zed: install dev extension and select that directory. It needs a Rust
toolchain installed through rustup, since Zed builds the extension itself.
The extension finds sloptor on your PATH. To point it elsewhere, or to turn
on TypeScript errors, add this to settings.json:
{ "lsp": { "sloptor": { "binary": { "path": "/path/to/sloptor" }, "initialization_options": { "typeErrors": true } } }}Other editors
Section titled “Other editors”VS Code only launches language servers that an extension registers, and sloptor has no extension yet.