Skip to content

Support renaming files when renaming default exports #878

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

Open
bradymadden97 opened this issue Feb 27, 2024 · 0 comments
Open

Support renaming files when renaming default exports #878

bradymadden97 opened this issue Feb 27, 2024 · 0 comments

Comments

@bradymadden97
Copy link

bradymadden97 commented Feb 27, 2024

(feature request)

In webstorm, when you rename the default export of a file, it asks you if you want to also rename the file name (and references to that export in other files). It's a pretty nice feature.

Example:

/// file://MyDefaultExport.ts

export default function MyDefaultExport() {
  return 10;
}
  • Rename request MyDefaultExport --> MyDefaultExport2

  • Expected: typescript-langauge-server would:

  1. Return a WorkspaceEdit containing changes to rename MyDefaultExport --> MyDefaultExport2 in the file (it does this)
  2. Checks the client's capabilities for workspaceEdit.resourceOperations and returns a WorkspaceEdit containing a rename for MyDefaultExport.ts --> MyDefaultExport2.ts (it does not do this), as well as corresponding renames in other files
/// file://MyDefaultExport2.ts

export default function MyDefaultExport2() {
  return 10;
}

Do you think this may be something typescript-language-server could support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant