Neovim plugin for Ananke typed holes and constraint-based code generation.
Work with typed holes directly in Neovim. Detect incomplete code, get AI-powered fill suggestions, extract and validate constraints, and generate code with constraint guarantees.
- Hole Detection - Automatic detection of TODO, FIXME, pass, unimplemented!, etc.
- Fill Suggestions - AI-powered completions with confidence scores
- Decomposition - Break complex holes into smaller pieces
- Navigation - Jump between holes with ]h and [h
- Visual Indicators - Diagnostics, virtual text, and code lenses
- Extraction - Extract constraints from source code
- Validation - Validate code against extracted constraints
- Compilation - Compile constraints to IR for generation
- Context Manager - Add files and selections to generation context
- Generation Panel - Full-featured UI for constraint-guided generation
- Inline Generation - Quick code generation with prompt
- Syntax Support - Full support for .ariadne constraint definition files
- LSP Integration - Diagnostics, completion, and hover for Ariadne
{
"rand/ananke-nvim",
dependencies = { "neovim/nvim-lspconfig" },
config = function()
require("ananke").setup()
end,
}
use {
"rand/ananke-nvim",
requires = { "neovim/nvim-lspconfig" },
config = function()
require("ananke").setup()
end,
}
require("ananke").setup({
-- LSP configuration
lsp_cmd = { "ananke-lsp" },
cli_path = "ananke",
-- Feature toggles
diagnostics = true,
code_lens = true,
virtual_text = true,
detect_on_save = true,
extract_on_save = false,
-- Fill settings
min_confidence = 0.5,
max_suggestions = 5,
-- Supported languages
filetypes = { "python", "typescript", "rust", "zig", "javascript", "go", "ariadne" },
-- Hole keymaps
keymaps = {
fill_hole = "<leader>hf",
fill_all = "<leader>ha",
decompose = "<leader>hd",
inspect = "<leader>hi",
mark_review = "<leader>hr",
skip = "<leader>hs",
next_hole = "]h",
prev_hole = "[h",
-- Constraint/generation keymaps
extract = "<leader>ce",
validate = "<leader>cv",
compile = "<leader>cc",
generate = "<leader>cg",
add_context = "<leader>ca",
show_context = "<leader>cs",
clear_context = "<leader>cx",
},
-- Extraction settings
extraction = {
auto = false,
confidence_threshold = 0.5,
use_claude = false,
},
-- Generation settings
generation = {
endpoint = "", -- Required for generation
max_tokens = 2048,
temperature = 0.7,
},
-- Context settings
context = {
max_tokens = 8000,
},
})
| Command |
Description |
| :AnankeDetectHoles |
Detect typed holes in current buffer |
| :AnankeFillHole |
Fill hole at cursor |
| :AnankeFillAll |
Fill all auto-resolvable holes |
| :AnankeDecompose |
Decompose hole at cursor |
| :AnankeInspect |
Inspect hole at cursor |
| :AnankeSkip |
Skip hole at cursor |
| :AnankeMarkReview |
Mark hole for human review |
| Command |
Description |
| :AnankeExtract |
Extract constraints from current file |
| :AnankeExtractSelection |
Extract constraints from visual selection |
| :AnankeSaveConstraints [path] |
Save extracted constraints to file |
| :AnankeValidate |
Validate current file against constraints |
| :AnankeValidateSummary |
Show validation summary |
| :AnankeCompile |
Compile workspace constraints to IR |
| :AnankeCompileResult |
Show last compilation result |
| Command |
Description |
| :AnankeGenerate |
Open generation panel |
| :AnankeGenerateInline |
Quick inline generation with prompt |
| :AnankeApplyCode |
Apply last generated code |
| :AnankeAddToContext |
Add current file to generation context |
| :AnankeAddSelectionToContext |
Add visual selection to context |
| :AnankeShowContext |
Show generation context |
| :AnankeClearContext |
Clear generation context |
| :AnankeSaveContext |
Save context to file |
| :AnankeLoadContext |
Load context from file |
| Command |
Description |
| :AnankeVersion |
Show ananke CLI version |
| :AnankeInit |
Initialize ananke configuration in workspace |
| Key |
Action |
| <leader>hf |
Fill hole at cursor |
| <leader>ha |
Fill all auto-resolvable holes |
| <leader>hd |
Decompose hole |
| <leader>hi |
Inspect hole |
| <leader>hr |
Mark for review |
| <leader>hs |
Skip hole |
| ]h |
Next hole |
| [h |
Previous hole |
| Key |
Action |
| <leader>ce |
Extract constraints |
| <leader>cv |
Validate against constraints |
| <leader>cc |
Compile constraints |
| <leader>cg |
Open generation panel |
| <leader>ca |
Add file/selection to context |
| <leader>cs |
Show context |
| <leader>cx |
Clear context |
The generation panel (<leader>cg or :AnankeGenerate) provides a full UI for code generation:
| Key |
Action |
| g |
Generate code with prompt |
| af |
Add file to context |
| as |
Add selection to context |
| cc |
Clear context |
| sc |
Show context details |
| a |
Apply last generated code |
| y |
Copy last generated code |
| r |
Refresh panel |
| q |
Close panel |
Add Ananke status to your status line:
require('lualine').setup({
sections = {
lualine_x = {
require('ananke.status').lualine_component(),
}
}
})
local status = require('ananke.status').get_status_string()
- Open a file containing typed holes
- Holes appear as diagnostics with virtual text
- Navigate to a hole with ]h
- Press <leader>hf to see fill suggestions
- Select a suggestion to apply it
Constraint-Guided Generation
- Extract constraints: <leader>ce
- Add context files: <leader>ca
- Open generation panel: <leader>cg
- Enter prompt and generate
- Apply or copy generated code
All Rights Reserved - Copyright (c) 2025 Rand Arete