Navigating code

Hover, go to definition, find references, the file outline and the error markers a language server provides.

Everything on this page needs a language server for the file’s language. Sirio enables an action only when a server covering that language is running and has said it offers that capability. When the server is missing, “Go to Definition” and “Find References” in the right-click menu name it, and when Sirio can fetch it, clicking either entry installs it.

These actions work on the files in your worktree. On a read-only snapshot of a file from a pull or merge request, Open local copy, on the snapshot’s bar, opens your worktree’s own file, where a language server answers.

What a symbol is

Rest the pointer on a symbol and a card appears with its type and its documentation. Sirio asks the server once the pointer has rested on one character for 300 milliseconds, so the card answers the spot where you stop.

Where it is defined

Cmd-click jumps to the definition on macOS. On Linux the same click takes the Super key, and on Windows the Windows key. “Go to Definition” in the right-click menu does the same on every platform for the symbol at the text cursor, so click into the symbol before you right-click. The jump opens the file if it is not already a tab and scrolls to the line even while that tab is still loading; Sirio brings forward the tab of a file already open. When there is no definition to jump to, the editor says so next to where you asked.

Where else it is used

“Find References” opens the References view in the right panel, listing every use grouped by file, each row showing its line number and, for the first 100 files, that line of source. Clicking a row opens that file at that line. The view opens the moment you ask, before the answer arrives, and it always says where things stand: “Searching…” while the server works, then the results under a count, “No references found”, or the reason the search failed, such as a server still indexing the project.

What is in this file

“Go to Symbol in File” in the command palette lists the file’s functions, types and fields, nested as they are in the source. Type to filter, Enter to jump, Escape to dismiss.

Errors and warnings

Sirio draws a wavy underline beneath the exact code each of the language server’s findings covers, and the gutter keeps the line numbers and the git marks. Errors are red, warnings amber, hints faint. Resting the pointer on underlined code shows its messages in the same card as the hover text, and Sirio builds that half of the card locally, so errors appear immediately and still appear on a server that offers no hover at all.

The Problems tab of the drawer under the code lists the findings across the whole worktree; see Problems and Search.