Comments (14)
Can you try evaluating a string in the Debug Console and show me the result?
from vscode-debug-visualizer.
Here’s my code:
let s = "This is a string"
print(s)
I put a breakpoint on the first line. After the debugger passed the first line then I typed p s
on the Debug Console. Here’s the result:
p s
(String) $R0 = "This is a string"
Module loaded: __lldb_dlopen_wrapper.
Module loaded: __lldb_caller_function.
Module loaded: /usr/lib/swift/libswiftSwiftOnoneSupport.dylib. Symbols loaded.
Is that you want?
from vscode-debug-visualizer.
Hmm, thats quite verbose. What do you see when watching that variable in the watch window?
Can you use a string with problemantic characters? (\n
or "
)
from vscode-debug-visualizer.
Hmm, thats quite verbose. What do you see when watching that variable in the watch window?
I saw This is a string
, obviously.
Can you use a string with problemantic characters? (\n or “)
Of course. I can debug any kind of string combination, including emoji, on VS Code using CodeLLDB.
The problem is, your extension failed to show the value, not the debugger.
from vscode-debug-visualizer.
The problem is, your extension failed to show the value, not the debugger.
Thank you for clarifying that.
I saw
This is a string
, obviously.
You might reconsider what you think is obvious
and you should sharpen your understanding of details.
If (String) $R0 = "This is a string"
was the result of the evaluation, my extension could never guess the actual start of the string content due to the (String) $R0 =
prefix.
Now you say the result in the watch window is This is a string
(which is a different from (String) $R0 = "This is a string"
- clearly, the Swift debug adapter formats the output of an evaluation request differently in watch mode and debug console mode, which all the debug adapters I tested don't do).
Also, I still don't know how the string is escaped. Is the output exactly This is a string
? or "This is a string"
? What happens with line breaks or double quotes inside the string? Are they escaped or not?
My extension tries to parse the output of the debug adapter. Every debug adapter slightly differs in how the string is escaped.
from vscode-debug-visualizer.
In the debugger panel, it’s printed as “This is a string”
(with the double quote) to indicate that it’s a string, I think. But on the Terminal, it’s printed as This is a string
(without the double quote).
I don’t quite understand how the debugger formats the output. What is the debugger extension you’re using on your VS Code?
from vscode-debug-visualizer.
What is the debugger extension you’re using on your VS Code?
I use node
or chrome
and they don't escape the string. If you use CodeLLDB, escaping should work, i.e. you can just visualize an expression that evaluates to a json string matching the schema of one of the visualizers.
from vscode-debug-visualizer.
you can just visualize an expression that evaluates to a json string matching the schema of one of the visualizers.
And how to do that? Every time I put a string variable I wanted to evaluate into the visualizer, it shows this error:
Error: Could not parse `<value>` as JSON. Unexpected token s in JSON at position 0
What should I do?
from vscode-debug-visualizer.
Is <value>
valid json? It must be.
from vscode-debug-visualizer.
It’s just the "This is a string
" I mentioned above.
from vscode-debug-visualizer.
As I mentioned before, the string needs to be json. This is a string
is not json.
from vscode-debug-visualizer.
As I asked before, how to do that? I’ve tried the Text
interface and it failed too. I forgot the error message because I’m not in front of my laptop now. The point is, this extension wouldn’t work out of the box with unsupported languages.
from vscode-debug-visualizer.
You do that by serializing a json object and storing the result in a string. What do you mean with "I've tried the text interface"? I'll try to improve the error messages. But it does work out of the box with a lot of languages like Java of C# that also don't have built in support.
Try visualizing this expression:
"{\"kind\":{\"graph\":true},\"nodes\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"edges\":[{\"from\":\"1\",\"to\":\"2\"}]}"
from vscode-debug-visualizer.
I verified that this extension works with swift, using the lldb debugger:
You can find the demo here.
from vscode-debug-visualizer.
Related Issues (20)
- Can you support idea plugIn
- CPP does not wqork HOT 1
- Missing support for "gdb" debug adapter
- https://github.com/hediet/vscode-debug-visualizer
- Visualization in python
- Publish `Debug Visualizer` to Open VSX
- Overcome python debug adapter's string truncation limit HOT 10
- Please create and example in C HOT 1
- Is not working for dart language
- No able to run Debug visualizer
- `yarn build` fails on most recent commit HOT 2
- C# debugger has a very low (1024 chars) JSON length limit HOT 13
- Unable to show geometries data HOT 2
- Short choice of visualisers HOT 7
- How do you visualize an array as like a literal table, rather than a graph? HOT 1
- Version bump
- Python Visualizer is cluttered
- Unable to get the grid visualisation in python demo HOT 1
- Error: Could not parse evaluation result as JSON: Unexpected token 'U', "Usage: -Us"... is not valid JSON HOT 1
- Error: Vizualising the json of C++ graph view is failing HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-debug-visualizer.