Make Spyglass a singleton object

This commit is contained in:
Misode
2024-10-20 20:23:17 +02:00
parent d248732469
commit 9cb7f7297c
5 changed files with 40 additions and 52 deletions

View File

@@ -22,7 +22,7 @@ export function ErrorPanel({ error, prefix, reportable, onDismiss, body: body_,
const [stack, setStack] = useState<string | undefined>(undefined)
const gen = getGenerator(getCurrentUrl())
const source = gen ? spyglass?.getFile(spyglass.getUnsavedFileUri(gen)).doc?.getText() : undefined
const source = gen ? spyglass?.getFileContents(spyglass.getUnsavedFileUri(version, gen)) : undefined
const name = (prefix ?? '') + (error instanceof Error ? error.message : error)
useEffect(() => {