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

Go to definition not functioning from template in class-based typescript SFCs #864

Closed
3 tasks done
NiloCK opened this issue Aug 9, 2018 · 4 comments · Fixed by #1323
Closed
3 tasks done

Go to definition not functioning from template in class-based typescript SFCs #864

NiloCK opened this issue Aug 9, 2018 · 4 comments · Fixed by #1323

Comments

@NiloCK
Copy link

NiloCK commented Aug 9, 2018

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Win
  • Vetur version: 0.12.6
  • VS Code version: 1.25.1

Problem

I'm uncertain whether this issue properly belongs to Vetur or to vue-class-component. It's strictly about the editor experience rather than transpiled output, so I thought it might be better here.

Vetur has some inconsistent go to definition behaviors which I've not seen documented. My setup here is vue-cli@3.0.0-rc10, vue-class-component@6.0.0, and vue-property-decorator@7.0.0.

Go to definition works on <user-regristration /> in the following SFC:

<template>
  <user-registration />
</template>

<script lang="ts">
import Vue from 'vue';
import UserRegistration from './UserRegistration.vue';

export default Vue.extend({
  components: {
    UserRegistration
  }
})
</script>

but fails in the class based equivalent (No definition found for 'user-registration'):

<template>
  <user-registration />
</template>

<script lang="ts">
import Vue from 'vue';
import UserRegistration from './UserRegistration.vue';
import Component from 'vue-class-component';

@Component({
  components: {
    UserRegistration
  }
})
export default class TestComponent extends Vue {}
</script>
@bartosz-brodzik
Copy link

+1

@NiloCK
Copy link
Author

NiloCK commented Aug 10, 2018

A related question, which I expect is not a bug, because I'm sure I've read something documenting the behavior before. I just can't find any reference to it now.

Why does go to definition fail in the following, with <UserRegistration /> in place of <user-registration />?

<template>
  <UserRegistration />
</template>

<script lang="ts">
import Vue from 'vue';
import UserRegistration from './UserRegistration.vue';

export default Vue.extend({
  components: {
    UserRegistration
  }
})
</script>

The HTML parser's RED_TEXT might be some sort of hint for me...

@adamalfredsson
Copy link

YES! I'm having this exact issue as well on macOS 10.13.2. Could someone please confirm whether it's a bug or a missing feature?

@cecilpeng
Copy link

cecilpeng commented May 4, 2019

+1, It isn't compatiable when using class-based component

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

Successfully merging a pull request may close this issue.

5 participants