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

VSCode could not find all the references for component emits #5115

Open
weiwen-chi opened this issue Jan 8, 2025 · 0 comments
Open

VSCode could not find all the references for component emits #5115

weiwen-chi opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@weiwen-chi
Copy link

What problem does this feature solve?

We are working on a Vue 3 project using VSCode with the official Vue extension. In our project, we follow kebab-case naming conventions for all props and emitted events in Single File Components (SFCs). However, we’ve encountered an issue where the "Find All References" feature does not behave as expected for emitted events.

example:

<!-- TestComponent.vue -->
<template>
  <div>Test Component</div>
</template>

<script setup lang="ts">
defineEmits<{
  selectElement: [];
}>();
</script>
<!-- ParentComponent.vue -->
<template>
  <TestComponent @select-element="callBackMethod" />
</template>

<script setup lang="ts">
function callBackMethod() {
   console.log('this is called');
}
</script>
</script>

In this scenario, if we right-click on @select-element in ParentComponent.vue and choose "Find All References", it doesn’t locate the definition of the emitted event in TestComponent.vue. Similarly, doing the reverse on the emitted event select-element in TestComponent.vue doesn’t find its usage in ParentComponent.vue.

What does the proposed solution look like?

VSCode should be able to identify all references to the emit event, providing both the definition and all occurrences (usages) within the project.

@weiwen-chi weiwen-chi added the feature request Request new features label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants