mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -165,6 +165,7 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
synchronized (myTransactionMap) {
|
||||
myTransactionMap.remove(doc);
|
||||
}
|
||||
incTransactionCount(doc);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1234,7 +1235,8 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
content = new AuthenticContent(document);
|
||||
}
|
||||
|
||||
final long currentDocStamp = content.getModificationStamp();
|
||||
final long currentDocStamp = content.getModificationStamp() +
|
||||
getTransactionCount(document); // we add transaction count in order to deal with committed status
|
||||
if (currentDocStamp != myLastIndexedDocStamps.getAndSet(document, requestedIndexId, currentDocStamp)) {
|
||||
final Ref<StorageException> exRef = new Ref<StorageException>(null);
|
||||
ProgressManager.getInstance().executeNonCancelableSection(new Runnable() {
|
||||
@@ -1280,6 +1282,18 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final Key<Integer> TRANSACTION_COUNT = new Key<Integer>("Transaction count");
|
||||
|
||||
private long getTransactionCount(@NotNull Document document) {
|
||||
Integer data = document.getUserData(TRANSACTION_COUNT);
|
||||
return data != null ? data : 0;
|
||||
}
|
||||
|
||||
private void incTransactionCount(@NotNull Document document) {
|
||||
Integer data = document.getUserData(TRANSACTION_COUNT);
|
||||
document.putUserData(TRANSACTION_COUNT, (data != null ? data : 0) + 1);
|
||||
}
|
||||
|
||||
public static final Key<EditorHighlighter> EDITOR_HIGHLIGHTER = new Key<EditorHighlighter>("Editor");
|
||||
|
||||
@Nullable
|
||||
|
||||
+64
-1
@@ -17,13 +17,20 @@
|
||||
package org.intellij.plugins.xsltDebugger.rt.engine.local.saxon9;
|
||||
|
||||
import net.sf.saxon.expr.XPathContext;
|
||||
import net.sf.saxon.expr.instruct.InstructionDetails;
|
||||
import net.sf.saxon.lib.TraceListener;
|
||||
import net.sf.saxon.om.Item;
|
||||
import net.sf.saxon.om.NodeInfo;
|
||||
import net.sf.saxon.style.StyleElement;
|
||||
import net.sf.saxon.trace.InstructionInfo;
|
||||
import org.intellij.plugins.xsltDebugger.rt.engine.Debugger;
|
||||
import org.intellij.plugins.xsltDebugger.rt.engine.Value;
|
||||
import org.intellij.plugins.xsltDebugger.rt.engine.local.LocalDebugger;
|
||||
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.SourceLocator;
|
||||
import java.util.List;
|
||||
|
||||
public class Saxon9TraceListener implements TraceListener {
|
||||
private static final boolean TRACE = "true".equals(System.getProperty("xslt.debugger.trace", "false"));
|
||||
|
||||
@@ -63,6 +70,8 @@ public class Saxon9TraceListener implements TraceListener {
|
||||
}
|
||||
if (instructionInfo instanceof StyleElement) {
|
||||
myDebugger.enter(new Saxon9StyleFrame(myDebugger.getCurrentFrame(), (StyleElement)instructionInfo, xPathContext));
|
||||
} else if (instructionInfo instanceof InstructionDetails) {
|
||||
myDebugger.enter(new VirtualFrame(myDebugger.getCurrentFrame(), (InstructionDetails)instructionInfo));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +79,7 @@ public class Saxon9TraceListener implements TraceListener {
|
||||
if (TRACE) {
|
||||
trace("</>");
|
||||
}
|
||||
if (instructionInfo instanceof StyleElement) {
|
||||
if (instructionInfo instanceof StyleElement || instructionInfo instanceof InstructionDetails) {
|
||||
myDebugger.leave();
|
||||
}
|
||||
}
|
||||
@@ -89,4 +98,58 @@ public class Saxon9TraceListener implements TraceListener {
|
||||
myDebugger.popSource();
|
||||
}
|
||||
}
|
||||
|
||||
private static class VirtualFrame extends AbstractSaxon9Frame<Debugger.StyleFrame, Source> implements Debugger.StyleFrame {
|
||||
|
||||
public VirtualFrame(Debugger.StyleFrame previous, InstructionDetails instr) {
|
||||
super(previous, new MySource(instr));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInstruction() {
|
||||
return getPrevious().getInstruction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value eval(String expr) throws Debugger.EvaluationException {
|
||||
return getPrevious().eval(expr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Debugger.Variable> getVariables() {
|
||||
return getPrevious().getVariables();
|
||||
}
|
||||
|
||||
private static class MySource implements Source, SourceLocator {
|
||||
private final InstructionDetails myInstruction;
|
||||
|
||||
public MySource(InstructionDetails instr) {
|
||||
myInstruction = instr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemId(String systemId) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPublicId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemId() {
|
||||
return myInstruction.getSystemId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLineNumber() {
|
||||
return myInstruction.getLineNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColumnNumber() {
|
||||
return myInstruction.getColumnNumber();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user