mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
dart breakpoints: add langugage hint
This commit is contained in:
@@ -59,6 +59,6 @@ public abstract class Breakpoint {
|
||||
/**
|
||||
* Visitor interface that includes all extensions.
|
||||
*/
|
||||
public interface TargetExtendedVisitor<R> extends FunctionSupport.Visitor<R>, ScriptRegExpSupport.Visitor<R> {
|
||||
public interface TargetExtendedVisitor<R> extends FunctionSupport.Visitor<R>, ScriptRegExpSupportVisitor<R> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
+2
-3
@@ -135,10 +135,9 @@ public abstract class BreakpointManagerBase<T extends BreakpointBase<?>> impleme
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ScriptRegExpSupport getScriptRegExpSupport() {
|
||||
return null;
|
||||
public boolean hasScriptRegExpSupport() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+6
-4
@@ -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> R accept(Visitor<R> visitor) {
|
||||
if (visitor instanceof ScriptRegExpSupport.Visitor) {
|
||||
return ((ScriptRegExpSupport.Visitor<R>)visitor).visitRegExp(regExp);
|
||||
if (visitor instanceof ScriptRegExpSupportVisitor) {
|
||||
return ((ScriptRegExpSupportVisitor<R>)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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<R> extends BreakpointTarget.Visitor<R> {
|
||||
/**
|
||||
* @param regExp regular expression pattern (as specified in JavaScript) that will be
|
||||
* used to match script names
|
||||
*/
|
||||
R visitRegExp(String regExp);
|
||||
}
|
||||
}
|
||||
+26
@@ -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<R> extends BreakpointTarget.Visitor<R> {
|
||||
R visitRegExp(@NotNull ScriptRegExpBreakpointTarget target);
|
||||
}
|
||||
+1
-1
@@ -96,7 +96,7 @@ public abstract class DebugProcessImpl<C extends VmConnection> extends XDebugPro
|
||||
return editorsProvider;
|
||||
}
|
||||
|
||||
public void setProcessBreakpointConditionsAtIdeSide(final boolean processBreakpointConditionsAtIdeSide) {
|
||||
public void setProcessBreakpointConditionsAtIdeSide(boolean processBreakpointConditionsAtIdeSide) {
|
||||
this.processBreakpointConditionsAtIdeSide = processBreakpointConditionsAtIdeSide;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user