oracle / javavscode

Java platform support for Visual Studio Code for full featured Java development (edit-compile-debug & test cycle)
Apache License 2.0
231 stars 31 forks source link

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

Closed sid-srini closed 3 months ago

sid-srini commented 4 months ago

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