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

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

Open
4 tasks done
mcfarljw opened this issue Jan 24, 2021 · 6 comments
Open
4 tasks done

Comments

@mcfarljw
Copy link

mcfarljw commented Jan 24, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.32.0
  • VS Code version: 1.52.1

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:

#1243

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

#1261

Reproducible Case

Screen Shot 2021-01-23 at 11 17 18 PM

@yoyo930021
Copy link
Member

yoyo930021 commented Jan 26, 2021

Duplicate of #1261

@yoyo930021 yoyo930021 marked this as a duplicate of #1261 Jan 26, 2021
@yoyo930021
Copy link
Member

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

@mcfarljw
Copy link
Author

mcfarljw commented Jan 26, 2021

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

@jasonlyu123
Copy link
Contributor

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
Copy link
Member

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

Same:

  • This diagnostics is from TypeScript language service.
  • The problem is essentially for TypeScript principle.

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
Copy link

I have the same problem

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

4 participants