microsoft / microsoft/TypeScript

Relative dependencies for files do not update properly when moving multiple files at once between folders.

Open
#45,326 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Problem: Relative dependencies for files do not update properly when moving multiple files at once between folders.

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

VSCode Information:
Version: 1.58.2 (user setup)
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:10:15.214Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042

Steps to Reproduce (JavaScript):

  1. Make new Node project with npm init and open the folder in VSCode.
  2. Create three JavaScript files which all reference each other using require() or import.
  3. Create a folder in the workspace.
  4. Move two of the files into the folder (have them both selected and move them together).

The imports of the moved files will now be left unchanged and hence incorrect (except one, which is why moving a single file is bug-free).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in VS Code with a Node project containing three JavaScript files that reference one another through require() or import, then move two files together. No source file or test is named in the report, so trace the multi-file move handling and its relative-import updates. Done means every affected import is correct after the move, including references between the moved files.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.