3 ms·
Thanks, that works. I can put something simple in my settings.json like this "debugVisualizer.debugAdapterConfigurations": { "Ruby": { "expressionT
by daviding 6y ago
Thanks, that works. I can put something simple in my settings.json like this
"debugVisualizer.debugAdapterConfigurations": {
"Ruby": {
"expressionTemplate": "DataExtractor.to_table(${expr})",
}
},
..and something simple in the debugee like this..
table_example =
{"id"=> "1", "label"=> "One"},
{"id"=> "2", "label"=> "Two"},
{"id"=> "3", "label"=> "Three"}
# Quick hash to visual table helper
class DataExtractor
def self.to_table(hash)
meta_hash = {
"kind" => {"table"=> true},
"rows"=> hash
}
meta_hash.to_json
end
end
..and we get a decent hash or ActiveRecord visualizer. Thanks for the hint.
- Gehinnn 6y agoData Extractors would also allow to offer alternative extraction options (like how visualization data should be constructed from the given value). The user can then select an alternative data extractor. The `expressionTemplate` does not allow to do that yet. If somebody is interested in implementing data extractors for Ruby, I can offer help!
- jonnytran 6y agoCan you point us to where the existing extractors are implemented in the codebase?
- Gehinnn 6y agoIn case of javascript, the data extractor runtime is injected into the debuggee at [1]. You can find the data extractor runtime implementation at [2]. [1] https://github.com/hediet/vscode-debug-visualizer/blob/c420ff7f6f42a55ee3692016df3ffd7a5d29402b/extension/src/EvaluationWatchService/EvaluationEngine/JsEvaluationEngine.ts#L126 https://github.com/hediet/vscode-debug-visualizer/blob/c420f... [2] https://github.com/hediet/vscode-debug-visualizer/blob/master/data-extraction/src/js/api/DataExtractorApiImpl.ts https://github.com/hediet/vscode-debug-visualizer/blob/maste...
- deleted 6y ago[deleted]