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

TypeScript Intellisense not updating #710

Closed
3 tasks done
neilsimp1 opened this issue Feb 28, 2018 · 2 comments
Closed
3 tasks done

TypeScript Intellisense not updating #710

neilsimp1 opened this issue Feb 28, 2018 · 2 comments

Comments

@neilsimp1
Copy link

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

Info

  • Platform: Windows/Linux, not tested on Mac
  • Vetur version: 0.11.7
  • VS Code version: 1.20.1

Problem

TypeScript Intellisense not updating in <script> section of .vue files for referencing other .ts files.
See https://stackoverflow.com/questions/46988578/intellisense-not-working-for-vue-files for example.

Reproducible Case

Create a Test.ts file:

export default class Test {

}
  1. In your .vue file, import this class
<script lang="ts">
import Test from './test';
export default class App extends Vue {
    created() {
        const t = new Test();
    }
}
</script>
  1. Add a new method to Test.ts
export default class Test {
   foo() { }
}
  1. Try to reference the new function in your .vue file
<script lang="ts">
import Test from './test';
export default class App extends Vue {
    created() {
        const t = new Test();
        t.foo();
    }
}
</script>

You will receive an error in VSCode Intellisense saying Property 'foo' does not exist on type 'Test'.

Closing/reopening the file does not seem to fix this. Only restarting VS Code corrects the error. Webpack is still able to compile the code for me, so the error issue seems to be either with VS Code or with Vetur.

@HerringtonDarkholme
Copy link
Member

Please see #355

@neilsimp1
Copy link
Author

Thanks, I looked through other issues a few times, I don't know how I missed that.

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

No branches or pull requests

2 participants