diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/Breakpoint.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/Breakpoint.java index c94eda0ba685..64526e4eb5a2 100755 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/Breakpoint.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/Breakpoint.java @@ -59,6 +59,6 @@ public abstract class Breakpoint { /** * Visitor interface that includes all extensions. */ - public interface TargetExtendedVisitor extends FunctionSupport.Visitor, ScriptRegExpSupport.Visitor { + public interface TargetExtendedVisitor extends FunctionSupport.Visitor, ScriptRegExpSupportVisitor { } } diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManager.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManager.java index 248481b53e9b..2ec73dabacc5 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManager.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManager.java @@ -20,8 +20,7 @@ public interface BreakpointManager { @Nullable FunctionSupport getFunctionSupport(); - @Nullable - ScriptRegExpSupport getScriptRegExpSupport(); + boolean hasScriptRegExpSupport(); // Could be called multiple times for breakpoint void addBreakpointListener(@NotNull BreakpointListener listener); diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManagerBase.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManagerBase.java index 611d831d618c..ef975a9508f8 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManagerBase.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/BreakpointManagerBase.java @@ -135,10 +135,9 @@ public abstract class BreakpointManagerBase> impleme return null; } - @Nullable @Override - public ScriptRegExpSupport getScriptRegExpSupport() { - return null; + public boolean hasScriptRegExpSupport() { + return false; } @NotNull diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpBreakpointTarget.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpBreakpointTarget.java index 4bc4b9ad54e8..3ee44eff0b64 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpBreakpointTarget.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpBreakpointTarget.java @@ -1,18 +1,21 @@ package org.jetbrains.debugger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public final class ScriptRegExpBreakpointTarget extends BreakpointTarget { private final String regExp; + public final String language; - public ScriptRegExpBreakpointTarget(@NotNull String regExp) { + public ScriptRegExpBreakpointTarget(@NotNull String regExp, @Nullable String language) { this.regExp = regExp; + this.language = language; } @Override public R accept(Visitor visitor) { - if (visitor instanceof ScriptRegExpSupport.Visitor) { - return ((ScriptRegExpSupport.Visitor)visitor).visitRegExp(regExp); + if (visitor instanceof ScriptRegExpSupportVisitor) { + return ((ScriptRegExpSupportVisitor)visitor).visitRegExp(this); } else { return visitor.visitUnknown(this); @@ -32,7 +35,6 @@ public final class ScriptRegExpBreakpointTarget extends BreakpointTarget { if (o == null || getClass() != o.getClass()) { return false; } - return regExp.equals(((ScriptRegExpBreakpointTarget)o).regExp); } diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupport.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupport.java deleted file mode 100644 index 88be0e76ae83..000000000000 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupport.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.jetbrains.debugger; - -/** - * Supports targets that refer to a script by a 'regexp' of its name - */ -public interface ScriptRegExpSupport { - /** - * @param regExp JavaScript RegExp - * @return not null - */ - BreakpointTarget createTarget(String regExp); - - /** - * Additional interface that user visitor may implement for {@link BreakpointTarget#accept} - * method. - */ - interface Visitor extends BreakpointTarget.Visitor { - /** - * @param regExp regular expression pattern (as specified in JavaScript) that will be - * used to match script names - */ - R visitRegExp(String regExp); - } -} \ No newline at end of file diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupportVisitor.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupportVisitor.java new file mode 100644 index 000000000000..1e1952aadd2b --- /dev/null +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/ScriptRegExpSupportVisitor.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.debugger; + +import org.jetbrains.annotations.NotNull; + +/** + * Additional interface that user visitor may implement for {@link BreakpointTarget#accept} + * method. + */ +public interface ScriptRegExpSupportVisitor extends BreakpointTarget.Visitor { + R visitRegExp(@NotNull ScriptRegExpBreakpointTarget target); +} diff --git a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.java b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.java index 0afe3d26396a..e59cd47ee34a 100644 --- a/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.java +++ b/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebugProcessImpl.java @@ -96,7 +96,7 @@ public abstract class DebugProcessImpl extends XDebugPro return editorsProvider; } - public void setProcessBreakpointConditionsAtIdeSide(final boolean processBreakpointConditionsAtIdeSide) { + public void setProcessBreakpointConditionsAtIdeSide(boolean processBreakpointConditionsAtIdeSide) { this.processBreakpointConditionsAtIdeSide = processBreakpointConditionsAtIdeSide; } diff --git a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.java b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.java index c728177e204f..c506e8f00fda 100644 --- a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.java +++ b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.java @@ -284,7 +284,7 @@ public abstract class OutMessage { } } - protected final void writeString(@NotNull String name, @Nullable String value) { + public final void writeString(@NotNull String name, @Nullable String value) { if (value != null) { writeNullableString(name, value); }