Fork me on GitHub
#vim
<
2022-10-23
>
walterl21:10:11

Has anyone come across a plugin or something that can load a stack trace's paths into the location list?

nate01:10:08

Love the alternate name!

😆 1
Martynas Maciulevičius08:10:36

What I like about this plugin is that I don't need to save the current file to jump. I'll have to investigate that because I have my own plugin that suffers from this. Thanks.

Noah Bogart13:10:00

That's very cool! thanks for the link @UJY23QLS1

Martynas Maciulevičius14:10:43

Not the link, the plugin 😄

walterl14:10:28

> "What I like about this plugin is that I don't need to save the current file to jump." This may be an accidental side effect of LocStack trying a bit harder to find a location when the stacktrace nREPL op doesn't return one. It looks up the file for the ns.

Martynas Maciulevičius14:10:48

No, I think this is a side-effect of that separate buffer and how it implements the jump. I looked at your code and you don't do the jump command yourself, you just give the lines to another buffer. When I try to jump to a different file using my own plugin then it complains that the current file isn't saved. Probably this is a config option.

walterl14:10:39

Oh, the jumping is done by vim's built-in location list. vim-unimpaired then makes navigation between those entries as easy as [l and ]l vim

Martynas Maciulevičius07:10:57

But the docs of vim-unimpaired say that [l doesn't do any jumps and instead it decodes or encodes as a list: https://github.com/tpope/vim-unimpaired I think you have some other plugin that gives you this mapping. I'd also like to not view the stack trace in the popup window but to jump to the deepest node. Do you think it's a good idea?

walterl13:10:21

n ]l <Plug>(unimpaired-lnext) :man-shrugging:

walterl13:10:17

> "Do you think it's a good idea?" Not sure how useful that'll be, since in most cases it will be your process or REPL entry point. I've rarely had to look past the top (first) few frame in a stack trace.

☝️ 1
Martynas Maciulevičius14:10:57

> I've rarely had to look past the top (first) few I was thinking about being able to jump to the deepest stack trace line -- i.e. the one that actually threw.

walterl14:10:32

That's the first/top frame. ]l/`:lnext` gets me there, although it's often somewhere in unlocatable (Java) code. Maybe LocStack should focus the location list when it pops up, like vim.diagnostic.setloclist() does.

Martynas Maciulevičius14:10:50

Ah I see how ]l works then. But then I still need to calculate the location list. Ok. I thought if it could jump to the first location automatically and then showing no popup :thinking_face: But I don't know if this can work.

walterl15:10:40

It probably could, but I tend to avoid automatic and "unexpected" jumps like that. Especially for an operation that takes this long. Maybe it can be added as an option.

Martynas Maciulevičius15:10:03

Oh right. In my older conjure clj-test jump plugin it also was taking time to do it. What would be more magic is that the jumps would be added. Then it would be hard to understand where they come from.

walterl15:10:47

Don't you think the location list is a better fit for this purpose, than the jump list?

Martynas Maciulevičius15:10:16

I don't know. I'm new to :lnext concept. I'll try to use it and then I'll be able to comment here. But yes, I remember I'm constantly frustrated by "hm, how could I jump to the next stack frame line without needing to find the stack trace and figure out stuff"

Martynas Maciulevičius15:10:40

Nice. I can see the stack trace at the bottom but also move around by pressing 5]l. And I don't need to focus the stack trace anymore. That's pretty good.

walterl15:10:06

Yeah, the loclist (and quickfix list) is pretty useful.

Martynas Maciulevičius15:10:42

Do you use vim-unimpaired with quicklist? How?

Martynas Maciulevičius15:10:52

I don't understand what ]q does. It jumps to a random location in a different file somehow. [b is useful when you open some random buffer but you want to have what you had before.

walterl15:10:52

See :copen and :help quickfix

Noah Bogart15:10:34

The quickfix is awesome when doing refactoring. Makes it really easy to step through a bunch of locations, and will even adjust the target location when adding/removing lines in a file

☝️ 2
walterl01:10:11

:LocStack is now >10x faster. It can also now load stack traces from registers (`:LocStackReg`), meaning you can yank and load stack traces from logs.

👀 4
walterl01:10:11

:LocStack is now >10x faster. It can also now load stack traces from registers (`:LocStackReg`), meaning you can yank and load stack traces from logs.

👀 4