Skip to content

Commit

Permalink
lint and prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel OBrien committed Feb 2, 2024
1 parent 0621f92 commit d389b60
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/commands/evaluateFlag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { commands, Disposable, QuickPickItemKind, window } from 'vscode';
import { Disposable, QuickPickItemKind, window } from 'vscode';
import { ToggleCache } from '../toggleCache';
import os from 'os';
import { LDExtensionConfiguration } from '../ldExtensionConfiguration';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/selectRule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { commands, Disposable, ProgressLocation, QuickPickItem, QuickPickItemKind, window } from 'vscode';
import { Disposable, ProgressLocation, QuickPickItem, QuickPickItemKind, window } from 'vscode';
import { YAMLIndividualTarget, YamlReader, YAMLRuleTarget } from '../utils/rulesYaml';
import { ToggleCache } from '../toggleCache';
import os from 'os';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/setMaintainer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { commands, Disposable, window } from 'vscode';
import { Disposable, window } from 'vscode';
import { LDExtensionConfiguration } from '../ldExtensionConfiguration';
import { registerCommand } from '../utils';

Expand Down
48 changes: 24 additions & 24 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,28 @@ export async function setupComponents(config: LDExtensionConfiguration, reload =

codeLens.start();

const flagToggle = registerCommand('launchdarkly.toggleFlagCmdPrompt', async () => {
await showToggleMenu(config);
});
const openFlag = registerCommand('launchdarkly.OpenFlag', (node: FlagItem) =>
window.activeTextEditor.revealRange(node.range),
);

const disposables = await generalCommands(config);

const allDisposables = Disposable.from(
disposables,
hoverProviderDisp,
listViewDisp,
flagToggle,
openFlag,
codeLensProv,
);
await config.getCtx().globalState.update('commands', allDisposables);
config.getCtx().subscriptions.push(flagToggle, openFlag);
} catch(err) {
logDebugMessage(err);
}
const flagToggle = registerCommand('launchdarkly.toggleFlagCmdPrompt', async () => {
await showToggleMenu(config);
});
const openFlag = registerCommand('launchdarkly.OpenFlag', (node: FlagItem) =>
window.activeTextEditor.revealRange(node.range),
);

const disposables = await generalCommands(config);

const allDisposables = Disposable.from(
disposables,
hoverProviderDisp,
listViewDisp,
flagToggle,
openFlag,
codeLensProv,
);
await config.getCtx().globalState.update('commands', allDisposables);
config.getCtx().subscriptions.push(flagToggle, openFlag);
} catch (err) {
logDebugMessage(err);
}
}

async function showToggleMenu(config: LDExtensionConfiguration) {
Expand Down Expand Up @@ -309,12 +309,12 @@ export function legacyAuth() {
//workspace.getConfiguration('launchdarkly').get('legacyAuth', false)
}


// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function registerCommand(command: string, callback: (...args: any[]) => any) {
try {
return commands.registerCommand(command, callback);
} catch (err) {
logDebugMessage(err);
return Disposable.from();
}
}
}

0 comments on commit d389b60

Please sign in to comment.