This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There are checks for .java file extensions at several places in debuggerjpda module. This is causing problems when other languages that compile to class files are to be debugged. Therefore we should not reference .java extensions explicitely. Usages of ".java": debuggerjpda/ant/antsrc/org/netbeans/modules/debugger/jpda/ant/JPDAReload.java (-this might be O.K.) debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/RunToCursorActionProvider.java debuggerjpda/src/org/netbeans/modules/debugger/jpda/EditorContextBridge.java debuggerjpda/src/org/netbeans/modules/debugger/jpda/SourcePath.java debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/RunIntoMethodActionProvider.java debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/RunToCursorActionProvider.java debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/ToggleBreakpointActionProvider.java debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/EditorContextBridge.java debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/SourcePath.java
The behavior in ToggleBreakPointProvider is blocking our non-Java (but Java VM-language) debugger from being usable.
I thought I would make a patch for this to hopefully speed up the resolution of this issue. When I looked at it, I discovered that it's difficult from within the ActionProvider to get a handle on the Document corresponding to the current editor, since the context API doesn't provide it. Furthermore, I realized that it's not ideal to assume that whoever owns the DataObject will know whether or not the data type is debuggable. It seems much better if a module can independently register knowledge about whether a particular file type is debuggable (or more specifically, breakpointable) or not. Thus, one way to fix this is for the ToggleBreakpointAction to be changed from looking at the particular MIME type, and hardcode checking it against text/x-java, to look up in the layer filesystem and check whether the given MIME type is known to be debuggable. The attached patch will do that. The debuggerjpda module will first register in Debugging/Breakpoints/text/x-java that the text/x-java MIME type is known to be debuggable. Then, the Toggle action will instead of doing an equals comparison on text/x-java, simply look in the SystemFileSystem and check whether the current MIME type is in the Breakpoints folder. Obviously, rather than just check the existence of a folder you could use more fancy lookup here, or actually look up a specific instance which could be queried (if more dynamic determination of debuggability needs to be made). But this simple change at least removes this barrier to non-Java VM languages. With this change I can register my own MIME type and everything seems to be working smoothly (well, once I implemented the org.openide.src API too.... is that going to be replaced soon?)
Created attachment 33076 [details] Possible implementation to resolve the issue with ToggleBreakpoint action
I'll look at the other actions with hardcoded java references (such as RunToCursorActionProvider) pending your thoughts on this idea.
Changing TM for open issues.