Skip to content
Empryo

Code intelligence

How the agent finds definitions, references and type errors with your language servers, falls back to parsing when none is available, and checks every edit.

How it works2 minutes to read
Copy & share
On this page4 sections

Empryo gives the agent the same code intelligence your editor has: go to definition, find references, rename, type information and error checking. The agent looks things up by symbol instead of grepping through whole files, which is cheaper and more accurate.

There is nothing to configure. Empryo installs the language servers your project needs in the background and picks the best available method for each request.

What the agent can askLink to this section

QuestionExample
Where is it defined?"where is parseConfig defined?"
Who uses it?"who calls parseConfig?"
Rename it everywhere"rename useChat to useConversation everywhere"
What type is it?"what's the return type of fetchUser?"
Any errors?"any errors in this file?"
What does it call?"what does buildTools call?"

The agent answers these with the navigate and analyze tools.

How it finds answersLink to this section

Empryo tries the most precise method first and falls back when it isn't available:

  1. Language server (LSP). Exact types, workspace-wide rename and diagnostics.
  2. Parsing the code. Outlines, imports and symbol lookups across many languages, plus deeper structure for TypeScript and JavaScript.
  3. Text search. A last resort that works on any file.

If no language server is running for your language, the agent still works. The fallbacks cover most questions.

Language servers without the editorLink to this section

The agent can use language servers even when the editor is closed. In the terminal UI, when you open the embedded Neovim editor (Ctrl+E), requests go through the servers Neovim already runs. When it's closed, Empryo starts the servers itself.

See which servers are attached:

/lsp status

Servers for your languages install on their own. To add another one from the Mason registry:

/lsp install

See LSP for more.

Checks after every editLink to this section

Empryo records the errors in a file before an edit and compares them afterwards. The agent is told:

  • which errors it just introduced,
  • which errors it just fixed,
  • which errors appeared in other files because of the edit.

This lets the agent fix its own mistakes right away, without running a full typecheck after every change.

When no language server answers for a file, Empryo still parses the edited file and compares it with the version before the edit. An edit that leaves Python, Swift, Kotlin, Rust, Go, C, C++, Zig, shell scripts or any of the 30 parsed languages unparsable comes back with the line and the broken text, so the agent fixes it in the next step instead of finding out at build time. Errors that were already in the file before the edit are not reported again.

A symbol's span covers its decorators and attributes (@classmethod, @MainActor, @Composable, #[derive]), so replacing a function or class by name replaces them too and never leaves one behind to attach to the next declaration.