Skip to content

Commit

Permalink
Try to use more descriptive function names
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Aug 26, 2024
1 parent b063ca9 commit 2484a35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/effektManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export class EffektManager {
}

/**
* Locates the Effekt executable.
* Locates the Effekt executable: tries to look into user given path first, then tries 'possibleEffektExecutables' in PATH.
*/
public async getEffektExecutable(): Promise<EffektExecutableInfo> {
public async locateEffektExecutable(): Promise<EffektExecutableInfo> {
const customPath = this.config.get<string>("executable");
if (customPath) {
try {
Expand Down Expand Up @@ -161,7 +161,7 @@ export class EffektManager {

private async verifyEffektInstallation(): Promise<InstallationResult> {
try {
const { path: execPath, version } = await this.getEffektExecutable();
const { path: execPath, version } = await this.locateEffektExecutable();
return {
success: true,
executable: execPath,
Expand Down Expand Up @@ -238,9 +238,9 @@ export class EffektManager {
* Checks for Effekt updates and offers to install/update if necessary.
* @returns A promise that resolves with the current Effekt version.
*/
public async checkAndInstallEffekt(): Promise<string> {
public async checkForUpdatesAndInstall(): Promise<string> {
try {
const effektPath = await this.getEffektExecutable();
const effektPath = await this.locateEffektExecutable();
if (!this.effektVersion) {
const currentVersion = await this.execCommand(`"${effektPath.path}" --version`);
this.effektVersion = currentVersion
Expand Down
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let effektManager: EffektManager;
function registerCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('effekt.checkForUpdates', async () => {
await effektManager?.checkAndInstallEffekt();
await effektManager?.checkForUpdatesAndInstall();
}),
vscode.commands.registerCommand('effekt.restartServer', async () => {
await client?.stop();
Expand All @@ -25,7 +25,7 @@ function registerCommands(context: vscode.ExtensionContext) {
export async function activate(context: vscode.ExtensionContext) {
effektManager = new EffektManager();

const effektVersion = await effektManager.checkAndInstallEffekt();
const effektVersion = await effektManager.checkForUpdatesAndInstall();
if (!effektVersion) {
vscode.window.showWarningMessage('Effekt is not installed. LSP features may not work correctly.');
}
Expand All @@ -47,7 +47,7 @@ export async function activate(context: vscode.ExtensionContext) {
return Promise.resolve(result);
};
} else {
const effektExecutable = await effektManager.getEffektExecutable();
const effektExecutable = await effektManager.locateEffektExecutable();
const args = effektManager.getEffektArgs();
serverOptions = {
run: { command: effektExecutable.path, args },
Expand Down

0 comments on commit 2484a35

Please sign in to comment.