diff --git a/src/commands.ts b/src/commands.ts index 2f0d998bb..c969d8095 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -661,7 +661,20 @@ function restartLSPServer(workspaceContext: WorkspaceContext): Promise { function reindexProject(workspaceContext: WorkspaceContext): Promise { return workspaceContext.languageClientManager.useLanguageClient(async (client, token) => { try { - return await client.sendRequest(reindexProjectRequest, {}, token); + await client.sendRequest(reindexProjectRequest, {}, token); + const result = await vscode.window.showWarningMessage( + "Re-indexing a project should never be necessary and indicates a bug in SourceKit-LSP. Please file an issue describing which symbol was out-of-date and how you got into the state.", + "Report Issue", + "Close" + ); + if (result === "Report Issue") { + vscode.commands.executeCommand( + "vscode.open", + vscode.Uri.parse( + "https://github.com/swiftlang/sourcekit-lsp/issues/new?template=BUG_REPORT.yml&title=Symbol%20Indexing%20Issue" + ) + ); + } } catch (err) { const error = err as { code: number; message: string }; // methodNotFound, version of sourcekit-lsp is likely too old.