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

LSP + VSCode extension: Run/Debug via project actions. #3353

Merged
merged 1 commit into from Dec 9, 2021

Conversation

entlicher
Copy link
Contributor

@entlicher entlicher commented Dec 3, 2021

For consistency reasons we execute project Run/Debug actions instead of file Run/Debug in VSCode. File-sensitive actions are provided as code lenses. Via project's Run/Debug actions users get consistent behavior.

Currently there was mainClass property set to ${file} in VSCode's launch.json. We are changing mainClass property to be optional, it's not set in newly created launch.json and we're using file property set to ${file} to get the context. mainClass allows to set a specific file as a context to Run/Debug. When not set, we use file to determine the current project to run Run/Debug on.

We need to adjust Maven projects to be able to Run/Debug without mainClass set. The project should know it's entry point. Currently, when you create a new Maven project from template, it asks you for the main class before Run/Debug. This is an unexpected behavior for the user, as the newly created project should know its main class. This is why we set exec.mainClass in Maven now.

Copy link

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I see no description and I don't understand the goal of the changes. Shall I disassemble your changes and try to assign them a purpose?

@@ -93,23 +93,18 @@

activeLaunchHandler.preLaunch(launchArguments, context);

String filePath = (String)launchArguments.get("mainClass");
String filePath = (String)launchArguments.get("file");
String mainFilePath = (String)launchArguments.get("mainClass");
Copy link
Member

Choose a reason for hiding this comment

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

is the mainClass an URI actually ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@entlicher entlicher changed the title Run/Debug via project actions. LSP + VSCode extension: Run/Debug via project actions. Dec 6, 2021
@entlicher entlicher closed this Dec 6, 2021
@entlicher entlicher reopened this Dec 6, 2021
@entlicher entlicher requested review from JaroslavTulach and removed request for sdedic December 6, 2021 12:16
@entlicher
Copy link
Contributor Author

I've unintentionally closed the PR when I wanted to remove an unintentional comment.

@entlicher
Copy link
Contributor Author

I've added the description.

@entlicher entlicher added this to the NB13 milestone Dec 6, 2021
@entlicher entlicher added the VSCode Extension [ci] enable VSCode Extension tests label Dec 6, 2021
@entlicher entlicher merged commit adf74ef into apache:master Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants