mpy/alerts: implement compiler error

This shows the output from mpy-cross and has a button to go to the
error.
This commit is contained in:
David Lechner
2022-10-19 18:26:37 -05:00
committed by David Lechner
parent e5ab52b250
commit 7e726fffaf
10 changed files with 159 additions and 0 deletions
+15
View File
@@ -25,3 +25,18 @@ export function useFileStoragePath(uuid: UUID): string | undefined {
const db = useContext(FileStorageContext);
return useLiveQuery(() => db.metadata.get(uuid, (x) => x?.path));
}
/**
* Gets the file path for a file UUID.
*
* If the file is renamed, the returned value will be automatically updated.
*/
export function useFileStorageUuid(path: string): UUID | undefined {
const db = useContext(FileStorageContext);
return useLiveQuery(() =>
db.metadata
.where('path')
.equals(path)
.first((x) => x?.uuid),
);
}