Skip to content

Commit

Permalink
hover from engines is nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Druue committed Jul 3, 2024
1 parent e181364 commit 7bf7f7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/language-server/src/lib/prisma-schema-wasm/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function hover(
initiatingDocument: TextDocument,
params: HoverParams,
onError?: (errorMessage: string) => void,
): Hover | undefined {
): Hover | null {
try {
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
handleFormatPanic(() => {
Expand All @@ -20,12 +20,12 @@ export default function hover(

const result = prismaSchemaWasm.hover(JSON.stringify(schema), JSON.stringify(params))

return JSON.parse(result) as Hover
return JSON.parse(result) as Hover | null
} catch (e) {
const err = e as Error

handleWasmError(err, 'hover', onError)

return undefined
return null
}
}

0 comments on commit 7bf7f7a

Please sign in to comment.