Skip to content

Update paths within moved file on file move #24345

@mjbvz

Description

@mjbvz

TypeScript Version: 2.9.1-dev.20180521

Search Terms:

  • Update paths on rename / move
  • getEditsForFileRename

Code

  1. Open this project in vscode: https://github.com/mjbvz/ts-issue-24345 The basic structure is:

index.ts:

import { a } from "./a";
import { b } from "./b";

console.log(a, b)

a.ts:

export const a = 1

b.ts:

import { a } from "./a";

export const b = a + 1
  1. In the project, move the file b.ts into a sub folder to trigger a path update

Expected behavior:
This should update both the import path for b within index.ts, as well as the import for a inside b.ts

Actual behavior:
Only the paths in index.ts are updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions