VS Code
Use the official extension for the best experience.
Codive includes a Language Server Protocol (LSP) implementation that integrates with any LSP-compatible editor. This brings AI-powered coding assistance directly into your editing experience.
The Codive LSP server provides:
Start Codive in LSP mode:
codive lspThe server communicates over stdio by default, which is the standard for LSP.
# Use TCP instead of stdiocodive lsp --tcp --port 9257
# Enable verbose loggingcodive lsp --log-level debug
# Use specific configurationcodive lsp --config ~/.config/codive/lsp.tomlCodive provides AI-powered code actions through the standard LSP code action interface:
In most editors, you can trigger code actions with Ctrl+. or Cmd+..
Codive provides context-aware completions as you type:
fn calculate_total(items: &[Item]) -> f64 { // Type here and Codive suggests the implementation items.iter() // <- Codive completes based on context}Codive adds actionable hints above functions and classes:
// 📝 Add tests | 📚 Explain | ✨ Optimizepub fn complex_algorithm(data: &[u8]) -> Result<Output, Error> { // ...}Click these lenses to trigger the corresponding AI action.
Codive can analyze your code and provide AI-powered diagnostics:
fn process(data: Option<String>) -> String { data.unwrap() // ⚠️ Codive: Potential panic - consider using unwrap_or_default()}Configure LSP behavior in codive.toml:
[lsp]# Enable/disable featurescode_actions = trueinline_completion = truecode_lens = truediagnostics = true
# Completion settings[lsp.completion]# Trigger completion automaticallyauto_trigger = true# Delay before triggering (ms)trigger_delay = 500# Maximum suggestionsmax_suggestions = 5
# Code lens settings[lsp.code_lens]# Actions to showenabled_actions = ["explain", "test", "refactor"]
# Diagnostics settings[lsp.diagnostics]# Run on save only (vs. on change)on_save_only = false# Severity levelmin_severity = "warning"Codive extends the standard LSP with additional capabilities:
// Execute a Codive commandinterface CodiveExecuteRequest { command: string; // e.g., "explain", "refactor", "test" arguments: { uri: string; range?: Range; context?: string; };}
// Responseinterface CodiveExecuteResponse { success: boolean; result?: string; edits?: TextEdit[]; error?: string;}// Codive progress updatesinterface CodiveProgressNotification { id: string; stage: "analyzing" | "generating" | "applying"; message: string; percentage?: number;}VS Code
Use the official extension for the best experience.
Neovim
Configure with nvim-lspconfig.
Other Editors
Any LSP-compatible editor can use Codive.
For editors not explicitly documented, configure your LSP client to:
codive lsp as the language serverExample configuration (generic):
{ "languageserver": { "codive": { "command": "codive", "args": ["lsp"], "filetypes": ["rust", "typescript", "python", "go"], "rootPatterns": [".git", "Cargo.toml", "package.json"] } }}Check that Codive is installed and accessible:
which codivecodive --versionVerify LSP is initialized:
# Check server logscodive lsp --log-level debug 2>&1 | head -50If responses are slow:
ignore_patterns[lsp]# Use a faster model for LSPmodel = "claude-3-haiku-20240307"
[context]# Reduce files included in contextmax_files = 20For TCP mode, ensure the port is available:
# Check if port is in uselsof -i :9257
# Use a different portcodive lsp --tcp --port 9258