Documentation / Editor

Editor

Connect your editor to the SPSQ language server for completion, diagnostics, and semantic highlighting where supported by the client.

On this page

Introduction ≥ 4.43.x

The -lsp parameter is available in SynapSeq v4.43.x or later. Follow the installation guide, then check your installed version and confirm that the help lists -lsp:

synapseq -version
synapseq -help

The language server uses the Language Server Protocol (LSP) over standard input and output (stdio). Configure your editor to launch this command:

synapseq -lsp

The editor starts and manages the process. You do not need to run it separately in a terminal, provide an input file, or configure a TCP port. Running it manually waits for protocol messages from a client.

Make sure synapseq is in the editor's PATH. If it is not, replace the executable name in the examples below with the absolute path to your binary. Keep -lsp as a separate argument.

Neovim

Use Neovim 0.11 or later. Its built-in LSP client can start SynapSeq without installing nvim-lspconfig, Mason, or a completion plugin.

Add the following to your init.lua (usually ~/.config/nvim/init.lua). It registers the SPSQ and SPSC file types, configures the server, and enables native completion:

vim.filetype.add({
  extension = { spsq = 'spsq', spsc = 'spsc' },
})

vim.lsp.config('synapseq', {
  cmd = { 'synapseq', '-lsp' },
  filetypes = { 'spsq', 'spsc' },
})

vim.api.nvim_create_autocmd('LspAttach', {
  callback = function(event)
    local client = vim.lsp.get_client_by_id(event.data.client_id)
    if client and client.name == 'synapseq' then
      vim.lsp.completion.enable(true, client.id, event.buf, {
        autotrigger = true,
      })
    end
  end,
})

vim.lsp.enable('synapseq')

Restart Neovim and open a .spsq or .spsc file. No project root marker is required, so standalone files can connect too. Run :set filetype? to confirm filetype=spsq for a .spsq file or filetype=spsc for a .spsc file, then :checkhealth vim.lsp to inspect the enabled configuration and attached client.

In Insert mode, use Ctrl+X, Ctrl+O to request completion. Automatic completion can also appear at server trigger characters such as @. Use :lua vim.diagnostic.open_float() to inspect a diagnostic at the cursor.

See the Neovim LSP documentation for native client and completion settings.

Helix

Helix includes an LSP client. Create or update .helix/languages.toml in your sequence project and add:

[language-server.synapseq]
command = "synapseq"
args = ["-lsp"]

[[language]]
name = "spsq"
scope = "source.spsq"
file-types = ["spsq", "spsc"]
roots = []
language-servers = ["synapseq"]

For all projects, put the same configuration in your Helix configuration directory's languages.toml instead (usually ~/.config/helix/languages.toml on Linux and macOS). Merge it with any existing entries. See the Helix language configuration reference for configuration locations and options.

From the project directory, check that Helix recognizes the language and can find the server:

hx --health spsq

Restart Helix and open a .spsq or .spsc file. Both extensions use the spsq language configuration, so hx --health spsq checks the server setup for both. Use Ctrl+X in Insert mode to request completion, and :log-open to inspect connection errors. This setup does not install a Tree-sitter grammar; missing syntax-highlighting support in the health report does not mean the language server failed.

Verify the connection

Open an existing .spsq sequence or .spsc configuration and request completion on a new line. Temporarily introduce a syntax error to check that diagnostics appear, then undo it and confirm they clear. Completion results depend on the cursor's context.

SynapSeq provides completion, diagnostics, and semantic tokens. Their presentation depends on the editor and client. These configurations do not add formatting, hover documentation, or go-to-definition support.

Troubleshooting

-lsp is not recognized
Check synapseq -version and upgrade to v4.43.x or later. If the editor uses an absolute path, verify the version of that binary too.
The executable cannot be found
The editor may have a different PATH from your terminal. Set an absolute executable path in the client configuration. On Windows, use the path to synapseq.exe; escape backslashes in JSON and Lua strings, or use forward slashes.
The server is configured but does not attach
Check the document's language or file type, save it with the .spsq or .spsc extension, and restart the editor after updating its configuration.
Completion or diagnostics do not appear
Request completion manually and check the client's logs: :lua vim.cmd.edit(vim.lsp.log.get_filename()) in Neovim, or :log-open in Helix. Confirm the command is synapseq with the separate argument -lsp, without a sequence filename.
View all documentation