chanhx / crabviz Goto Github PK
View Code? Open in Web Editor NEW🦀 A LSP-based interative call graph generator
License: Apache License 2.0
🦀 A LSP-based interative call graph generator
License: Apache License 2.0
After exporting call graph, can we preview again with crabviz extension? Because other svg extensions i tried are not interactable.
there is a panic while generating a call graph:
Panic context:
>
version: 0.3.1631-standalone (83b3ba1b8 2023-08-19)
request: callHierarchy/outgoingCalls CallHierarchyOutgoingCallsParams {
item: CallHierarchyItem {
name: "output_record_batch_and_reset",
kind: Function,
tags: None,
detail: Some(
"fn output_record_batch_and_reset(&mut self) -> Result<RecordBatch>",
),
uri: Url {
scheme: "file",
cannot_be_a_base: false,
username: "",
password: None,
host: None,
port: None,
path: "/Users/r4ntix/Workspace/github/arrow-datafusion/datafusion/core/src/physical_plan/joins/sort_merge_join.rs",
query: None,
fragment: None,
},
range: Range {
start: Position {
line: 1242,
character: 4,
},
end: Position {
line: 1249,
character: 5,
},
},
selection_range: Range {
start: Position {
line: 1242,
character: 7,
},
end: Position {
line: 1242,
character: 36,
},
},
data: None,
},
work_done_progress_params: WorkDoneProgressParams {
work_done_token: None,
},
partial_result_params: PartialResultParams {
partial_result_token: None,
},
}
thread 'Worker' panicked at 'invalid offset', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/line-index-0.1.0-pre.1/src/lib.rs:148:35
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::option::expect_failed
3: rust_analyzer::to_proto::range
4: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
5: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
6: rust_analyzer::handlers::request::handle_call_hierarchy_outgoing
7: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 17:33:17] Request callHierarchy/outgoingCalls failed.
Message: request handler panicked: invalid offset
Code: -32603
Neat extension, I went to test it on some stuff I had lying around and noticed that it didn't identify functions that were called as routes for Actix. I have a repo that I was using while working through Zero to Production in Rust that I used to test.
I found that when looking at the graph for the entire src
folder, it shows that my functions for routes are never called:
When checking the call hierarchy in VS Code, it correctly shows that this health_check
function is called by run
, which is called by spawn_app
and main
:
Source is here for reference: https://github.com/Torsitano/zero-to-rust/blob/main/src/routes/health_check.rs
I'm trying to run CrabViz, and I'm not getting a visualization. I do the following:
And nothing happens. CrabViz does briefly pop up with "loading languages" but that's about it.
I'm happy to debug, but not sure about how to do so. Are there instructions on how to do so?
I'm using VSCode with the SSH plugin, if that changes anything.
C++, clangd, and when i clicked generate call graph
, nothing happened.
Looks amazing! But, Does this work with Python3? I get "no matching workspace symbols" errors. I think these were due to my init.py files which I deleted. However, no image is opening in vscode. Any ideas on how to get it working? Would be much appreciated :)
对项目很感兴趣,可否一起开发
Cool use of the LSP! It would be much more useful to me if it was possible to display in a tree (-like) layout instead of blocks for each file.
In a project at work, the call graph probably has several thousand items (we have et least 800 elixir modules).
When initially created the graph is just a thin vertical line, after maximally zooming in, it is a bold vertical line created from blocks, that seem to have labels. It is still not quite usable.
I have not yet been able to try this on smaller projects or comperably large projects in another language.
When I click on an item, it becomes relevant only to that item.
But if I click on a blank space (or scroll the canvas), it becomes all relevant.
Here are some ideas:
当我点击一项时,它变为只会这一项有关.
但如果我点空白的地方(或者拉动画布),就会变为全部相关.
我有一些想法:
这可能是#9的一个复制
这插件简直梦中情插,只不过我之前用的是source insight,一直想要找一个类似下面这个repo 中的 visual studio 插件的效果:
https://github.com/league1991/CodeAtlasVsix
就那种点哪儿就跳哪儿那种。
当然,单纯用 call hierarchy 也行,可是就想看图。。只恨我自己太菜,啥rust啥都不懂,球球了,大佬让我白嫖下吧(狗头保命)
source file: tokio/src/runtime/runtime.rs
expected result: function new will be in the generated graph
Actual result: function new is missing
I want to show graphviz about cranelift, but found error as follow.
I don't know exactly why. Can you take a look for me?
2023-12-28 22:52:16.484 [error] Error: command failed with error code 2: error parsing glob '!/{**/*.css,**/*.csv,**/*.gif,**/*.gitignore,**/*.html,**/*.md,**/*.jpeg,**/*.jpg,**/*.json,**/*.lex,**/*.lock,**/*.log,**/*.png,**/*.toml,**/*.txt,**/*.xml,**/*.yaml,**/*.yacc,**/*.yml,fuzz/artifacts,fuzz/corpus,benches/wasi/test.bin,benches/instantiation/wasi.wasm,*.bk,*.pyc,*.swo,*.swp,*.swx,*~,.*.rustfmt,.mypy_cache,/#*/#,cranelift.dbg*,docs/_build,docs/book,.vscode/,.vs/,rusty-tags.*,tags,target,.z3-trace,foo,.cargo,publish,vendor,examples/build,examples/.cache,*.coredump,docs/assemblyscript-hello-world/node_modules/,docs/assemblyscript-hello-world/package-lock.json,docs/assemblyscript-hello-world/*.lock,docs/assemblyscript-hello-world/*.{wat,wasm},docs/assemblyscript_demo/node_modules/,docs/assemblyscript_demo/package-lock.json,docs/assemblyscript_demo/*.lock,docs/assemblyscript_demo/*.{wat,wasm},crates/wasi-common/WASI/*.bk,crates/wasi-common/WASI/*.swp,crates/wasi-common/WASI/*.swo,crates/wasi-common/WASI/*.swx,crates/wasi-common/WASI/tags,crates/wasi-common/WASI/target,crates/wasi-common/WASI/Cargo.lock,crates/wasi-common/WASI/.*.rustfmt,crates/wasi-common/WASI/rusty-tags.*,crates/wasi-common/WASI/*~,crates/wasi-common/WASI//#*/#,crates/wasi-common/WASI/tools/witx/target,crates/wasi-common/WASI/tools/witx/Cargo.lock,crates/c-api/html,crates/c-api/wasm-c-api/out,crates/c-api/wasm-c-api/v8,crates/environ/target/,crates/environ/**/*.rs.bk,crates/environ/Cargo.lock,crates/environ/fuzz/corpus,crates/environ/fuzz/artifacts,crates/bench-api/stdout.log,crates/bench-api/stderr.log,crates/fuzzing/wasm-spec-interpreter/ocaml/_build,crates/fuzzing/wasm-spec-interpreter/ocaml/spec,cranelift/isle/target,cranelift/isle/*~,cranelift/isle/.*.swp,cranelift/isle/fuzz/target,cranelift/isle/fuzz/corpus,cranelift/isle/fuzz/artifacts,cranelift/docs/_build,tests/wasi_testsuite/wasi-common/tests/rust/target/,tests/wasi_testsuite/wasi-common/tests/assemblyscript/node_modules/,tests/spec_testsuite/commit_message,tests/spec_testsuite/repos/,tests/wasi_testsuite/wasi-threads/test/testsuite/*.wasm,tests/wasi_testsuite/wasi-common/*.wasm,tests/wasi_testsuite/wasi-common/.DS_Store,tests/wasi_testsuite/wasi-common/test-runner/__pycache__/,tests/wasi_testsuite/wasi-common/test-runner/.coverage,tests/wasi_testsuite/wasi-common/tests/c/testsuite/fs-tests.dir/writeable/*,tests/wasi_testsuite/wasi-common/tests/c/testsuite/fs-tests.dir/writeable/!.gitignore}': nested alternate groups are not allowed
at T (vscode-file://vscode-app/Users/huangzheng/Desktop/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1861:5893)
at vscode-file://vscode-app/Users/huangzheng/Desktop/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1869:4355
at async vscode-file://vscode-app/Users/huangzheng/Desktop/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1869:2925 crabviz.generateCallGraph {"value":"chanhx.crabviz","_lower":"chanhx.crabviz"}
impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> QueryIterationCursor<'w, 's, Q, F> {
fetch: Q::clone_fetch(&self.fetch), //<<<
filter: F::clone_fetch(&self.filter),//<<<
Cannot find a directed edge from some function to clone_fetch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.