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

Test: JS/TS update imports on file move #50494

Closed
3 tasks done
mjbvz opened this issue May 25, 2018 · 3 comments
Closed
3 tasks done

Test: JS/TS update imports on file move #50494

mjbvz opened this issue May 25, 2018 · 3 comments

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented May 25, 2018

Testing for #49579

Complexity: 1

Summary
VS Code will now attempt to update import paths when you move or rename a js/ts file using the vscode API. This is controlled by the javascript.updateImportsOnFileMove.enabled setting. The default behavior of this setting is to prompt the user for each file rename / move

Note that directory renames are currently not supported. This is tracked by #50244

Testing
In a js/ts project with imports and a tsconfig or jsconfig, try moving and renaming files. Confirm that you are prompted and can automatically update import paths.

Things to try:

  • Test different values for javascript.updateImportsOnFileMove.enabled, such as "always" and "never"
  • Make sure format style and preferences are respected
@mjbvz mjbvz added this to the May 2018 milestone May 25, 2018
@octref
Copy link
Contributor

octref commented May 29, 2018

Was testing another issue and had to tweak the setting, but why have the .enabled in the end when typescript.updateImportsOnFileMove would do?

@tommhuth
Copy link

tommhuth commented Jun 19, 2018

this caused major trouble for me, ending up with all my imports (including node_modules) being mangled into redonk stuff like:

// wtf?
import React from "../../../../../Library/Caches/typescript/2.9/node_modules/@types/react"
// this points directly to my node_modules folder, instead of @scope/shared-react-components/native
import { SplashPosterSubtitle, SplashPoster, SplashPosterTitle } from "../../../../shared-react-components/native"

Should I open a bug for this?

@auchenberg
Copy link
Contributor

@tommhuth Yes please.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants