question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intellisense isn't working as expected with @typedef and @type

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 1.38.1
  • VS Code version: 0.22.4

Problem

I’m trying to use @typedef and @type in my components but Intellisense always shows the prop as any:

image

Reproducible Case

Beyond checking with a colleague if he sees the same behaviour, which he does, I’m not sure how to reproduce this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ktsncommented, Oct 12, 2019

We can improve documentation with it I guess.

0reactions
ktsncommented, Oct 15, 2019

Since Vetur uses TypeScript feature to provide intellisense, we need to declare the extra option type in that case.

// augment.d.ts
import Vue from 'vue'

declare module 'vue/types/options' {
  interface ComponentOptions<V extends Vue> {
    status?: string
  }
}

https://vuejs.org/v2/guide/typescript.html#Augmenting-Types-for-Use-with-Plugins

Read more comments on GitHub >

github_iconTop Results From Across the Web

VScode c/c++ addon gives error to "typedef unsigned _ExtInt ...
So, I have this ubuntu20.04 on wsl with vscode running on it. ... expected a type specifier at FPBITS and expected a ';'...
Read more >
C++ Intellisense fails to correctly recognize a typedef when it's ...
I use Visual Studio integrated development environment (IDE), I'm developing a C ++ language code. Placing the text cursor on a variable,there are...
Read more >
Visual Studio False Build Errors - Microsoft Q&A
I am working on a C++ project and am having trouble with false build errors. This used to happen every once in a...
Read more >
IntelliJ does not recognize typedef in JSDoc - YouTrack
The Article type is not recognized as a valid type even though the article definition is valid and declared right above. Furthermore, IntelliJ...
Read more >
The IntelliSense feature does not work for the ...
When you use the IXMLDOMDocumentPtr smart pointer in the code that is generated when you import the Mmsxml4.dll file in your project in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found