vscode icon indicating copy to clipboard operation
vscode copied to clipboard

CLI worktree: node modules not copied over to the worktree folder

Open rebornix opened this issue 1 month ago • 1 comments

Does this issue occur when all extensions are disabled?: Yes/No

Re https://github.com/microsoft/vscode/issues/277163

The current behavior is likely by design as creating a new git worktree will not copy node_modules over. However it becomes a problem the moment I browse the files in the current workspace. TypeScript language server will read the file and complain that there are missing packages.

Image

A couple of ideas:

  • do we want to support copying node_modules or similar packages dependencies when creating new git worktree?
  • do we want to make it extensible that users can configure post script for git worktree?
  • should the language servers/extensions ignore git worktree? (which is then a step down as I still wish to use some language features)

rebornix avatar Nov 12 '25 00:11 rebornix

do we want to make it extensible that users can configure post script for git worktree?

I would opt for this.

lszomoru avatar Nov 12 '25 15:11 lszomoru

do we want to make it extensible that users can configure post script for git worktree?

I would opt for this.

Sorry for jumping in but I think this is a really good approach, cursor did something similar that works really well: https://cursor.com/docs/configuration/worktrees#initialization-script

brunompl avatar Dec 12 '25 00:12 brunompl