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
Conversation
a37c7cd
to
63f8da7
Compare
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
I've unintentionally closed the PR when I wanted to remove an unintentional comment. |
I've added the description. |
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'slaunch.json
. We are changingmainClass
property to be optional, it's not set in newly createdlaunch.json
and we're usingfile
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 usefile
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 setexec.mainClass
in Maven now.