* Guidance shown when there is no index to read. Deliberately the same three * facts the CLI prints: the viewer never creates an index, `codegraph init` * does, and you can point the viewer somewhere already indexed.
(projectRoot: string)
| 99 | * does, and you can point the viewer somewhere already indexed. |
| 100 | */ |
| 101 | function noIndexError(projectRoot: string): ApiError { |
| 102 | return new ApiError( |
| 103 | 'no-index', |
| 104 | `No CodeGraph index found for ${projectRoot}.`, |
| 105 | 'The viewer reads an index that already exists — it never creates one. ' + |
| 106 | 'Run "codegraph init" in that project, or start the viewer against a project ' + |
| 107 | 'that has one: codegraph ui /path/to/indexed/project' |
| 108 | ); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Holds the project's `CodeGraph` open for the life of the server. |