Search in sources :

Example 1 with CompoundPositionManager

use of com.intellij.debugger.engine.CompoundPositionManager in project intellij-community by JetBrains.

the class GroovyPositionManager method createPrepareRequest.

@Override
public ClassPrepareRequest createPrepareRequest(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position) throws NoDataException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("createPrepareRequest: " + position);
    }
    checkGroovyFile(position);
    String qName = getOuterClassName(position);
    if (qName != null) {
        return myDebugProcess.getRequestsManager().createClassPrepareRequest(requestor, qName);
    }
    qName = findEnclosingName(position);
    if (qName == null)
        throw NoDataException.INSTANCE;
    ClassPrepareRequestor waitRequestor = new ClassPrepareRequestor() {

        @Override
        public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
            final CompoundPositionManager positionManager = ((DebugProcessImpl) debuggerProcess).getPositionManager();
            if (!positionManager.locationsOfLine(referenceType, position).isEmpty()) {
                requestor.processClassPrepare(debuggerProcess, referenceType);
            }
        }
    };
    return myDebugProcess.getRequestsManager().createClassPrepareRequest(waitRequestor, qName + "$*");
}
Also used : ClassPrepareRequestor(com.intellij.debugger.requests.ClassPrepareRequestor) DebugProcess(com.intellij.debugger.engine.DebugProcess) CompoundPositionManager(com.intellij.debugger.engine.CompoundPositionManager) DebugProcessImpl(com.intellij.debugger.engine.DebugProcessImpl) ReferenceType(com.sun.jdi.ReferenceType)

Aggregations

CompoundPositionManager (com.intellij.debugger.engine.CompoundPositionManager)1 DebugProcess (com.intellij.debugger.engine.DebugProcess)1 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)1 ClassPrepareRequestor (com.intellij.debugger.requests.ClassPrepareRequestor)1 ReferenceType (com.sun.jdi.ReferenceType)1