Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip future server install confirmations #252

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions client/src/configuration/galaxyToolWorkspaceConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ export class GalaxyToolsWorkspaceConfiguration implements IWorkspaceConfiguratio
}

class GalaxyLanguageServerConfiguration implements IServerConfiguration {
constructor(private readonly config: WorkspaceConfiguration) {}
constructor(private readonly config: WorkspaceConfiguration) { }
silentInstall(): boolean {
return this.config.get("server.silentInstall", false);
}
setSilentInstall(value: boolean, global: boolean = true): void {
this.config.update("server.silentInstall", value, global);
}
}

class GalaxyToolsPlanemoConfiguration implements IPlanemoConfiguration {
Expand Down Expand Up @@ -68,14 +71,14 @@ class GalaxyToolsPlanemoConfiguration implements IPlanemoConfiguration {
if (!validPlanemo) {
result.addErrorMessage(
"Please set a valid [Env Path](command:galaxytools.planemo.openSettings)" +
" value for planemo in the [Settings](command:galaxytools.planemo.openSettings)."
" value for planemo in the [Settings](command:galaxytools.planemo.openSettings)."
);
}

if (!validGalaxyRoot) {
result.addErrorMessage(
"Please set a valid [Galaxy Root](command:galaxyTools.planemo.openSettings)" +
" for planemo in the [Settings](command:galaxytools.planemo.openSettings)."
" for planemo in the [Settings](command:galaxytools.planemo.openSettings)."
);
}

Expand All @@ -102,7 +105,7 @@ class GalaxyToolsPlanemoConfiguration implements IPlanemoConfiguration {
}

class GalaxyToolsPlanemoTestingConfiguration implements IPlanemoTestingConfiguration {
constructor(private readonly config: WorkspaceConfiguration) {}
constructor(private readonly config: WorkspaceConfiguration) { }

enabled(): boolean {
return this.config.get("planemo.testing.enabled", true);
Expand Down
1 change: 1 addition & 0 deletions client/src/configuration/workspaceConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export namespace Settings {

export interface IServerConfiguration {
silentInstall(): boolean;
setSilentInstall(value: boolean): void;
}

export interface IWorkspaceConfiguration {
Expand Down
7 changes: 6 additions & 1 deletion client/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { commands, ExtensionContext, ProgressLocation, Uri, window, workspace }
import { LocalStorageService } from "./configuration/storage";
import { Constants } from "./constants";
import { execAsync, forceDeleteDirectory as removeDirectory } from "./utils";
import { DefaultConfigurationFactory } from "./planemo/configuration";

/**
* Ensures that the Language server is installed in the extension's virtual environment
Expand Down Expand Up @@ -39,7 +40,7 @@ export async function installLanguageServer(
if (storedPython === null && !isSilentInstall) {
const result = await window.showInformationMessage(
`Galaxy Tools needs to install the Galaxy Language Server Python package to continue. This will be installed in a virtual environment inside the extension and will require Python ${Constants.REQUIRED_PYTHON_VERSION}`,
...["Install", "More Info"]
...["Install", "More Info", "Don't ask again"]
);

if (result === undefined) {
Expand All @@ -52,6 +53,10 @@ export async function installLanguageServer(
"https://github.com/galaxyproject/galaxy-language-server/blob/main/client/README.md#installation"
)
);
} else if (result === "Don't ask again") {
// Set user preference to silent install
const configFactory = new DefaultConfigurationFactory();
configFactory.getConfiguration().server().setSilentInstall(true);
}
}

Expand Down
Loading