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.

Code completion for props doesn't work in template

See original GitHub issue

As we see VS Code can parse props in js part of file: image

But not in template. In template editor know that props variable exists, but don’t know it’s type

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
johnsoncodehkcommented, Jan 28, 2022

This is a limitation of TS, not something volar can change, if you want type-safe in template you can just use lang="ts".

It works for js code, why can’t it work in the same way in templates?

It can’t works for js, you can add test.js from https://github.com/johnsoncodehk/volar/issues/909#issuecomment-1024153150 to your project and check it.

0reactions
johnsoncodehkcommented, Sep 21, 2022

@Akryum I don’t think TypeScript will resolve it… Does lang="ts" + // @ts-nocheck can be a option?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is code completion for subclasses not working in angular ...
I wonder how this is possible in the first place: i.e. since Array.isArray(this.anonymousArray) is true , how/why does the template even see a ......
Read more >
Props auto complete does not support function component #139
Just notice that for Class component the props auto complete(popup in editor) works very well, but for functional component, it can render ...
Read more >
React props auto-complete in VS Code - DEV Community ‍ ‍
Unfortunately, when it comes to React components, autocomplete doesn't work as well as vanilla JavaScript : By default when writing props ...
Read more >
IntelliSense in Visual Studio Code
The editor supports "tab completion" which inserts the best matching completion when pressing Tab. This works regardless of the suggest widget showing or...
Read more >
Code completion | WebStorm Documentation - JetBrains
Code completion is one of the essential features of the WebStorm editor. To show you completion suggestions, WebStorm goes through the ...
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