|
1 |
| -import { DataExtractionResult, DataExtractorId, DataResult } from "@hediet/debug-visualizer-data-extraction"; |
| 1 | +import { DataExtractionResult, DataResult } from "@hediet/debug-visualizer-data-extraction"; |
2 | 2 | import { hotClass, registerUpdateReconciler } from "@hediet/node-reload";
|
3 | 3 | import { Config } from "../Config";
|
4 | 4 | import { DebuggerViewProxy } from "../proxies/DebuggerViewProxy";
|
@@ -96,9 +96,10 @@ class RbVisualizationBackend extends VisualizationBackendBase {
|
96 | 96 | }
|
97 | 97 | };
|
98 | 98 | }
|
99 |
| - |
100 |
| - const wrappedExpr = await this._getExpression(preferredExtractorId || '', expression, frameId); |
101 |
| - |
| 99 | + const preferredId = preferredExtractorId || ''; |
| 100 | + const wrappedExpr = ` |
| 101 | + DebugVisualizer.to_debug_visualizer_protocol_json("${preferredId}", ${expression}) |
| 102 | + `; |
102 | 103 | const reply = await this.debugSession.evaluate({
|
103 | 104 | expression: wrappedExpr,
|
104 | 105 | frameId,
|
@@ -138,21 +139,4 @@ class RbVisualizationBackend extends VisualizationBackendBase {
|
138 | 139 | };
|
139 | 140 | }
|
140 | 141 | }
|
141 |
| - |
142 |
| - private async _getExpression(preferredId: string | DataExtractorId, expression: string, frameId: number | undefined) { |
143 |
| - // From version 1.7, `::DEBUGGER__::NaiveString` class is introduced to get whole body of String. |
144 |
| - // https://github.com/ruby/debug/commit/2f510f0ed685da2f78b370fb8898ffbd2a4f1cf7 |
145 |
| - const reply = await this.debugSession.evaluate({ |
146 |
| - expression: "defined? ::DEBUGGER__::NaiveString", |
147 |
| - frameId, |
148 |
| - context: this.defaultContext |
149 |
| - }); |
150 |
| - const wrappedExpr = `DebugVisualizer.to_debug_visualizer_protocol_json("${preferredId}", ${expression})`; |
151 |
| - // Because reply.result is '"constant"', we use includes method here. |
152 |
| - if (reply.result.includes('constant')) { |
153 |
| - return `::DEBUGGER__::NaiveString.new(${wrappedExpr})`; |
154 |
| - } else { |
155 |
| - return wrappedExpr; |
156 |
| - } |
157 |
| - } |
158 | 142 | }
|
0 commit comments