mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimize MemberFilter: don't visit JSReferenceExpression twice, don't call multiResolve twice
support JSDefinitionExpression correctly — we don't need to resolve it
This commit is contained in:
+7
-2
@@ -47,12 +47,17 @@ public abstract class JavaScriptDebugAware {
|
||||
protected abstract ExpressionInfo getEvaluationInfo(@NotNull PsiElement elementAtOffset, @NotNull Document document, @NotNull ExpressionInfoFactory expressionInfoFactory);
|
||||
|
||||
public static boolean isBreakpointAware(@NotNull FileType fileType) {
|
||||
return getBreakpointAware(fileType) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static JavaScriptDebugAware getBreakpointAware(@NotNull FileType fileType) {
|
||||
for (JavaScriptDebugAware debugAware : EP_NAME.getExtensions()) {
|
||||
if (debugAware.getBreakpointTypeClass() == null && fileType.equals(debugAware.getFileType())) {
|
||||
return true;
|
||||
return debugAware;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import java.util.Collections;
|
||||
public abstract class MemberFilterBase implements MemberFilter {
|
||||
@Override
|
||||
public boolean isMemberVisible(@NotNull Variable variable, boolean filterFunctions) {
|
||||
return true;
|
||||
return variable.isReadable();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -38,4 +38,9 @@ public class SourceInfo extends XSourcePositionWrapper {
|
||||
public Navigatable createNavigatable(@NotNull Project project) {
|
||||
return new OpenFileDescriptor(project, myPosition.getFile(), myPosition.getLine(), column);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return myPosition.getFile() + ":" + myPosition.getLine() + (column == -1 ? "": (":" + getColumn()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import com.intellij.xdebugger.frame.presentation.XStringValuePresentation;
|
||||
import com.intellij.xdebugger.frame.presentation.XValuePresentation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.concurrency.AsyncFunction;
|
||||
import org.jetbrains.concurrency.ConsumerRunnable;
|
||||
import org.jetbrains.concurrency.ObsolescentAsyncFunction;
|
||||
import org.jetbrains.concurrency.Promise;
|
||||
import org.jetbrains.debugger.values.*;
|
||||
|
||||
@@ -322,7 +322,12 @@ public final class VariableView extends XNamedValue implements VariableContext {
|
||||
promises.add(computeNamedProperties(objectValue, node, !hasIndexedProperties && additionalProperties == null));
|
||||
}
|
||||
else {
|
||||
promises.add(additionalProperties.then(new AsyncFunction<Void, Void>() {
|
||||
promises.add(additionalProperties.then(new ObsolescentAsyncFunction<Void, Void>() {
|
||||
@Override
|
||||
public boolean isObsolete() {
|
||||
return node.isObsolete();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Promise<Void> fun(Void o) {
|
||||
@@ -333,12 +338,10 @@ public final class VariableView extends XNamedValue implements VariableContext {
|
||||
}
|
||||
|
||||
if (hasIndexedProperties == hasNamedProperties || additionalProperties != null) {
|
||||
Promise.all(promises).processed(new ConsumerRunnable() {
|
||||
Promise.all(promises).processed(new ObsolescentConsumer<Void>(node) {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!node.isObsolete()) {
|
||||
node.addChildren(XValueChildrenList.EMPTY, true);
|
||||
}
|
||||
public void consume(Void aVoid) {
|
||||
node.addChildren(XValueChildrenList.EMPTY, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user