@theia/debug 1.22.1 → 1.23.0-next.26

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.
Files changed (119) hide show
  1. package/lib/browser/breakpoint/breakpoint-manager.d.ts +2 -2
  2. package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -1
  3. package/lib/browser/breakpoint/breakpoint-manager.js +2 -2
  4. package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
  5. package/lib/browser/console/debug-console-contribution.d.ts +2 -3
  6. package/lib/browser/console/debug-console-contribution.d.ts.map +1 -1
  7. package/lib/browser/console/debug-console-contribution.js +24 -20
  8. package/lib/browser/console/debug-console-contribution.js.map +1 -1
  9. package/lib/browser/console/debug-console-session.d.ts +5 -1
  10. package/lib/browser/console/debug-console-session.d.ts.map +1 -1
  11. package/lib/browser/console/debug-console-session.js +37 -6
  12. package/lib/browser/console/debug-console-session.js.map +1 -1
  13. package/lib/browser/debug-configuration-manager.js +14 -14
  14. package/lib/browser/debug-configuration-manager.js.map +1 -1
  15. package/lib/browser/debug-frontend-application-contribution.js +29 -29
  16. package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
  17. package/lib/browser/debug-frontend-module.js +5 -5
  18. package/lib/browser/debug-frontend-module.js.map +1 -1
  19. package/lib/browser/debug-keybinding-contexts.js +5 -5
  20. package/lib/browser/debug-keybinding-contexts.js.map +1 -1
  21. package/lib/browser/debug-monaco-contribution.js +1 -1
  22. package/lib/browser/debug-monaco-contribution.js.map +1 -1
  23. package/lib/browser/debug-preferences.js +1 -1
  24. package/lib/browser/debug-preferences.js.map +1 -1
  25. package/lib/browser/debug-prefix-configuration.js +13 -13
  26. package/lib/browser/debug-prefix-configuration.js.map +1 -1
  27. package/lib/browser/debug-resource.js +2 -2
  28. package/lib/browser/debug-resource.js.map +1 -1
  29. package/lib/browser/debug-schema-updater.js +6 -6
  30. package/lib/browser/debug-schema-updater.js.map +1 -1
  31. package/lib/browser/debug-session-contribution.js +16 -16
  32. package/lib/browser/debug-session-contribution.js.map +1 -1
  33. package/lib/browser/debug-session-manager.js +16 -16
  34. package/lib/browser/debug-session-manager.js.map +1 -1
  35. package/lib/browser/debug-session.d.ts +5 -0
  36. package/lib/browser/debug-session.d.ts.map +1 -1
  37. package/lib/browser/debug-session.js +16 -1
  38. package/lib/browser/debug-session.js.map +1 -1
  39. package/lib/browser/debug-tab-bar-decorator.js +3 -3
  40. package/lib/browser/debug-tab-bar-decorator.js.map +1 -1
  41. package/lib/browser/debug-watch-manager.js +2 -2
  42. package/lib/browser/debug-watch-manager.js.map +1 -1
  43. package/lib/browser/editor/debug-breakpoint-widget.d.ts.map +1 -1
  44. package/lib/browser/editor/debug-breakpoint-widget.js +4 -4
  45. package/lib/browser/editor/debug-breakpoint-widget.js.map +1 -1
  46. package/lib/browser/editor/debug-editor-model.js +12 -12
  47. package/lib/browser/editor/debug-editor-model.js.map +1 -1
  48. package/lib/browser/editor/debug-editor-service.js +7 -7
  49. package/lib/browser/editor/debug-editor-service.js.map +1 -1
  50. package/lib/browser/editor/debug-exception-widget.js +3 -3
  51. package/lib/browser/editor/debug-exception-widget.js.map +1 -1
  52. package/lib/browser/editor/debug-expression-provider.js +1 -1
  53. package/lib/browser/editor/debug-expression-provider.js.map +1 -1
  54. package/lib/browser/editor/debug-hover-source.js +2 -2
  55. package/lib/browser/editor/debug-hover-source.js.map +1 -1
  56. package/lib/browser/editor/debug-hover-widget.js +6 -6
  57. package/lib/browser/editor/debug-hover-widget.js.map +1 -1
  58. package/lib/browser/editor/debug-inline-value-decorator.js +3 -3
  59. package/lib/browser/editor/debug-inline-value-decorator.js.map +1 -1
  60. package/lib/browser/model/debug-breakpoint.d.ts.map +1 -1
  61. package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -1
  62. package/lib/browser/view/debug-action.js +1 -1
  63. package/lib/browser/view/debug-action.js.map +1 -1
  64. package/lib/browser/view/debug-breakpoints-source.js +4 -4
  65. package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
  66. package/lib/browser/view/debug-breakpoints-widget.js +5 -5
  67. package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
  68. package/lib/browser/view/debug-configuration-widget.d.ts.map +1 -1
  69. package/lib/browser/view/debug-configuration-widget.js +8 -8
  70. package/lib/browser/view/debug-configuration-widget.js.map +1 -1
  71. package/lib/browser/view/debug-session-widget.js +12 -12
  72. package/lib/browser/view/debug-session-widget.js.map +1 -1
  73. package/lib/browser/view/debug-stack-frames-source.js +3 -3
  74. package/lib/browser/view/debug-stack-frames-source.js.map +1 -1
  75. package/lib/browser/view/debug-stack-frames-widget.js +5 -5
  76. package/lib/browser/view/debug-stack-frames-widget.js.map +1 -1
  77. package/lib/browser/view/debug-threads-source.js +3 -3
  78. package/lib/browser/view/debug-threads-source.js.map +1 -1
  79. package/lib/browser/view/debug-threads-widget.js +5 -5
  80. package/lib/browser/view/debug-threads-widget.js.map +1 -1
  81. package/lib/browser/view/debug-toolbar-widget.js +3 -3
  82. package/lib/browser/view/debug-toolbar-widget.js.map +1 -1
  83. package/lib/browser/view/debug-variables-source.js +3 -3
  84. package/lib/browser/view/debug-variables-source.js.map +1 -1
  85. package/lib/browser/view/debug-variables-widget.js +4 -4
  86. package/lib/browser/view/debug-variables-widget.js.map +1 -1
  87. package/lib/browser/view/debug-view-model.js +6 -6
  88. package/lib/browser/view/debug-view-model.js.map +1 -1
  89. package/lib/browser/view/debug-watch-source.js +3 -3
  90. package/lib/browser/view/debug-watch-source.js.map +1 -1
  91. package/lib/browser/view/debug-watch-widget.js +4 -4
  92. package/lib/browser/view/debug-watch-widget.js.map +1 -1
  93. package/lib/browser/view/debug-widget.js +8 -8
  94. package/lib/browser/view/debug-widget.js.map +1 -1
  95. package/lib/common/debug-common.js +1 -1
  96. package/lib/node/debug-adapter-contribution-registry.js +3 -3
  97. package/lib/node/debug-adapter-contribution-registry.js.map +1 -1
  98. package/lib/node/debug-adapter-factory.js +4 -4
  99. package/lib/node/debug-adapter-factory.js.map +1 -1
  100. package/lib/node/debug-adapter-session-manager.js +3 -3
  101. package/lib/node/debug-adapter-session-manager.js.map +1 -1
  102. package/lib/node/debug-adapter-session.js.map +1 -1
  103. package/lib/node/debug-backend-module.js +1 -1
  104. package/lib/node/debug-backend-module.js.map +1 -1
  105. package/lib/node/debug-service-impl.js +3 -3
  106. package/lib/node/debug-service-impl.js.map +1 -1
  107. package/lib/node/stream-debug-adapter.js.map +1 -1
  108. package/lib/node/vscode/vscode-debug-adapter-contribution.js +4 -4
  109. package/lib/node/vscode/vscode-debug-adapter-contribution.js.map +1 -1
  110. package/package.json +16 -16
  111. package/src/browser/console/debug-console-contribution.tsx +16 -13
  112. package/src/browser/console/debug-console-session.ts +36 -5
  113. package/src/browser/debug-session.tsx +16 -1
  114. package/src/browser/style/index.css +1 -1
  115. package/lib/node/inline-debug-adapter.d.ts +0 -34
  116. package/lib/node/inline-debug-adapter.d.ts.map +0 -1
  117. package/lib/node/inline-debug-adapter.js +0 -45
  118. package/lib/node/inline-debug-adapter.js.map +0 -1
  119. package/src/node/inline-debug-adapter.ts +0 -47
@@ -24,9 +24,8 @@ import { Command, CommandRegistry } from '@theia/core/lib/common/command';
24
24
  import { Severity } from '@theia/core/lib/common/severity';
25
25
  import { inject, injectable, interfaces, postConstruct } from '@theia/core/shared/inversify';
26
26
  import * as React from '@theia/core/shared/react';
27
- import { DebugConsoleMode } from '../../common/debug-configuration';
28
27
  import { DebugSession } from '../debug-session';
29
- import { DebugSessionManager } from '../debug-session-manager';
28
+ import { DebugSessionManager, DidChangeActiveDebugSession } from '../debug-session-manager';
30
29
  import { DebugConsoleSession, DebugConsoleSessionFactory } from './debug-console-session';
31
30
 
32
31
  export type InDebugReplContextKey = ContextKey<boolean>;
@@ -71,9 +70,9 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
71
70
  @postConstruct()
72
71
  protected init(): void {
73
72
  this.debugSessionManager.onDidCreateDebugSession(session => {
74
- const topParent = this.findParentSession(session);
75
- if (topParent) {
76
- const parentConsoleSession = this.consoleSessionManager.get(topParent.id);
73
+ const consoleParent = session.findConsoleParent();
74
+ if (consoleParent) {
75
+ const parentConsoleSession = this.consoleSessionManager.get(consoleParent.id);
77
76
  if (parentConsoleSession instanceof DebugConsoleSession) {
78
77
  session.on('output', event => parentConsoleSession.logOutput(parentConsoleSession.debugSession, event));
79
78
  }
@@ -83,20 +82,24 @@ export class DebugConsoleContribution extends AbstractViewContribution<ConsoleWi
83
82
  session.on('output', event => consoleSession.logOutput(session, event));
84
83
  }
85
84
  });
85
+ this.debugSessionManager.onDidChangeActiveDebugSession(event => this.handleActiveDebugSessionChanged(event));
86
86
  this.debugSessionManager.onDidDestroyDebugSession(session => {
87
87
  this.consoleSessionManager.delete(session.id);
88
88
  });
89
89
  }
90
90
 
91
- protected findParentSession(session: DebugSession): DebugSession | undefined {
92
- if (session.configuration.consoleMode !== DebugConsoleMode.MergeWithParent) {
93
- return undefined;
91
+ protected handleActiveDebugSessionChanged(event: DidChangeActiveDebugSession): void {
92
+ if (!event.current) {
93
+ this.consoleSessionManager.selectedSession = undefined;
94
+ } else {
95
+ const topSession = event.current.findConsoleParent() || event.current;
96
+ const consoleSession = topSession ? this.consoleSessionManager.get(topSession.id) : undefined;
97
+ this.consoleSessionManager.selectedSession = consoleSession;
98
+ const consoleSelector = document.getElementById('debugConsoleSelector');
99
+ if (consoleSession && consoleSelector instanceof HTMLSelectElement) {
100
+ consoleSelector.value = consoleSession.id;
101
+ }
94
102
  }
95
- let debugSession: DebugSession | undefined = session;
96
- do {
97
- debugSession = debugSession.parentSession;
98
- } while (debugSession?.parentSession && debugSession.configuration.consoleMode === DebugConsoleMode.MergeWithParent);
99
- return debugSession;
100
103
  }
101
104
 
102
105
  registerCommands(commands: CommandRegistry): void {
@@ -22,7 +22,8 @@ import { DebugSession } from '../debug-session';
22
22
  import URI from '@theia/core/lib/common/uri';
23
23
  import { ExpressionContainer, ExpressionItem } from './debug-console-items';
24
24
  import { Severity } from '@theia/core/lib/common/severity';
25
- import { injectable, postConstruct } from '@theia/core/shared/inversify';
25
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
26
+ import { DebugSessionManager } from '../debug-session-manager';
26
27
 
27
28
  export const DebugConsoleSessionFactory = Symbol('DebugConsoleSessionFactory');
28
29
 
@@ -33,6 +34,8 @@ export class DebugConsoleSession extends ConsoleSession {
33
34
 
34
35
  static uri = new URI().withScheme('debugconsole');
35
36
 
37
+ @inject(DebugSessionManager) protected readonly sessionManager: DebugSessionManager;
38
+
36
39
  protected items: ConsoleItem[] = [];
37
40
 
38
41
  protected _debugSession: DebugSession;
@@ -86,20 +89,48 @@ export class DebugConsoleSession extends ConsoleSession {
86
89
  }
87
90
 
88
91
  protected async completions(model: monaco.editor.ITextModel, position: monaco.Position): Promise<monaco.languages.CompletionList | undefined> {
89
- const session = this.debugSession;
90
- if (session && session.capabilities.supportsCompletionsRequest) {
92
+ const completionSession = this.findCompletionSession();
93
+ if (completionSession) {
91
94
  const column = position.column;
92
95
  const lineNumber = position.lineNumber;
93
96
  const word = model.getWordAtPosition({ column, lineNumber });
94
97
  const overwriteBefore = word ? word.word.length : 0;
95
98
  const text = model.getValue();
96
- const items = await session.completions(text, column, lineNumber);
99
+ const items = await completionSession.completions(text, column, lineNumber);
97
100
  const suggestions = items.map(item => this.asCompletionItem(text, position, overwriteBefore, item));
98
101
  return { suggestions };
99
102
  }
100
103
  return undefined;
101
104
  }
102
105
 
106
+ protected findCurrentSession(): DebugSession | undefined {
107
+ const currentSession = this.sessionManager.currentSession;
108
+ if (!currentSession) {
109
+ return undefined;
110
+ }
111
+ if (currentSession.id === this.debugSession.id) {
112
+ // perfect match
113
+ return this.debugSession;
114
+ }
115
+ const parentSession = currentSession.findConsoleParent();
116
+ if (parentSession?.id === this.debugSession.id) {
117
+ // child of our session
118
+ return currentSession;
119
+ }
120
+ return undefined;
121
+ }
122
+
123
+ protected findCompletionSession(): DebugSession | undefined {
124
+ let completionSession: DebugSession | undefined = this.findCurrentSession();
125
+ while (completionSession !== undefined) {
126
+ if (completionSession.capabilities.supportsCompletionsRequest) {
127
+ return completionSession;
128
+ }
129
+ completionSession = completionSession.parentSession;
130
+ }
131
+ return completionSession;
132
+ }
133
+
103
134
  protected asCompletionItem(text: string, position: monaco.Position, overwriteBefore: number, item: DebugProtocol.CompletionItem): monaco.languages.CompletionItem {
104
135
  return {
105
136
  label: item.label,
@@ -112,7 +143,7 @@ export class DebugConsoleSession extends ConsoleSession {
112
143
  }
113
144
 
114
145
  async execute(value: string): Promise<void> {
115
- const expression = new ExpressionItem(value, () => this.debugSession);
146
+ const expression = new ExpressionItem(value, () => this.findCurrentSession());
116
147
  this.items.push(expression);
117
148
  await expression.evaluate();
118
149
  this.fireDidChange();
@@ -34,7 +34,7 @@ import debounce = require('p-debounce');
34
34
  import URI from '@theia/core/lib/common/uri';
35
35
  import { BreakpointManager } from './breakpoint/breakpoint-manager';
36
36
  import { DebugSessionOptions, InternalDebugSessionOptions } from './debug-session-options';
37
- import { DebugConfiguration } from '../common/debug-common';
37
+ import { DebugConfiguration, DebugConsoleMode } from '../common/debug-common';
38
38
  import { SourceBreakpoint, ExceptionBreakpoint } from './breakpoint/breakpoint-marker';
39
39
  import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
40
40
  import { DebugFunctionBreakpoint } from './model/debug-function-breakpoint';
@@ -817,4 +817,19 @@ export class DebugSession implements CompositeTreeElement {
817
817
  contrib.register(configType, connection);
818
818
  }
819
819
  };
820
+
821
+ /**
822
+ * Returns the top-most parent session that is responsible for the console. If this session uses a {@link DebugConsoleMode.Separate separate console}
823
+ * or does not have any parent session, undefined is returned.
824
+ */
825
+ public findConsoleParent(): DebugSession | undefined {
826
+ if (this.configuration.consoleMode !== DebugConsoleMode.MergeWithParent) {
827
+ return undefined;
828
+ }
829
+ let debugSession: DebugSession | undefined = this;
830
+ do {
831
+ debugSession = this.parentSession;
832
+ } while (debugSession?.parentSession && debugSession.configuration.consoleMode === DebugConsoleMode.MergeWithParent);
833
+ return debugSession;
834
+ }
820
835
  }
@@ -286,7 +286,7 @@
286
286
  background: url('breakpoint-log.svg') center center no-repeat;
287
287
  }
288
288
  .theia-debug-logpoint-disabled,
289
- .monaco-editor .theia-debug-breakpoint-column.theia-debug-logpoint-disabled-columne {
289
+ .monaco-editor .theia-debug-breakpoint-column.theia-debug-logpoint-disabled-column {
290
290
  background: url('breakpoint-log-disabled.svg') center center no-repeat;
291
291
  }
292
292
  .theia-debug-logpoint-unverified,
@@ -1,34 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Red Hat, Inc. and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- import { Event } from '@theia/core/lib/common/event';
17
- import { DebugAdapter } from './debug-model';
18
- import * as theia from '@theia/plugin';
19
- /**
20
- * A debug adapter for using the inline implementation from a plugin.
21
- */
22
- export declare class InlineDebugAdapter implements DebugAdapter {
23
- private debugAdapter;
24
- private messageReceivedEmitter;
25
- onMessageReceived: Event<string>;
26
- onError: Event<Error>;
27
- private closeEmitter;
28
- onClose: Event<void>;
29
- constructor(debugAdapter: theia.DebugAdapter);
30
- start(): Promise<void>;
31
- send(message: string): void;
32
- stop(): Promise<void>;
33
- }
34
- //# sourceMappingURL=inline-debug-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-debug-adapter.d.ts","sourceRoot":"","sources":["../../src/node/inline-debug-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAW,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IAOvC,OAAO,CAAC,YAAY;IANhC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAqC;IACrE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAc;IACnC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAA2B;gBAE3B,YAAY,EAAE,KAAK,CAAC,YAAY;IAM9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAG5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (C) 2021 Red Hat, Inc. and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.InlineDebugAdapter = void 0;
19
- const event_1 = require("@theia/core/lib/common/event");
20
- /**
21
- * A debug adapter for using the inline implementation from a plugin.
22
- */
23
- class InlineDebugAdapter {
24
- constructor(debugAdapter) {
25
- this.debugAdapter = debugAdapter;
26
- this.messageReceivedEmitter = new event_1.Emitter();
27
- this.onMessageReceived = this.messageReceivedEmitter.event;
28
- this.onError = event_1.Event.None;
29
- this.closeEmitter = new event_1.Emitter();
30
- this.onClose = this.closeEmitter.event;
31
- this.debugAdapter.onDidSendMessage(msg => {
32
- this.messageReceivedEmitter.fire(JSON.stringify(msg));
33
- });
34
- }
35
- async start() {
36
- }
37
- send(message) {
38
- this.debugAdapter.handleMessage(JSON.parse(message));
39
- }
40
- async stop() {
41
- this.debugAdapter.dispose();
42
- }
43
- }
44
- exports.InlineDebugAdapter = InlineDebugAdapter;
45
- //# sourceMappingURL=inline-debug-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-debug-adapter.js","sourceRoot":"","sources":["../../src/node/inline-debug-adapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,wDAA8D;AAI9D;;GAEG;AACH,MAAa,kBAAkB;IAO3B,YAAoB,YAAgC;QAAhC,iBAAY,GAAZ,YAAY,CAAoB;QAN5C,2BAAsB,GAAG,IAAI,eAAO,EAAU,CAAC;QACvD,sBAAiB,GAAkB,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QACrE,YAAO,GAAiB,aAAK,CAAC,IAAI,CAAC;QAC3B,iBAAY,GAAG,IAAI,eAAO,EAAQ,CAAC;QAC3C,YAAO,GAAgB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAG3C,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE;YACrC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,KAAK;IACX,CAAC;IAED,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,IAAI;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACJ;AAvBD,gDAuBC"}
@@ -1,47 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Red Hat, Inc. and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- import { Emitter, Event } from '@theia/core/lib/common/event';
18
- import { DebugAdapter } from './debug-model';
19
- import * as theia from '@theia/plugin';
20
-
21
- /**
22
- * A debug adapter for using the inline implementation from a plugin.
23
- */
24
- export class InlineDebugAdapter implements DebugAdapter {
25
- private messageReceivedEmitter = new Emitter<string>();
26
- onMessageReceived: Event<string> = this.messageReceivedEmitter.event;
27
- onError: Event<Error> = Event.None;
28
- private closeEmitter = new Emitter<void>();
29
- onClose: Event<void> = this.closeEmitter.event;
30
-
31
- constructor(private debugAdapter: theia.DebugAdapter) {
32
- this.debugAdapter.onDidSendMessage(msg => {
33
- this.messageReceivedEmitter.fire(JSON.stringify(msg));
34
- });
35
- }
36
-
37
- async start(): Promise<void> {
38
- }
39
-
40
- send(message: string): void {
41
- this.debugAdapter.handleMessage(JSON.parse(message));
42
- }
43
-
44
- async stop(): Promise<void> {
45
- this.debugAdapter.dispose();
46
- }
47
- }