You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add validation for configuration items of launch.json #355
The debugger only has type validation for the config items (mainClass, projectName) of launch.json, this is a kind of static validation, and it cannot check the illegal value.
For example, for the common config errors below, the debugger will report it at a much latter stage with error message Failed to resolve classpath: .... It doesn't point out the failure reason clearly.
Main class 'C:\demo\org\microsoft\app\Main.java' doesn't exist in the workspace.
Main class 'org.microsoft.app.Main' isn't unique in the workspace.
The project 'demo' is not a valid java project.
In order to better remind the user about the config error with more concise error message, plan to add code validation in the debug configuration provider for the key configuration items. (e.g. mainClass, projectName, port)
So far VSCode doesn't support auto complete when the user is editing the launch.json. It provides another mechanism DebugConfigurationProvider to allow the debugger to resolve launch config before launching debug session.
The idea is to validate mainClass and projectName config in the DebugConfigurationProvider, and when the user configured an incorrect value for these two configs, the debugger will prompt the possible correct configs with QuickPick dropdown. If the user selects the fix, the debugger will persist the fix in launch.json too.
When showing the quick fix proposals, put the proposals with the same name as the original mainClass or projectName configs in launch.json on the top, and the remaining proposals in alphabet order.
Activity
testforstephen commentedon Aug 17, 2018
So far VSCode doesn't support auto complete when the user is editing the launch.json. It provides another mechanism
DebugConfigurationProviderto allow the debugger to resolve launch config before launching debug session.The idea is to validate mainClass and projectName config in the
DebugConfigurationProvider, and when the user configured an incorrect value for these two configs, the debugger will prompt the possible correct configs with QuickPick dropdown. If the user selects the fix, the debugger will persist the fix in launch.json too.testforstephen commentedon Aug 22, 2018
When showing the quick fix proposals, put the proposals with the same name as the original mainClass or projectName configs in launch.json on the top, and the remaining proposals in alphabet order.
testforstephen commentedon Aug 28, 2018
PR #368 and microsoft/java-debug#205 merged. It will be released in 0.12.0. close it.