@jupyterlab/debugger 4.0.0-alpha.16 → 4.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/session.d.ts CHANGED
@@ -40,11 +40,6 @@ export declare class DebuggerSession implements IDebugger.ISession {
40
40
  * Whether the debug session is started.
41
41
  */
42
42
  get isStarted(): boolean;
43
- /**
44
- * Whether to pause on exceptions
45
- */
46
- get pausingOnExceptions(): string[];
47
- set pausingOnExceptions(updatedPausingOnExceptions: string[]);
48
43
  /**
49
44
  * Exception paths defined by the debugger
50
45
  */
@@ -53,6 +48,14 @@ export declare class DebuggerSession implements IDebugger.ISession {
53
48
  * Exception breakpoint filters defined by the debugger
54
49
  */
55
50
  get exceptionBreakpointFilters(): DebugProtocol.ExceptionBreakpointsFilter[] | undefined;
51
+ /**
52
+ * Get current exception filters.
53
+ */
54
+ get currentExceptionFilters(): string[];
55
+ /**
56
+ * Set current exception filters.
57
+ */
58
+ set currentExceptionFilters(exceptionFilters: string[] | null);
56
59
  /**
57
60
  * Signal emitted for debug event messages.
58
61
  */
@@ -73,6 +76,12 @@ export declare class DebuggerSession implements IDebugger.ISession {
73
76
  * Restore the state of a debug session.
74
77
  */
75
78
  restoreState(): Promise<IDebugger.ISession.Response['debugInfo']>;
79
+ /**
80
+ * Whether the debugger is pausing on exception.
81
+ *
82
+ * @param filter - Specify a filter
83
+ */
84
+ isPausingOnException(filter?: string): boolean;
76
85
  /**
77
86
  * Send a custom debug request to the kernel.
78
87
  *
@@ -97,12 +106,13 @@ export declare class DebuggerSession implements IDebugger.ISession {
97
106
  private _seq;
98
107
  private _ready;
99
108
  private _connection;
109
+ private _config;
100
110
  private _capabilities;
101
111
  private _isDisposed;
102
112
  private _isStarted;
103
- private _pausingOnExceptions;
104
113
  private _exceptionPaths;
105
114
  private _exceptionBreakpointFilters;
115
+ private _currentExceptionFilters;
106
116
  private _disposed;
107
117
  private _eventMessage;
108
118
  }
@@ -118,6 +128,10 @@ export declare namespace DebuggerSession {
118
128
  * The session connection used by the debug session.
119
129
  */
120
130
  connection: Session.ISessionConnection;
131
+ /**
132
+ * The debugger config
133
+ */
134
+ config: IDebugger.IConfig;
121
135
  /**
122
136
  * The application language translator.
123
137
  */
package/lib/session.js CHANGED
@@ -17,12 +17,13 @@ export class DebuggerSession {
17
17
  this._ready = new PromiseDelegate();
18
18
  this._isDisposed = false;
19
19
  this._isStarted = false;
20
- this._pausingOnExceptions = [];
21
20
  this._exceptionPaths = [];
22
21
  this._exceptionBreakpointFilters = [];
22
+ this._currentExceptionFilters = {};
23
23
  this._disposed = new Signal(this);
24
24
  this._eventMessage = new Signal(this);
25
25
  this.connection = options.connection;
26
+ this._config = options.config;
26
27
  this.translator = options.translator || nullTranslator;
27
28
  }
28
29
  /**
@@ -85,15 +86,6 @@ export class DebuggerSession {
85
86
  get isStarted() {
86
87
  return this._isStarted;
87
88
  }
88
- /**
89
- * Whether to pause on exceptions
90
- */
91
- get pausingOnExceptions() {
92
- return this._pausingOnExceptions;
93
- }
94
- set pausingOnExceptions(updatedPausingOnExceptions) {
95
- this._pausingOnExceptions = updatedPausingOnExceptions;
96
- }
97
89
  /**
98
90
  * Exception paths defined by the debugger
99
91
  */
@@ -106,6 +98,48 @@ export class DebuggerSession {
106
98
  get exceptionBreakpointFilters() {
107
99
  return this._exceptionBreakpointFilters;
108
100
  }
101
+ /**
102
+ * Get current exception filters.
103
+ */
104
+ get currentExceptionFilters() {
105
+ var _a, _b, _c;
106
+ const kernel = (_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '';
107
+ if (!kernel) {
108
+ return [];
109
+ }
110
+ const tmpFileParams = this._config.getTmpFileParams(kernel);
111
+ if (!tmpFileParams) {
112
+ return [];
113
+ }
114
+ let prefix = tmpFileParams.prefix;
115
+ if (Object.keys(this._currentExceptionFilters).includes(prefix)) {
116
+ return this._currentExceptionFilters[prefix];
117
+ }
118
+ return [];
119
+ }
120
+ /**
121
+ * Set current exception filters.
122
+ */
123
+ set currentExceptionFilters(exceptionFilters) {
124
+ var _a, _b, _c;
125
+ const kernel = (_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.kernel) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '';
126
+ if (!kernel) {
127
+ return;
128
+ }
129
+ const tmpFileParams = this._config.getTmpFileParams(kernel);
130
+ if (!tmpFileParams) {
131
+ return;
132
+ }
133
+ let prefix = tmpFileParams.prefix;
134
+ if (exceptionFilters === null) {
135
+ if (Object.keys(this._currentExceptionFilters).includes(prefix)) {
136
+ delete this._currentExceptionFilters[prefix];
137
+ }
138
+ }
139
+ else {
140
+ this._currentExceptionFilters[prefix] = exceptionFilters;
141
+ }
142
+ }
109
143
  /**
110
144
  * Signal emitted for debug event messages.
111
145
  */
@@ -153,11 +187,11 @@ export class DebuggerSession {
153
187
  * Stop the running debug session.
154
188
  */
155
189
  async stop() {
190
+ this._isStarted = false;
156
191
  await this.sendRequest('disconnect', {
157
192
  restart: false,
158
193
  terminateDebuggee: false
159
194
  });
160
- this._isStarted = false;
161
195
  }
162
196
  /**
163
197
  * Restore the state of a debug session.
@@ -169,6 +203,20 @@ export class DebuggerSession {
169
203
  this._exceptionPaths = (_a = message.body) === null || _a === void 0 ? void 0 : _a.exceptionPaths;
170
204
  return message;
171
205
  }
206
+ /**
207
+ * Whether the debugger is pausing on exception.
208
+ *
209
+ * @param filter - Specify a filter
210
+ */
211
+ isPausingOnException(filter) {
212
+ var _a, _b;
213
+ if (filter) {
214
+ return (_b = (_a = this.currentExceptionFilters) === null || _a === void 0 ? void 0 : _a.includes(filter)) !== null && _b !== void 0 ? _b : false;
215
+ }
216
+ else {
217
+ return this.currentExceptionFilters.length > 0;
218
+ }
219
+ }
172
220
  /**
173
221
  * Send a custom debug request to the kernel.
174
222
  *
@@ -1 +1 @@
1
- {"version":3,"file":"session.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QACxC,IAAI,OAAO,KAAK,aAAa,EAAE;YAC7B,OAAO;SACR;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAmC,CAAC;QAC1D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB,CAC7B,GAA8C;;QAE9C,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAC1D,CAAC;SACH;QACD,MAAM,KAAK,GAAG,IAAI,eAAe,EAAgC,CAAC;QAClE,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,CAAC,OAAO,GAAG,CAAC,GAAiC,EAAQ,EAAE;YAC3D,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,CAAC;QACF,MAAM,MAAM,CAAC,IAAI,CAAC;QAClB,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;CAoBF"}
package/lib/tokens.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';
2
2
  import { KernelMessage, Session } from '@jupyterlab/services';
3
- import { ISharedText } from '@jupyter-notebook/ydoc';
3
+ import { ISharedText } from '@jupyter/ydoc';
4
4
  import { ReadonlyJSONObject, Token } from '@lumino/coreutils';
5
5
  import { IDisposable, IObservableDisposable } from '@lumino/disposable';
6
6
  import { ISignal, Signal } from '@lumino/signaling';
@@ -20,9 +20,13 @@ export interface IDebugger {
20
20
  */
21
21
  readonly isStarted: boolean;
22
22
  /**
23
- * Whether the session is pausing for exceptions.
23
+ * Get debugger config.
24
24
  */
25
- readonly isPausingOnExceptions: boolean;
25
+ readonly config: IDebugger.IConfig;
26
+ /**
27
+ * A signal emitted when the pause on exception filter changes.
28
+ */
29
+ readonly pauseOnExceptionChanged: Signal<IDebugger, void>;
26
30
  /**
27
31
  * The debugger service's model.
28
32
  */
@@ -44,9 +48,15 @@ export interface IDebugger {
44
48
  */
45
49
  pauseOnExceptionsIsValid(): boolean;
46
50
  /**
47
- * Handles enabling and disabling of Pause on Exception
51
+ * Add a filter to pauseOnExceptionsFilter.
52
+ *
53
+ * @param exceptionFilter - filter name.
54
+ */
55
+ pauseOnExceptionsFilter(exceptionFilter: string): Promise<void>;
56
+ /**
57
+ * Send the pauseOnExceptions' filters to the debugger.
48
58
  */
49
- pauseOnExceptions(enable: boolean): Promise<void>;
59
+ pauseOnExceptions(exceptionFilter: string[]): Promise<void>;
50
60
  /**
51
61
  * Continues the execution of the current thread.
52
62
  */
@@ -119,6 +129,10 @@ export interface IDebugger {
119
129
  * Precondition: !isStarted
120
130
  */
121
131
  start(): Promise<void>;
132
+ /**
133
+ * Makes the current thread pause if possible.
134
+ */
135
+ pause(): Promise<void>;
122
136
  /**
123
137
  * Makes the current thread step in a function / method if possible.
124
138
  */
@@ -260,17 +274,13 @@ export declare namespace IDebugger {
260
274
  */
261
275
  connection: Session.ISessionConnection | null;
262
276
  /**
263
- * Returns the initialize response .
277
+ * Returns the initialize response.
264
278
  */
265
279
  readonly capabilities: DebugProtocol.Capabilities | undefined;
266
280
  /**
267
- * Whether the debug session is started
281
+ * Whether the debug session is started.
268
282
  */
269
283
  readonly isStarted: boolean;
270
- /**
271
- * Whether the debug session is pausing on exceptions.
272
- */
273
- pausingOnExceptions: string[];
274
284
  /**
275
285
  * Whether the debug session is pausing on exceptions.
276
286
  */
@@ -283,6 +293,16 @@ export declare namespace IDebugger {
283
293
  * Signal emitted for debug event messages.
284
294
  */
285
295
  readonly eventMessage: ISignal<IDebugger.ISession, IDebugger.ISession.Event>;
296
+ /**
297
+ * Get current exception filter.
298
+ */
299
+ currentExceptionFilters: string[];
300
+ /**
301
+ * Whether the debugger is pausing on exception.
302
+ *
303
+ * @param filter - Specify a filter
304
+ */
305
+ isPausingOnException(filter?: string): boolean;
286
306
  /**
287
307
  * Restore the state of a debug session.
288
308
  */
@@ -564,6 +584,12 @@ export declare namespace IDebugger {
564
584
  interface IInfoReply extends KernelMessage.IInfoReply {
565
585
  debugger: boolean;
566
586
  }
587
+ /**
588
+ * An interface for current exception filters.
589
+ */
590
+ interface IExceptionFilter {
591
+ [kernels: string]: string[];
592
+ }
567
593
  }
568
594
  /**
569
595
  * Select variable in the variables explorer.
package/lib/tokens.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAQ3D,OAAO,EAAsB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAu+B9D;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAAY,gCAAgC,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,sCAAsC,CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC"}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAQ3D,OAAO,EAAsB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAsgC9D;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAAY,gCAAgC,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CACtC,sCAAsC,CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,uCAAuC,CACxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/debugger",
3
- "version": "4.0.0-alpha.16",
3
+ "version": "4.0.0-alpha.18",
4
4
  "description": "JupyterLab - Debugger Extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -41,8 +41,8 @@
41
41
  "build:test": "tsc --build tsconfig.test.json",
42
42
  "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo && rimraf tsconfig.test.tsbuildinfo && rimraf tests/build",
43
43
  "docs": "typedoc --options tdoptions.json --theme ../../typedoc-theme src",
44
- "test": "jest",
45
- "test:cov": "jest --collect-coverage",
44
+ "test": "jest -i",
45
+ "test:cov": "jest -i --collect-coverage",
46
46
  "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
47
47
  "test:debug:watch": "node --inspect-brk node_modules/.bin/jest --runInBand --watch",
48
48
  "watch": "tsc -b --watch"
@@ -50,22 +50,22 @@
50
50
  "dependencies": {
51
51
  "@codemirror/state": "^6.0.0",
52
52
  "@codemirror/view": "^6.0.0",
53
- "@jupyter-notebook/ydoc": "~0.2.0",
54
- "@jupyterlab/application": "^4.0.0-alpha.16",
55
- "@jupyterlab/apputils": "^4.0.0-alpha.16",
56
- "@jupyterlab/cells": "^4.0.0-alpha.16",
57
- "@jupyterlab/codeeditor": "^4.0.0-alpha.16",
58
- "@jupyterlab/codemirror": "^4.0.0-alpha.16",
59
- "@jupyterlab/console": "^4.0.0-alpha.16",
60
- "@jupyterlab/coreutils": "^6.0.0-alpha.16",
61
- "@jupyterlab/docregistry": "^4.0.0-alpha.16",
62
- "@jupyterlab/fileeditor": "^4.0.0-alpha.16",
63
- "@jupyterlab/notebook": "^4.0.0-alpha.16",
64
- "@jupyterlab/observables": "^5.0.0-alpha.16",
65
- "@jupyterlab/rendermime": "^4.0.0-alpha.16",
66
- "@jupyterlab/services": "^7.0.0-alpha.16",
67
- "@jupyterlab/translation": "^4.0.0-alpha.16",
68
- "@jupyterlab/ui-components": "^4.0.0-alpha.31",
53
+ "@jupyter/ydoc": "^0.3.1",
54
+ "@jupyterlab/application": "^4.0.0-alpha.18",
55
+ "@jupyterlab/apputils": "^4.0.0-alpha.18",
56
+ "@jupyterlab/cells": "^4.0.0-alpha.18",
57
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.18",
58
+ "@jupyterlab/codemirror": "^4.0.0-alpha.18",
59
+ "@jupyterlab/console": "^4.0.0-alpha.18",
60
+ "@jupyterlab/coreutils": "^6.0.0-alpha.18",
61
+ "@jupyterlab/docregistry": "^4.0.0-alpha.18",
62
+ "@jupyterlab/fileeditor": "^4.0.0-alpha.18",
63
+ "@jupyterlab/notebook": "^4.0.0-alpha.18",
64
+ "@jupyterlab/observables": "^5.0.0-alpha.18",
65
+ "@jupyterlab/rendermime": "^4.0.0-alpha.18",
66
+ "@jupyterlab/services": "^7.0.0-alpha.18",
67
+ "@jupyterlab/translation": "^4.0.0-alpha.18",
68
+ "@jupyterlab/ui-components": "^4.0.0-alpha.33",
69
69
  "@lumino/algorithm": "^2.0.0-alpha.6",
70
70
  "@lumino/commands": "^2.0.0-alpha.6",
71
71
  "@lumino/coreutils": "^2.0.0-alpha.6",
@@ -76,24 +76,13 @@
76
76
  "@lumino/signaling": "^2.0.0-alpha.6",
77
77
  "@lumino/widgets": "^2.0.0-alpha.6",
78
78
  "@vscode/debugprotocol": "^1.51.0",
79
- "react": "^17.0.1"
79
+ "react": "^18.2.0"
80
80
  },
81
81
  "devDependencies": {
82
- "@babel/core": "^7.10.2",
83
- "@babel/preset-env": "^7.10.2",
84
- "@jupyterlab/testutils": "^4.0.0-alpha.16",
85
- "@types/jest": "^26.0.10",
86
- "@types/react-dom": "^17.0.0",
87
- "@types/text-encoding": "^0.0.35",
82
+ "@jupyterlab/testing": "^4.0.0-alpha.18",
83
+ "@types/jest": "^29.2.0",
88
84
  "canvas": "^2.9.1",
89
- "jest": "^26.4.2",
90
- "jest-junit": "^11.1.0",
91
- "jest-raw-loader": "^1.0.1",
92
- "jest-summary-reporter": "^0.0.2",
93
85
  "rimraf": "~3.0.0",
94
- "shell-quote": "^1.7.2",
95
- "text-encoding": "^0.7.0",
96
- "ts-jest": "^26.3.0",
97
86
  "typedoc": "~0.22.10",
98
87
  "typescript": "~4.7.3"
99
88
  },
@@ -0,0 +1,10 @@
1
+ <svg height="24" width="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
+ <g class="jp-icon3" fill="#616161" transform="matrix(1.1999396,0,0,1.3858273,-2.3726971,-4.6347192)">
3
+ <path
4
+ d="M 12.023438,0.30859375 11.158203,1.8085937 -1.2382812,23.285156 l 26.5292972,-0.002 z m 0.002,3.99999995 9.800781,16.9746093 -19.6015626,0.002 z"
5
+ transform="matrix(0.72509832,0,0,0.7247701,3.2918397,3.480876)"
6
+ />
7
+ <path d="m 11.144475,9.117095 h 1.666751 v 7.215906 h -1.666751 z" />
8
+ <path d="m 11.144475,17.054592 h 1.666751 v 1.443181 h -1.666751 z" />
9
+ </g>
10
+ </svg>
@@ -2,7 +2,6 @@
2
2
  | Copyright (c) Jupyter Development Team.
3
3
  | Distributed under the terms of the Modified BSD License.
4
4
  |----------------------------------------------------------------------------*/
5
-
6
5
  .jp-DebuggerVariables {
7
6
  display: flex;
8
7
  flex-direction: column;
@@ -16,56 +15,96 @@
16
15
  flex: 1 1 auto;
17
16
  min-height: 24px;
18
17
  overflow: auto;
18
+
19
+ /* For absolute positioning of jp-DebuggerVariables-buttons. */
20
+ position: relative;
19
21
  }
20
22
 
21
- .jp-DebuggerVariables-body ul {
23
+ .jp-DebuggerVariables-branch {
22
24
  list-style: none;
23
25
  margin: 0;
24
26
  padding: 0;
25
27
  }
26
28
 
27
- .jp-DebuggerVariables-body > ul {
29
+ .jp-DebuggerVariables-body
30
+ .jp-DebuggerVariables-branch
31
+ .jp-DebuggerVariables-branch {
32
+ grid-area: nested;
33
+ }
34
+
35
+ .jp-DebuggerVariables-body > .jp-DebuggerVariables-branch {
28
36
  padding-top: 0.1em;
29
37
  }
30
38
 
31
- .jp-DebuggerVariables-body ul li {
32
- padding: 5px 0 0;
39
+ .jp-DebuggerVariables-branch li {
40
+ padding: 3px 0;
33
41
  cursor: pointer;
34
42
  color: var(--jp-content-font-color1);
35
- align-items: center;
43
+ display: grid;
44
+ grid-template:
45
+ 'collapser name detail'
46
+ 'nested nested nested';
47
+ grid-template-columns: max-content max-content 1fr;
36
48
  }
37
49
 
38
- .jp-DebuggerVariables-body ul li:hover .jp-DebuggerVariables-renderVariable {
39
- display: inline-block;
50
+ .jp-DebuggerVariables-branch li:not(:has(li:hover)):hover {
51
+ background: var(--jp-layout-color2);
40
52
  }
41
53
 
42
- .jp-DebuggerVariables-body .jp-DebuggerVariables-hspacer {
43
- flex: 1 1 auto;
54
+ .jp-DebuggerVariables-collapser {
55
+ width: 16px;
56
+ grid-area: collapser;
57
+ transform: rotate(-90deg);
58
+ transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
59
+ }
60
+
61
+ .jp-DebuggerVariables-collapser.jp-mod-expanded {
62
+ transform: rotate(0);
63
+ }
64
+
65
+ .jp-DebuggerVariables-buttons {
66
+ position: absolute;
67
+ top: 0;
68
+ right: 8px;
69
+ margin-top: 1px;
70
+ }
71
+
72
+ .jp-DebuggerVariables-name {
73
+ color: var(--jp-mirror-editor-attribute-color);
74
+ grid-area: name;
75
+ }
76
+
77
+ .jp-DebuggerVariables-name::after {
78
+ content: ':';
79
+ margin-right: 5px;
80
+ }
81
+
82
+ .jp-DebuggerVariables-detail {
83
+ /* detail contains value for primitive types or name of the type otherwise */
84
+ color: var(--jp-mirror-editor-string-color);
44
85
  }
45
86
 
46
- .jp-DebuggerVariables-body .jp-DebuggerVariables-renderVariable {
47
- flex: 0 0 auto;
87
+ .jp-DebuggerVariables-renderVariable {
48
88
  border: none;
49
89
  background: none;
50
90
  cursor: pointer;
51
- display: none;
52
- padding: 0 8px;
91
+ transform-origin: center center;
92
+ transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1);
53
93
  }
54
94
 
55
- .jp-DebuggerVariables-body .jp-DebuggerVariables-renderVariable:active {
56
- transform: scale(1.272) translateX(-4px);
57
- overflow: hidden;
95
+ .jp-DebuggerVariables-renderVariable:active {
96
+ transform: scale(1.35);
58
97
  }
59
98
 
60
- .jp-DebuggerVariables-body .jp-DebuggerVariables-renderVariable:hover {
99
+ .jp-DebuggerVariables-renderVariable:hover {
61
100
  background-color: var(--jp-layout-color2);
62
101
  }
63
102
 
64
- .jp-DebuggerVariables-body .jp-DebuggerVariables-renderVariable:disabled {
103
+ .jp-DebuggerVariables-renderVariable:disabled {
65
104
  cursor: default;
66
105
  }
67
106
 
68
- .jp-DebuggerVariables-body ul li > ul {
107
+ .jp-DebuggerVariables-branch li > .jp-DebuggerVariables-branch {
69
108
  margin-left: 12px;
70
109
  }
71
110