Skip to content

Improve running codelens commands in a split #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

christopher-b
Copy link
Contributor

Previously, running an LSP code lens command would open a new split and terminal emulator each time a command was run. This change allows us to reuse an open window and reuse a scratch buffer.

It turns out that doing this kind of window management requires a fair bit of intervention, so we introduce a util module to abstract some of the more complicated or frequently-used bits. This ended up being more code that I expected, but it seems to be a pretty robust solution. I'm happy to investigate another approach if I'm way off base.

One potential (possibly imaginary) problem with this is that running concurrent code lens command would cause their outputs to overwrite each other. We can revisit this, and consider using plenary.job in the future.

Previously, running an LSP code lens command would open a new split and
terminal emulator each time a command was run. This change allows us to
reuse an open window and reuse a scratch buffer.
It turns out that doing this kind of window managment requires a fair
bit of intervention, so we introduce a `util` module to abstract some of
the more complicated or frequent bits.
One potential problem with this is that running concurrent code lens
command would cause their outputs to overwrite each other.
We can consider making this use plenary.job in the future

Remove vestigial check for valid buffer when reporting job failure
@adam12 adam12 merged commit 953429b into adam12:main Apr 28, 2025
@adam12
Copy link
Owner

adam12 commented Apr 28, 2025

This looks good. Indeed, it's a lot more code but it looks OK. Let's try it. 👍

@christopher-b christopher-b deleted the codelens branch April 28, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants