Building the index¶
index_codebase ¶
Builds or refreshes the index of a C# codebase with Roslyn. A root may be one solution or a folder holding many, in which case all of them are indexed together and searched as one codebase. Every other tool answers from this index, so nothing works until it has run. A pass costs minutes on a large codebase and runs as a job: the answer is {ok:true,data:<its report>} once it ends within wait, or the job still running (data.running true), read at the resource the answer names; a client subscribed to it is told when it ends. A pass that stopped answers ok false, type indexFailed, with why as the error. Projects whose files have not changed are skipped. Refuses to write when package restore has not run, because unbound symbols would be stored as empty facts. It also reads the written rules of the root out of its guidelines file, so get_guidelines can answer by topic. Every answer names any root the index still holds that nobody configured any more, and forget drops one.
may overwrite or delete · every call adds · stays on this machine.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string? |
— | null |
A .sln, .slnx or .csproj, or a folder to search: every solution found anywhere beneath it is indexed together under one root, and project files are used only where a folder holds no solution at all. Empty — the first configured root. |
force |
boolean |
— | false |
Reindex projects whose files have not changed, and index even when package restore has not run. |
forget |
string? |
— | null |
A root to forget instead of indexing: its key as the answers print it, or the path it was indexed from. Everything stored for it — declarations, registrations, rules and stamps — is dropped. Use it for a root that is no longer configured, which an answer names when it finds one. Nothing else is indexed by that call. |
wait |
integer |
— | 60 |
Seconds to wait for the pass to end before answering with it still running; 60 by default, 0 answers at once with the job to read or wait on. |
JSON Schema
{
"type": "object",
"properties": {
"path": {
"description": "A .sln, .slnx or .csproj, or a folder to search: every solution found anywhere beneath it is indexed together under one root, and project files are used only where a folder holds no solution at all. Empty \u2014 the first configured root.",
"type": [
"string",
"null"
],
"default": null
},
"force": {
"description": "Reindex projects whose files have not changed, and index even when package restore has not run.",
"type": "boolean",
"default": false
},
"forget": {
"description": "A root to forget instead of indexing: its key as the answers print it, or the path it was indexed from. Everything stored for it \u2014 declarations, registrations, rules and stamps \u2014 is dropped. Use it for a root that is no longer configured, which an answer names when it finds one. Nothing else is indexed by that call.",
"type": [
"string",
"null"
],
"default": null
},
"wait": {
"description": "Seconds to wait for the pass to end before answering with it still running; 60 by default, 0 answers at once with the job to read or wait on.",
"type": "integer",
"default": 60
}
}
}