Skip to content
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

if current file is not a main class, 'Run Java' will run previously used app #1301

Merged
merged 4 commits into from Feb 24, 2023

Conversation

testforstephen
Copy link
Contributor

Fixes #1036

Old:

  • If current file is a main class, run it directly.
  • If current file is not a main class, it will always pop up a dialog to select the target main class to run.

New:

  • If current file is a main class, "Run Java" will still run current file as past.
  • If current file is not a main class, then run previously launched application automatically.

filePath ? vscode.workspace.getWorkspaceFolder(vscode.Uri.file(filePath)) : undefined;
const launchConfigurations: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("launch", workspaceFolder);
const existingConfigs: vscode.DebugConfiguration[] = launchConfigurations.configurations;
const existConfig: vscode.DebugConfiguration | undefined = _.find(existingConfigs, (config) => {
Copy link
Member

Choose a reason for hiding this comment

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

What if the user has two debug configurations, whose mainClass and projectName are the same but other options like args, vmArgs are different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The first one will be used. This might be a rare case, since no complaint received yet.

jdneo
jdneo approved these changes Feb 24, 2023
@testforstephen testforstephen merged commit 93cbc19 into microsoft:main Feb 24, 2023
4 checks passed
@testforstephen testforstephen deleted the jinbo_launch branch February 24, 2023 04:34
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.

Add a "launch previously launched application option if the current file isn't executable" option.
2 participants