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

Incorrect getEditsForFileRename with npm linked module #25059

Closed
mjbvz opened this issue Jun 18, 2018 · 2 comments
Closed

Incorrect getEditsForFileRename with npm linked module #25059

mjbvz opened this issue Jun 18, 2018 · 2 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jun 18, 2018

From microsoft/vscode#52022

TypeScript Version: 3.0.0-dev.20180616

Search Terms:

Code

  1. git clone https://github.com/mjbvz/ts-update-paths-npm-link-bug
  2. npm install
  3. Open project in VS Code
  4. Open file d.ts
  5. Rename d.ts to a.ts

Expected behavior:
No edits returned from getEditsForFileRename

Actual behavior:
getEditsForFileRename changes the import for import { abc } from "sub"; to import { abc } from "./sub/src/types"

[Trace  - 2:34:49 PM] Response received: getEditsForFileRename (52). Request took 8 ms. Success: true 
Result: [
    {
        "fileName": "/Users/matb/projects/san/a.js",
        "textChanges": [
            {
                "start": {
                    "line": 3,
                    "offset": 22
                },
                "end": {
                    "line": 3,
                    "offset": 25
                },
                "newText": "./sub/src/types"
            }
        ]
    }
]

Playground Link:

Related Issues:

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Jun 18, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 19, 2018
@mhegazy mhegazy assigned ghost Jun 19, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jun 19, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Jun 19, 2018
@ghost ghost closed this as completed in #25074 Jun 26, 2018
@tomergev
Copy link

This is a horrible bug

@ghost
Copy link

ghost commented Aug 27, 2018

@tomergev Should be fixed in typescript@next.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

3 participants