Skip to content

LSP Servers

codeflow integrates with your LSP servers.

codeflow integrates with your Language Server Protocol (LSP) to help the LLM interacts with your codebase. It uses diagnostics to provide feedback to the LLM. And go-to-definition and find-references to help navigate your codebase.


Built-in

codeflow comes with several built-in LSP servers for popular languages:

LSP ServerExtensionsRequirements
typescript.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .ctstypescript dependency in project
eslint.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts, .vueeslint dependency in project
gopls.gogo command available
ruby-lsp.rb, .rake, .gemspec, .ruruby and gem commands available
pyright.py, .pyipyright dependency installed
elixir-ls.ex, .exselixir command available
zls.zig, .zonzig command available
csharp.cs.NET SDK installed
vue.vueAuto-installs for Vue projects
rust.rsrust-analyzer command available
clangd.c, .cpp, .cc, .cxx, .c++, .h, .hpp, .hh, .hxx, .h++Auto-installs for C/C++ projects

LSP servers are automatically enabled when one of the above file extensions are detected and the requirements are met.


How It Works

When codeflow opens a file, it:

  1. Checks the file extension against all enabled LSP servers.
  2. Starts the appropriate LSP server if not already running.

Configure

You can customize LSP servers through the lsp section in your codeflow config.

codeflow.json
{
"$schema": "https://codeflow.ai/config.json",
"lsp": {}
}

Each LSP server supports the following:

PropertyTypeDescription
disabledbooleanSet this to true to disable the LSP server
commandstring[]The command to start the LSP server
extensionsstring[]File extensions this LSP server should handle
envobjectEnvironment variables to set when starting server
initializationobjectInitialization options to send to the LSP server

Let’s look at some examples.


Disabling LSP servers

To disable a specific LSP server, set disabled to true:

codeflow.json
{
"$schema": "https://codeflow.ai/config.json",
"lsp": {
"typescript": {
"disabled": true
}
}
}

Custom LSP servers

You can add custom LSP servers by specifying the command and file extensions:

codeflow.json
{
"$schema": "https://codeflow.ai/config.json",
"lsp": {
"custom-lsp": {
"command": ["custom-lsp-server", "--stdio"],
"extensions": [".custom"]
}
}
}