Skip to content

Commit

Permalink
chore: simplify getPositronAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Jul 22, 2024
1 parent d195e75 commit d0f4096
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/extension-api-utils/extensionHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ export async function getPositronPreferredRuntime(languageId: string): Promise<L
return await pst.runtime.getPreferredRuntime(languageId);
}

function getPositronAPI(): void | any {
if (!(typeof globalThis === "object")) { return; }
if (!("acquirePositronApi" in globalThis)) { return; }
if (typeof globalThis.acquirePositronApi !== "function") { return; }

return globalThis.acquirePositronApi();
function getPositronAPI(): undefined | any {
return globalThis?.acquirePositronApi();
}

0 comments on commit d0f4096

Please sign in to comment.