TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A new VSCode extension that shows definition functions in a stack

8 点作者 mchahn大约 1 个月前
Definition Stack is a new vscode extension I have just released. It is a reading tool for Javascript and Typescript. It is available in the extension marketplace.<p>You just click in a function in any source code, execute a command, and a new tab opens next to the original. That tab has a &quot;block&quot; which contains a copy of the function you clicked in. In that code every word (symbol) that has a definition is highlighted. If you click on a higlighted word a new block opens above the original which contains the source code of the definition for that word. You can click in that block and repeat to create a stack. All function blocks are in the one tab that you can scroll through.<p>There are other options like collapsing a block, deleting it, etc. It is easy to open a block, look at it, and delete it taking you back to the block below. Then clicking in the lower block with another word opens yet another block above. Continuining this process lets you walk the &quot;tree&quot; of references and definitions. This lets you see all the code executed when the original function runs. This is similar to stepping through code with a debugger.<p>The function code is isolated in each block with the name of the original source code file and the lines are numbered the same. But when using the stack you can ignore what file each one came from. This gives a fresh way to look at what all the functions do without the cognitive load of remembering what file the functions are in.<p>AFAIK, this concept is original. Correct me if I&#x27;m wrong. My idea came from an IDE for Java from IBM many years ago. In that system there were no source files at all. Each function came from from a database. That IDE was a failure :-) I think my version of that concept will do better because it doesn&#x27;t replace source files, it just adds a tool for working with source files. The stack is created instantly and is just meant to be used occasionally when it makes sense. It is sort of a Go To Definition on steroids.<p>Please give me feedback. Since it is brand new I want to fix anything wrong including user experience problems. Enjoy ...

2 条评论

hnhn34大约 1 个月前
Been thinking about something like this for so long, but didn&#x27;t want to bother with building a VSC extension. Thanks for sharing this!<p>I suspect it would be useful as a fast &quot;context collector&quot; for LLMs as well. Maybe framing it like that could catch HN&#x27;s attention a bit more.
评论 #43607710 未加载
atmanactive大约 1 个月前
I don&#x27;t know how to install this.
评论 #43578553 未加载