Skip to content

Commit

Permalink
feat: sticky notifications for extension startup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuisi committed Nov 15, 2024
1 parent be04ab3 commit ce7bb48
Show file tree
Hide file tree
Showing 20 changed files with 1,407 additions and 712 deletions.
7 changes: 4 additions & 3 deletions vscode-lean4/src/diagnostics/fullDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SemVer } from 'semver'
import { Disposable, OutputChannel, TextDocument, commands, env, window, workspace } from 'vscode'
import { ExecutionExitCode, ExecutionResult } from '../utils/batch'
import { ExtUri, FileUri, extUriEquals, toExtUri } from '../utils/exturi'
import { displayError, displayInformationWithInput } from '../utils/notifs'
import { displayNotification, displayNotificationWithInput } from '../utils/notifs'
import { findLeanProjectRoot } from '../utils/projectInfo'
import {
ElanVersionDiagnosis,
Expand Down Expand Up @@ -187,15 +187,16 @@ export class FullDiagnosticsProvider implements Disposable {
? await findLeanProjectRoot(this.lastActiveLeanDocumentUri)
: undefined
if (projectUri === 'FileNotFound') {
displayError(
displayNotification(
'Error',
`Cannot display setup information for file that does not exist in the file system: ${this.lastActiveLeanDocumentUri}. Please choose a different file to display the setup information for.`,
)
return
}
const fullDiagnostics = await performFullDiagnosis(this.outputChannel, projectUri)
const formattedFullDiagnostics = formatFullDiagnostics(fullDiagnostics)
const copyToClipboardInput = 'Copy to Clipboard'
const choice = await displayInformationWithInput(formattedFullDiagnostics, copyToClipboardInput)
const choice = await displayNotificationWithInput('Information', formattedFullDiagnostics, copyToClipboardInput)
if (choice === copyToClipboardInput) {
await env.clipboard.writeText(formattedFullDiagnostics)
}
Expand Down
Loading

0 comments on commit ce7bb48

Please sign in to comment.