Skip to content
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

Changing worktree while having active LSP Clients #88

Open
asmodeus812 opened this issue Jun 19, 2022 · 1 comment
Open

Changing worktree while having active LSP Clients #88

asmodeus812 opened this issue Jun 19, 2022 · 1 comment

Comments

@asmodeus812
Copy link

asmodeus812 commented Jun 19, 2022

So i think i stumbled upon an issue. The scenario is the following

  1. Open a file (readme.md for example) from the master worktree
  2. Have lsp clients auto attach and initialize (i.e the lsp root dir points at the master worktree dir)
  3. Create another worktree and/orChange worktree (pre existing) to another one also having the same readme file
  4. Git-worktree will understand the file already exists and execute the update on change, i assume (which is just e .).
  5. The pwd will change but the lsp client remains attached and still points at the master worktree as root directory

So what options do we have here, this is reproducible for any type of file not just markdown, i gave it as an obvious example since it is easy to test with (pretty much all work trees will no doubt have that file existing). Another important points is that if you have a lot of files and by proxy buffers open from the old worktree and you switch, only the current might get refreshed to the one in the changed worktree, but the rest will still point to the old one, maybe that is somewhat of a useful usecase for others, but i see worktrees as somewhat independent and isolated and in that case the most straight forward solution is to just delete all buffers (related to the old worktree using prev_path).
As a workaround, could I just kill all buffers with the callback command that already exists as a settable property ?

@danielreis1
Copy link

any solutions here @asmodeus812

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

No branches or pull requests

2 participants