Skip to content

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

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

Conversation

sid-srini
Copy link
Member

@sid-srini sid-srini commented Jul 25, 2024

Fixes #199

Fixed extension.ts UpdateConfigurationRequest handler to update the global WorkspaceConfiguration for non-workspace opened files.

  1. Checked for non-workspace opened files by testing if vscode.workspace.workspaceFile is undefined/null.
  2. Invoked WorkspaceConfiguration.update() with configurationTarget = :
    • true: for non-workspace files;
    • null: otherwise.
  3. Added a try-catch to log errors in update and prevent downstream failures.
  4. Avoided an unnecessary await and used the Thenable chain of update().

… in global settings for non-workspace opened Java files

Fixed extension.ts `UpdateConfigurationRequest` handler to update the global `WorkspaceConfiguration` for non-workspace opened files.

1. Checked for non-workspace opened files by testing if `vscode.workspace.workspaceFile` is undefined/null.
2. Invoked `WorkspaceConfiguration.update()` with `configurationTarget = `:
    - `true`: for non-workspace files;
    - `null`: otherwise.
3. Added a try-catch to log errors in update and prevent downstream failures.
4. Avoided an unnecessary `await` and used the `Thenable` chain of `update()`.
@sid-srini sid-srini marked this pull request as draft July 25, 2024 01:43
@sid-srini sid-srini closed this Jul 25, 2024
@sid-srini sid-srini deleted the vsc199-update-global-settings-non-workspace-runConfig branch July 25, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant