Skip to content

Commit 683f1e1

Browse files
committed
Updates readme.
1 parent f2b4f62 commit 683f1e1

File tree

1 file changed

+62
-59
lines changed

1 file changed

+62
-59
lines changed

extension/README.md

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -112,68 +112,71 @@ Also, a global object of name `hedietDbgVis` with helper functions is injected.
112112

113113
This extension provides these configuration options:
114114

115-
- `debugVisualizer.debugAdapterConfigurations`
115+
### **debugVisualizer.debugAdapterConfigurations**
116116

117-
Allows to set expression templates for specific debug adapter types.
118-
Example:
117+
Allows to set expression templates for specific debug adapter types.
118+
Example:
119119

120-
```json
121-
"debugVisualizer.debugAdapterConfigurations": {
122-
"lldb": {
123-
"expressionTemplate": "script to_json(\"${expr}\")",
124-
"context": "repl"
125-
}
120+
```json
121+
"debugVisualizer.debugAdapterConfigurations": {
122+
"lldb": {
123+
"expressionTemplate": "script to_json(\"${expr}\")",
124+
"context": "repl"
126125
}
127-
```
128-
129-
Configurations here overwrite the built-in support for the corresponding debug adapter type.
130-
131-
- `debugVisualizer.useChromeKioskMode`
132-
133-
Specifies whether to pop out Debug Visualization Views with Chrome in Kiosk Mode. Uses the default browser otherwise or if Chrome is not found. Defaults to `true`.
134-
135-
- `debugVisualizer.js.customScriptPaths`
136-
137-
Specifies a list of JavaScript files that are injected into the debugee when debugging JavaScript.
138-
Each script must assign `module.exports` with a function of type `import("@hediet/debug-visualizer-data-extraction").LoadDataExtractorsFn`.
139-
Paths must be absolute and can use the variable `${workspaceFolder}`.
140-
Scripts are automatically reloaded when they are changed.
141-
142-
Example:
143-
144-
```js
145-
// @ts-check
146-
/**
147-
* @type {import("@hediet/debug-visualizer-data-extraction").LoadDataExtractorsFn}
148-
*/
149-
module.exports = (register, helpers) => {
150-
register({
151-
id: "map",
152-
getExtractions(data, collector, context) {
153-
if (!(data instanceof Map)) {
154-
return;
155-
}
156-
157-
collector.addExtraction({
158-
priority: 1000,
159-
id: "map",
160-
name: "Map",
161-
extractData() {
162-
return helpers.asData({
163-
kind: { table: true },
164-
rows: [...data].map(([k, v]) => ({
165-
key: k,
166-
value: v,
167-
})),
168-
});
169-
},
170-
});
171-
},
172-
});
173-
};
174-
```
175-
176-
![](../docs/custom-script-map.png)
126+
}
127+
```
128+
129+
Configurations here overwrite the built-in support for the corresponding debug adapter type.
130+
131+
### **debugVisualizer.useChromeKioskMode**
132+
133+
Specifies whether to pop out Debug Visualization Views with Chrome in Kiosk Mode. Uses the default browser otherwise or if Chrome is not found. Defaults to `true`.
134+
135+
### **debugVisualizer.js.customScriptPaths**
136+
137+
Specifies a list of JavaScript files that are injected into the debugee when debugging JavaScript.
138+
Each script must assign `module.exports` with a function of type `import("@hediet/debug-visualizer-data-extraction").LoadDataExtractorsFn`.
139+
Paths must be absolute and can use the variable `${workspaceFolder}`.
140+
Scripts are automatically reloaded when they are changed.
141+
142+
Example:
143+
144+
```js
145+
// @ts-check
146+
/**
147+
* @type {import("@hediet/debug-visualizer-data-extraction").LoadDataExtractorsFn}
148+
*/
149+
module.exports = (register, helpers) => {
150+
register({
151+
id: "map",
152+
getExtractions(data, collector, context) {
153+
if (!(data instanceof Map)) {
154+
return;
155+
}
156+
157+
collector.addExtraction({
158+
priority: 1000,
159+
id: "map",
160+
name: "Map",
161+
extractData() {
162+
return helpers.asData({
163+
kind: { table: true },
164+
rows: [...data].map(([k, v]) => ({
165+
key: k,
166+
value: v,
167+
})),
168+
});
169+
},
170+
});
171+
},
172+
});
173+
};
174+
```
175+
176+
![](../docs/custom-script-map.png)
177+
178+
Use the `helpers` object to access some magic functions.
179+
`helpers.find(val => ...)` can be used to find an object that is reachable by any variable in scope.
177180

178181
# See Also
179182

0 commit comments

Comments
 (0)