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.

Private functions used in template getting highlighted as declared but never

See original GitHub issue
  • 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:

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

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
yoyo930021commented, Jan 27, 2021

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 #1261 is in the <template> region, but this issue is in the <script>region.
  • The #1261 is a warning diagnostic, but this issue is a suggestion diagnostic.
  • They have different diagnostic code.
  • The two are maintained by different code.
  • The #1243 PR is ignoring there diagnostics in <template> region.

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.

0reactions
Mrzhangqccommented, Nov 18, 2021

I have the same problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

C++: Why must private functions be declared? - Stack Overflow
The compiler wants to know the signature of the function before it can use it. That's why you declare functions in the first...
Read more >
Templates, C++ FAQ
A template is not a class or a function. A template is a “pattern” that the compiler uses to generate a family of...
Read more >
Compiler Warnings by compiler version | Microsoft Learn
Use /Wv:19.11 to report the warnings introduced in any version of Visual Studio before Visual Studio 2017 version 15.5, but suppress warnings ...
Read more >
Code Inspection: Unused local variable - ReSharper - JetBrains
This inspection detects local variables in a method that are declared and may be assigned, but are never used. Such a variable might...
Read more >
Explicit instantiation (C++ only) - IBM
In this example, you can use the explicit instantiation definition template int X<int>::v(int) even though the member function is declared to be private....
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