use of org.intellij.plugins.xsltDebugger.BreakpointContext in project intellij-community by JetBrains.
the class XsltDebuggerEditorsProvider method createDocument.
@NotNull
@Override
public Document createDocument(@NotNull Project project, @NotNull String text, @Nullable XSourcePosition sourcePosition, @NotNull EvaluationMode mode) {
final PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText("XPathExpr." + myFileType.getDefaultExtension(), myFileType, text, LocalTimeCounter.currentTime(), true);
if (sourcePosition instanceof XsltSourcePosition && ((XsltSourcePosition) sourcePosition).getLocation() instanceof Debugger.StyleFrame) {
final Debugger.Locatable location = ((XsltSourcePosition) sourcePosition).getLocation();
final EvalContextProvider context = new EvalContextProvider(((Debugger.StyleFrame) location).getVariables());
context.attachTo(psiFile);
} else {
final PsiElement contextElement = XsltBreakpointHandler.findContextElement(project, sourcePosition);
if (contextElement != null) {
final BreakpointContext context = new BreakpointContext(contextElement);
context.attachTo(psiFile);
}
}
final Document document = PsiDocumentManager.getInstance(project).getDocument(psiFile);
assert document != null;
return document;
}
Aggregations