Comments (15)
Can you try out to visualize this expression:
""{\"kind\":{\"graph\":true},\"nodes\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"edges\":[{\"from\":\"1\",\"to\":\"2\"}]}""
If that does not work, can you enter the same expression in VS Codes watch window and post a screenshot of the result here?
from vscode-debug-visualizer.
package main
import (
"encoding/json"
"fmt"
"math/rand"
"strconv"
"time"
)
type Graph struct {
Kind map[string]bool `json:"kind"`
Nodes []NodeGraphData `json:"nodes"`
Edges []EdgeGraphData `json:"edges"`
}
type NodeGraphData struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Color string `json:"color,omitempty"`
Shape string `json:"shape,omitempty"`
}
type EdgeGraphData struct {
From string `json:"from"`
To string `json:"to"`
Label string `json:"label,omitempty"`
ID string `json:"id"`
Color string `json:"color,omitempty"`
Dashes bool `json:"dashes,omitempty"`
}
func NewGraph() *Graph {
return &Graph{
Kind: map[string]bool{"graph": true},
Nodes: []NodeGraphData{},
Edges: []EdgeGraphData{},
}
}
func (this *Graph) toString() string {
rs, _ := json.Marshal(this)
return string(rs)
}
func main() {
rand.Seed(time.Now().UnixNano())
graph := NewGraph()
for i := 2; i < 100; i++ {
id := strconv.Itoa(i)
graph.Nodes = append(graph.Nodes, NodeGraphData{
ID: id,
Label: id,
})
targetId := rand.Intn(i) + 1
graph.Edges = append(graph.Edges, EdgeGraphData{
From: id,
To: strconv.Itoa(targetId),
})
s := graph.toString()
fmt.Printf("%s", s)
}
}
from vscode-debug-visualizer.
Can you try out to visualize this expression:
""{\"kind\":{\"graph\":true},\"nodes\":[{\"id\":\"1\"},{\"id\":\"2\"}],\"edges\":[{\"from\":\"1\",\"to\":\"2\"}]}""
If that does not work, can you enter the same expression in VS Codes watch window and post a screenshot of the result here?
from vscode-debug-visualizer.
You need to start a debug session by debugging a golang program!
This extension requires the debugger to evaluate expressions.
I'm working on improving the error messages.
from vscode-debug-visualizer.
from vscode-debug-visualizer.
@birdie7762 thanks for the screenshot ;) You can make it dynamic by calling a method that returns such a string.
from vscode-debug-visualizer.
@birdie7761 Would you mind porting this demo to golang and creating a PR? That would be awesome! :)
from vscode-debug-visualizer.
from vscode-debug-visualizer.
{"kind":{"graph":true},"nodes":[{"id":"2","label":"2"}],"edges":[{"from":"2","to":"2","id":""}]}
from vscode-debug-visualizer.
@birdie7761 thanks a lot :) If you want to be listed as contributer to this project in github, you can fork this repository and open a pull request with your file in the demo folder! (otherwise I can simply commit it by myself)
from vscode-debug-visualizer.
That's Great!
from vscode-debug-visualizer.
@birdie7761 thanks a lot :) If you want to be listed as contributer to this project in github, you can fork this repository and open a pull request with your file in the demo folder! (otherwise I can simply commit it by myself)
@hediet My English is very poor. I'm using a translator, so I haven't had a text reply to you before. PR I've created.(#37)
The golang serialized output of json cannot be displayed correctly.
The error information is as follows:
Error: Could not parse "{"kind":{"graph":true},"nodes":[{"id":"2","label":"2"}],"edges":...+32 more" as JSON. Unexpected token k in JSON at position 3
from vscode-debug-visualizer.
My English is very poor. I'm using a translator, so I haven't had a text reply to you before.
No problem ;)
PR I've created.(#37)
Thank you!
Sorry, I didn't look at your screenshot properly. Thanks for providing it!
Looks like it choked on ... + 32 more
. It's interesting that the Debug Console does not has this ... + 32 more
. I guess the debug adapter adds this text when the string gets too long.
Which debug adapter do you use?
from vscode-debug-visualizer.
The debug used is delve
Delve's maxStringLen default is small and needs to be adjusted for the maxStringLen default of the delve. See in detail (microsoft/vscode-go#868).
Add the following configuration to launch.json
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 500,
"maxArrayValues": 64,
"maxStructFields": -1
}
Adjustments can already be shown.
from vscode-debug-visualizer.
Closing this as I've verified that the golang demo works.
from vscode-debug-visualizer.
Related Issues (20)
- debug visualizer doesn't get frame id correctly when selecting frame from call stack
- Is Deno not supported as a debugging runtime environment?
- Use with jupyter kernel
- Unable to run debug visualizer HOT 4
- data extractor help HOT 2
- Failed to visualize with Swift Demo,= ~~~
- 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
- 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 12
- Unable to show geometries data HOT 2
- Short choice of visualisers HOT 6
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.