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-196 Run Configuration section is unavailable in the Explorer panel for non-workspace opened Java files #206

Closed sid-srini closed 4 months ago

sid-srini commented 4 months ago

Fixes #196

Fixed runConfiguration.ts: initializeRunConfiguration() to search for java files in open editors when no workspace is open.

  1. Checked for non-workspace opened files by testing the validity of vscode.workspace.name AND vscode.workspace.workspaceFile.
  2. Searched for java extension file names in vscode.workspace.textDocuments when no workspace is open.
  3. Fixed RunConfigurationNode.setValue() to invoke WorkspaceConfiguration.update() with configurationTarget =:
    • true: when no workspace is open i.e. user global target;
    • null: otherwise i.e. workspace target.