typescript-language-server / typescript-language-server

TypeScript & JavaScript Language Server

Home Page:https://www.npmjs.com/package/typescript-language-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support renaming files when renaming default exports

bradymadden97 opened this issue · comments

(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?