Skip to content

Commit

Permalink
Disable secret previews on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyheavener committed May 23, 2024
1 parent eac518a commit 344a62e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/editor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os from "os";
import { Disposable, languages } from "vscode";
import { config } from "./configuration";
import type { Core } from "./core";
Expand All @@ -15,6 +16,8 @@ export class Editor {
}

private configure(): void {
const isWindows = os.platform() === "win32";

for (const subscription of this.subscriptions) {
subscription.dispose();
}
Expand All @@ -32,13 +35,16 @@ export class Editor {
provideDocumentLinks,
},
),
languages.registerHoverProvider(
{ scheme: "file" },
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
provideHover: provideHover.bind(this.core),
},
),
// Windows doesn't persist auth between commands, so authenticating
// first has no effect, preventing hover previews from working
!isWindows &&
languages.registerHoverProvider(
{ scheme: "file" },
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
provideHover: provideHover.bind(this.core),
},
),
];

this.core.context.subscriptions.push(...this.subscriptions);
Expand Down

0 comments on commit 344a62e

Please sign in to comment.