vim

walterl 2022-10-23T21:19:11.928579Z

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

Jan K 2022-10-23T21:35:23.059649Z

vim-fireplace https://github.com/tpope/vim-fireplace/blob/master/doc/fireplace.txt#L234-L238

👍 1
walterl 2022-10-25T00:42:17.633759Z

For Conjure users: https://github.com/walterl/conjure-locstack

👀 4
1
nate 2022-10-25T01:21:08.731889Z

Love the alternate name!

😆 1
Martynas Maciulevičius 2022-10-26T07:56:57.545919Z

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?

walterl 2022-10-26T13:55:21.063149Z

n ]l <Plug>(unimpaired-lnext) 🤷‍♂️

walterl 2022-10-26T13:57:17.386949Z

> "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čius 2022-10-26T14:21:57.054599Z

> 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.

walterl 2022-10-26T14:51:32.892139Z

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čius 2022-10-26T14:55:50.922509Z

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 🤔 But I don't know if this can work.

walterl 2022-10-26T15:02:40.927809Z

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čius 2022-10-26T15:08:03.147729Z

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.

walterl 2022-10-26T15:17:47.140769Z

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

Martynas Maciulevičius 2022-10-26T15:22:16.783529Z

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čius 2022-10-26T15:32:40.710619Z

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.

walterl 2022-10-26T15:33:06.353539Z

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

Martynas Maciulevičius 2022-10-26T15:33:42.698869Z

Do you use vim-unimpaired with quicklist? How?

walterl 2022-10-26T15:34:06.823179Z

]q and [q

Martynas Maciulevičius 2022-10-26T15:35:52.844029Z

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.

walterl 2022-10-26T15:36:52.243359Z

See :copen and :help quickfix

2022-10-26T15:40:34.510899Z

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
walterl 2022-10-27T01:56:11.626609Z

: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
Martynas Maciulevičius 2022-10-25T08:59:36.888339Z

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.

2022-10-25T13:43:00.929829Z

That's very cool! thanks for the link @clojurians-slack100

Martynas Maciulevičius 2022-10-25T14:09:43.612009Z

Not the link, the plugin 😄

walterl 2022-10-25T14:15:28.872919Z

> "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čius 2022-10-25T14:18:48.881859Z

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.

walterl 2022-10-25T14:20:39.470839Z

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