summaryrefslogtreecommitdiff
path: root/platform/script-debugger/backend/src/org/jetbrains/debugger/DebugEventListener.java
blob: a8038bed8f419b4c81db8220df6a8bba4715d43d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.jetbrains.debugger;

import com.intellij.util.Url;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.EventListener;

/**
 * This interface is used by the SDK to report debug events for a certain {@link Vm} to
 * the clients.
 */
public interface DebugEventListener extends EventListener {
  /**
   * Reports the virtual machine has suspended (on hitting
   * breakpoints or a step end). The {@code context} can be used to access the
   * current backtrace.
   */
  void suspended(@NotNull SuspendContext context);

  /**
   * Reports the virtual machine has resumed. This can happen
   * asynchronously, due to a user action in the browser (without explicitly
   * resuming the VM through
   */
  void resumed();

  /**
   * Reports the debug connection has terminated and {@link Vm} has stopped operating.
   * This event is not reported if connection was closed explicitly on our side
   */
  void disconnected();

  /**
   * Reports that a new script has been loaded into a tab.
   *
   * @param script loaded into the tab
   */
  void scriptLoaded(@NotNull Script script, @Nullable String sourceMapData);

  void sourceMapFound(@NotNull Script script, @Nullable Url sourceMapUrl, @NotNull String sourceMapData);

  /**
   * Reports that the script has been collected and is no longer used in VM.
   */
  void scriptCollected(Script script);

  void scriptsCleared();

  /**
   * Reports that script source has been altered in remote VM.
   */
  void scriptContentChanged(@NotNull Script newScript);

  /**
   * Reports a navigation event on the target.
   *
   * @param newUrl the new URL of the debugged target
   */
  void navigated(String newUrl);

  void errorOccurred(@NotNull String errorMessage);
}