Move to new file refactor misses shorthand property referencing importΒ #59131
Open
Description
opened on Jul 3, 2024
π Search Terms
shorthand property refactor
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about shorthand properties
β― Playground Link
π» Code
import store from "./store";
// vscode -> Refactor -> Move to new file
// Moving this function will retain the import
export function a() {
console.log({store});
}
// Moving this function will remove the import
export function b() {
console.log(store);
}
π Actual behavior
Import statement is removed when function b
is removed.
π Expected behavior
Import statement is retained when function b
is removed because it's used by function a
.
Additional information about the issue
Happens in vscode and when using LanguageService.getEditsForRefactor
.
Activity