Skip to content

Update imports on file move rewrites ./index to '.' #26028

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#54981 (comment)

TypeScript Version: 3.1.0-dev.20180726

Search Terms:

  • update imports
  • getEditsForFileRename

Code
For a project

index.ts

export const foo = 123

foo.ts

import { foo } from './index';
  1. In VScode, Rename foo.ts to bar.ts
  2. Confirm that you want to update import paths

Expected behavior:
No edits returned from getEditsForFileRename

Actual behavior:
An edit is returned that rewrites foo.ts to:

import { foo } from '.';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Quick Infoe.g. hover text, tool-tips, and tooltips.FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions