vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Private functions used in template getting highlighted as declared but never #2646

Open mcfarljw opened 3 years ago

mcfarljw commented 3 years ago

Info

Problem

Something changed very recently which has caused all of my private functions only used within the templates to be highlighted as declared but never read. It appears this might be a regression as it looks like this was handled with a workaround here:

https://github.com/vuejs/vetur/pull/1243

Here is an older issue that is still open talking a bit more about the original issue that prompted the workaround:

https://github.com/vuejs/vetur/issues/1261

Reproducible Case

Screen Shot 2021-01-23 at 11 17 18 PM
yoyo930021 commented 3 years ago

Duplicate of #1261

yoyo930021 commented 3 years ago

It is same problem in #1261. Only now there are more suggestions in the script area.

mcfarljw commented 3 years ago

@yoyo930021 still don't think this is a duplicate. What do you mean by more suggestions in the script area? https://github.com/vuejs/vetur/pull/1243 was a working fix until one of the recent updates and now it has stopped working.

jasonlyu123 commented 3 years ago

Typescript error each has a code to it. From the screenshot you provides, it seems like a different one from the PR you linked. As for "`more suggestions", I think means it's a new typescript suggestion diagnostic being introduced. Which is more like a possible refactor or code smell issue.

yoyo930021 commented 3 years ago

It isn't a regression. In fact, they have similarities, but they also have differences.

Same:

Not same:

The nature of the problem is same as #1261. So I closed this issue. Now I've changed my mind. This issue can be focused on the <script> region.

Only now there are more suggestions in the script area.

They don't generate suggestion diagnostics in <script> region in the past. In v0.32.0, we start to generate suggestion diagnostics in <script> region.

Mrzhangqc commented 2 years ago

I have the same problem