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

rename symbol support on vue <script> #42105

Closed
5 tasks done
GopherJ opened this issue Dec 24, 2020 · 3 comments
Closed
5 tasks done

rename symbol support on vue <script> #42105

GopherJ opened this issue Dec 24, 2020 · 3 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@GopherJ
Copy link

GopherJ commented Dec 24, 2020

Suggestion

it seems currently tsserver is not able to rename symbols located in vue <script> (or it's me who didn't find how to do it...) Is it possible to rename referenced symbols in vue <script>?

🔍 Search Terms

  • rename symbol
  • vue component

List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

📃 Motivating Example

considering having a vue typescript project.

src/store/types/getters.ts

const GET_USER_INFO = "GET_USER_INFO"  // <-- rename symbol here, let's say renaming it to `GET_USER_NAME`

src/components/Header.vue

<template>
<div>hello, {{ user_info }}</dir>
</template>

<script lang="ts">
import { GET_USER_INFO } from "@/store/types/getters" // <--- sadly this cannot be fixed

export default class Header extends Vue {
  get user_info() {
    return this.$store.getters[GET_USER_INFO] // <-- sadly this cannot be fixed
  }
}
</script>

💻 Use Cases

vue typescript project

@GopherJ
Copy link
Author

GopherJ commented Dec 24, 2020

I'm not sure if this should be in tsserver or vetur, ideally both... If you feel it should be on vetur side, please just close this

See also: vuejs/vetur#610

@andrewbranch
Copy link
Member

This would have to be on the Vetur side. As someone mentioned in that linked issue, a TypeScript LS plugin would have to communicate the request to the Vue LS. If there is some specific functionality missing from TypeScript that needs to be added to make that work, we’d probably be able to help with that. But from the issue it doesn’t look like anyone has tried it yet.

@andrewbranch andrewbranch added the External Relates to another program, environment, or user action which we cannot control. label Dec 28, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants