4 ms·
We built an "infinite canvas" style app for exploring codebases. We cut your repo into atomic pieces - functions, data structures etc. and give you an interact
by pst723 2y ago
We built an "infinite canvas" style app for exploring codebases. We cut your repo into atomic pieces - functions, data structures etc. and give you an interactively expandable graph of defintions.
Even with the best go-to-definition editor feature you need to keep a whole bunch of mental context when tracking down a deep control flow. The idea of Territory is to give you exactly the relevant cross-section through a large codebase. A code map that you build in this fashion can then provide explanatory value to others.
So far we indexed Linux, LLVM and Godot to prove we can handle repos of that scale and to provide value free of charge to free software contributors. We will be adding more repos and shipping self-service build setup later. Would love to hear your opinion. Are there any projects you think we should cover next? We are doing C/C++ first -- our initial parsing setup is build around libclang.
- dontdieych 2y agoI would like editing code in this style. Focus on narrow area but can easily view as bird eye. Nice work!
- pst723 2y agoThank you! Editing is definitely on the roadmap. We would like to have an agent to sync edits with your local workspace at some point.
- verdverm 2y agoWhat about a VS Code extension? Would love to explore like this in my IDE over needing a separate tool / webapp Something like: https://github.com/pixelkind/p5canvas https://github.com/pixelkind/p5canvas
- pst723 2y agoI got that request from a couple of people already. Definitely coming soon. For now, we tried to make it easy to hop around manually. Click the node header to copy path, ⌘P, paste. Pasting a path to our search bar also works.
- gigatexal 2y agoPost to HN when that launches. I’ll take a look then.
- pst723 2y agoSure. You can follow as on X @territory_dev, I post updates there.
- verdverm 2y agoI can imagine a number of really cool ways to explore code with a tight integration to intellisense / LSP in particular, show all callers and callees of a code snippet
- speps 2y agoSupport Unreal Engine and you'd get a lot of interest from game devs!
- pseudosudoer 2y agoIdeally this would be a standalone app (perhaps ported using electron) that I could run locally, and import codebases directly. Sourcegraph was on the right track, but eventually fizzled out unfortunately. I would love to use a tool like this to navigate the unknown on rails!
- pst723 2y agoThat is definitely an option. However what you get from a hosted service is that we do the indexing for you. That can take a significant amount of time for a huge codebase.
- jijijijij 2y agoLove the idea, but isn't the "indexing" part of many editors and language servers already? Ctags and stuff? Never got the impression that to be a huge problem on modern hardware. I doubt, there will be much demand for throwing large non-public code bases into third party services... However, I can totally see how this would be a hit as a FOSS project.
- sdesol 2y agoI've built a code search engine in the past so I know how painful debugging long indexing jobs can be and I would certainly be reluctant to support private repos until I know I can index thousands if not tens of thousands of open source repos with no issues.
- pst723 2y agoThat's more or less the plan. We want to prove our concept with free software repos first.
- sqs 2y agoSourcegraph CEO here. We stopped making a standalone Electron app (which was an experiment) and instead remained focused on our web app and editor extensions. You can use Cody in your editor with no server needed. We didn’t fizzle out. :)
- azeirah 2y agoI have some interesting ideas about this, as I've been thinking about it and have been prototyping ideas for ... a decade at this point? Do you have a way to contact you? Any reason you're not using treesitter with LSPs by the way? This would make it really easy to get this working with all major languages at once.
- pst723 2y agoLSP and treesitter are cool and we might use them when adding more languages eventually. From my understanding though treesitter does parsing only and it would take a bunch of work to do the semantic analysis clang already does. Plus clang is an industry tried compiler that we know can handle a lot of the rough edge cases of C and C++. LSP is closer to our use case but I think still not close enough. It took a lot of work to get the right points to cut the code at and when talking to clang directly, at least we can inspect things at a decently low level. Are you on X? You can DM me at @pst723 or @territory_dev.
- voxelghost 2y agoSome first impression UI feedback: Don't overlap existing boxes when exploring new definition. Instead find the lowest free space in the column (or insert it at appropriate level) When adding a reference to rather than exploring definition, default to adding box to the opposite side (left)
- pst723 2y agoAh yes those are definitely on the TODO list.
- voxelghost 2y agoWhile we are at it, it would probably also be nice to (optionally) color the background of the explored row(or token) and color the title bar of the result correspondingly (I am thinking similar to Godbolt color coding for matching C->ASM)
- anentropic 2y agoIt'd be great if this UI could happen inside VS Code, for the current workspace and its dependencies
- aappleby 2y agoThis might interest you - https://github.com/aappleby/wideboard https://github.com/aappleby/wideboard