sdedic commented on a change in pull request #2995:
URL: https://github.com/apache/netbeans/pull/2995#discussion_r650780118
##########
File path:
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -1088,6 +1121,39 @@ public Void visitMethod(MethodTree tree, Void p) {
return result;
}
+ private List<Pair<String, String>> getProjectConfigurations(JavaSource
source) {
+ for (FileObject fo : source.getFileObjects()) {
+ Project p = FileOwnerQuery.getOwner(fo);
+ if (p != null) {
+ ProjectConfigurationProvider<ProjectConfiguration> provider =
p.getLookup().lookup(ProjectConfigurationProvider.class);
+ List<Pair<String, String>> configDispNames = new ArrayList<>();
+ if (provider != null) {
+ boolean skippedFirst = false;
+ for (ProjectConfiguration c :
provider.getConfigurations()) {
+ if (skippedFirst) {
+ String runConfig = null;
+ String debugConfig = null;
+ if (provider.configurationAffectsAction(c,
ActionProvider.COMMAND_RUN_SINGLE)) {
Review comment:
OK, one more thought. The code here seems to check if an action (run,
debug) is **available** in a specific configuration. We have a similar issue
with plain "Run" action in vscode (which means essentially "Debug" in vscode
terminology). It was planned to display a warning message, something like
"Debug is not supported in XXX config, running without debugger" - and for that
I need a similar info.
What if, instead of `configurationAffectsAction` (or in addition to),
`isActionEnabled(Configuration, String)` is introduced ? We can **enhance**
Maven and Gradle XML format with `disable` flag for the actions (or autodetect
when e.g. commandline or goal list is empty ?), and finally declare `debug` as
disabled in the `mn:run` or `gradle --continuous` case. That would work for
both code lens, the regular debug adapter, and would be consistent with the IDE
behaviour.
@JaroslavTulach, @MartinBalin, @entlicher -- opinions ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists