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

Conversation

sid-srini
Copy link
Member

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

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

Closes #199

…g options 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 <[email protected]>
@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 requested a review from lahodaj July 25, 2024 05:58
Copy link
Member

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment inline.

…g options in global settings for non-workspace opened Java files

Removed unnecessary if check for vscode.workspace, in the previous fix commit;
 since it is a VS Code API namespace.

Signed-off-by: Siddharth Srinivasan <[email protected]>
Copy link
Member

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sid-srini sid-srini merged commit 884f798 into oracle:main Aug 7, 2024
3 checks passed
@sid-srini sid-srini added this to the JVSC 22.1.2 milestone Aug 7, 2024
@sid-srini sid-srini self-assigned this Aug 7, 2024
@sid-srini sid-srini deleted the vsc199-update-global-settings-non-workspace-runConfig branch September 18, 2024 08:40
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
2 participants