Skip to content

[JAVAVSCODE #199] Quick Fix actions are unable to edit runConfig options in global settings for non-workspace opened Java files #211

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

Merged
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
18 changes: 16 additions & 2 deletions vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,22 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
return selected ? Array.isArray(selected) ? selected : [selected] : undefined;
});
c.onRequest(UpdateConfigurationRequest.type, async (param) => {
await vscode.workspace.getConfiguration(param.section).update(param.key, param.value);
runConfigurationUpdateAll();
handleLog(log, "Received config update: " + param.section + "." + param.key + "=" + param.value);
let wsFile: vscode.Uri | undefined = vscode.workspace.workspaceFile;
let wsConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(param.section);
if (wsConfig) {
try {
wsConfig.update(param.key, param.value, wsFile ? null : true)
.then(() => {
handleLog(log, "Updated configuration: " + param.section + "." + param.key + "=" + param.value + "; in: " + (wsFile ? wsFile.toString() : "Global"));
})
.then(() => {
runConfigurationUpdateAll();
});
} catch (err) {
handleLog(log, "Failed to update configuration. Reason: " + (typeof err === "string" ? err : err instanceof Error ? err.message : "error"));
}
}
});
c.onRequest(SaveDocumentsRequest.type, async (request : SaveDocumentRequestParams) => {
const uriList = request.documents.map(s => {
Expand Down