Skip to content

Docs/Toolchain/Editor Setup

Editor Setup

fid lsp gives any editor diagnostics, completion, hover, go-to-definition and rename.

~1 min read

On this page

The built-in LSP server

fid lsp

A JSON-RPC language server over stdio, with no dependencies: diagnostics come straight from the compiler’s parser and type checker.

VS Code

The Fid Language extension in editors/vscode highlights .fd files and starts fid lsp for diagnostics, completion, hover, go-to-definition and rename. It is not on the Marketplace yet; package and install it from the repository:

cd editors/vscode
npm install
npx @vscode/vsce package
code --install-extension fid-lang-0.1.0.vsix

If fid is not on your PATH, set its location in .vscode/settings.json:

{
  "fid.server.path": "/path/to/fid"
}

Neovim

init.lua (Neovim 0.11 or later):

vim.filetype.add({ extension = { fd = 'fid' } })
vim.lsp.config('fid', { cmd = { 'fid', 'lsp' }, filetypes = { 'fid' } })
vim.lsp.enable('fid')

Supported methods

MethodBehavior
initialize / initializedCapability negotiation (text sync, diagnostics, completion, hover, definition, rename)
textDocument/didOpenPublishes diagnostics on open
textDocument/didChangeFull-document sync; diagnostics re-published on every change
textDocument/didCloseClears document state
textDocument/completionKeyword and symbol completion
textDocument/hoverType and signature information on hover
textDocument/definitionGo-to-definition across your source
textDocument/renameRename symbols project-wide
shutdown / exitClean termination

Report an issue