Skip to content

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

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

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().

Fixes #199

… 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()`.

Fixes oracle#199

Signed-off-by: Siddharth Srinivasan <siddharth.srinivasan@oracle.com>
@sid-srini sid-srini marked this pull request as draft July 25, 2024 05:24
@sid-srini sid-srini changed the base branch from 22.1.2-Bugfix to main July 25, 2024 05:25
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 25, 2024
@sid-srini sid-srini marked this pull request as ready for review July 25, 2024 05:26
@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 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quick Fix actions are unable to edit runConfig options in global settings for non-workspace opened Java files
1 participant