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

"Some references may be missing" warning constantly spammed in Output console not respecting the loggingLevel setting! #13066

Closed
0tii opened this issue Dec 17, 2024 · 9 comments · Fixed by #13068
Assignees
Labels
bug Feature: Find All References Find All References, Peek References, Rename fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@0tii
Copy link

0tii commented Dec 17, 2024

Environment

  • OS and Version: Windows 11 Home 23H2 - 22631.4602
  • VS Code Version: 1.96.0
  • C/C++ Extension Version: 1.22.11
  • If using SSH remote, specify OS of remote machine: -

Bug Summary and Steps to Reproduce

Bug Summary:

The warning

[Warning] Some references may be missing, because workspace parsing was incomplete when Find All References was started.2

keeps beim spammed to my output tab in the terminal. I have already tried everything i could find, adapted my c_cpp_properties.json, increased memory for intellisense and so on. It kept being spammed. Okay, I found this issue #6320 and they say the warning is "by design" - sure, no problem, makes sense to me. So then I will just change the loggingLevel through my settings, so I went and set

"C_Cpp.loggingLevel": "Error"

in both .vscode/settings.json as well as the global settings.json.

Warnings still came through, opening my console every minute or so completely shredding my train of thought every single time. Fine, then I'll go

"C_Cpp.loggingLevel": "None"

AND THE WARNING STILL COME THROUGH AND POP UP!

Please ... i just want to code undisturbed by this goddamn output terminal!

Steps to reproduce:

  1. Try to disable the warnings in output by setting "C_Cpp.loggingLevel": "Error" | "None"
  2. they still pop up

Expected behavior:

  1. Try to disable the warnings in output by setting "C_Cpp.loggingLevel": "Error" | "None"
  2. they dont pop up

Configuration and Logs

{
  "configurations": [
    {
      "name": "Win32",
      "includePath": [
        "${workspaceFolder}/src/**",                
        "${workspaceFolder}/../Deps/include/**"    
      ],
      "defines": [],
      "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
      "cStandard": "c11",
      "cppStandard": "c++17",
      "intelliSenseMode": "msvc-x64"
    }
  ],
  "version": 4
}



-------- Diagnostics - 12/17/2024, 3:27:02 PM
Version: 1.22.11
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "h:/Projects/AbandonedCrypt/FirstSoloSteps/src/**",
        "h:/Projects/AbandonedCrypt/FirstSoloSteps/../Deps/include/**"
    ],
    "defines": [],
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "intelliSenseMode": "msvc-x64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "h:/Projects/AbandonedCrypt/FirstSoloSteps/src/**",
            "h:/Projects/AbandonedCrypt/FirstSoloSteps/../Deps/include/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.maxMemory": 8000,
    "C_Cpp.intelliSense.maxMemory": 8000,
    "C_Cpp.loggingLevel": "None"
}
Additional Tracked Settings:
{
    "editorTabSize": 2,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "*.erd": "json",
        "*.vuerd": "json",
        "*.php": "php",
        "*.uss": "css",
        "*.rh": "cpp",
        "algorithm": "cpp",
        "atomic": "cpp",
        "fstream": "cpp",
        "functional": "cpp",
        "limits": "cpp",
        "system_error": "cpp",
        "type_traits": "cpp",
        "typeinfo": "cpp",
        "xmemory": "cpp",
        "xstring": "cpp",
        "xutility": "cpp",
        "vector": "cpp",
        "bit": "cpp",
        "cctype": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "compare": "cpp",
        "concepts": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "exception": "cpp",
        "initializer_list": "cpp",
        "iomanip": "cpp",
        "ios": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "iterator": "cpp",
        "list": "cpp",
        "locale": "cpp",
        "memory": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "string": "cpp",
        "tuple": "cpp",
        "unordered_map": "cpp",
        "utility": "cpp",
        "xfacet": "cpp",
        "xhash": "cpp",
        "xiosbase": "cpp",
        "xlocale": "cpp",
        "xlocbuf": "cpp",
        "xlocinfo": "cpp",
        "xlocmes": "cpp",
        "xlocmon": "cpp",
        "xlocnum": "cpp",
        "xloctime": "cpp",
        "xstddef": "cpp",
        "xtr1common": "cpp"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.22.11.0
Current database path: C:\USERS\DANIEL\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\4AE546161FD56BA38EE6E15FB0FBFFA2\.BROWSE.VC.DB
No active translation units.

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5430

Other Extensions

No response

Additional context

No response

@bobbrow
Copy link
Member

bobbrow commented Dec 17, 2024

@0tii thanks for reporting this. It appears that this specific piece of logging does not take the loggingLevel setting into account. We should fix this.

I don't remember our decision here (this code was written 5 years ago), but it seems we always wanted to log this message for some reason. Our default loggingLevel is "Error", but this message is tagged as a "Warning" since it's not an error. We have a few options of what we could do here:

  1. Continue to log the message, but don't focus the output window unless the loggingLevel is "Warning" or higher.
    • This should address the immediate annoyance but feels like it doesn't strictly adhere to the loggingLevel.
  2. Change the default loggingLevel to "Warning" and only log this if the loggingLevel is "Warning" or higher
    • This could make the output window noisier for people than they are used to - we'd have to audit the warning messages to make sure this is what we want.
  3. Leave the default loggingLevel as "Error" and only log this if the loggingLevel is "Warning" or higher
    • This makes this warning go away for almost everyone.
  4. Move the warning to the results panel instead of the output window
    • VS Code doesn't give us any formatting options for the panels. How would we work this in without making it confusing?

if (this.referencesStartedWhileTagParsing) {
const msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.",
referencesCommandModeToString(this.client.ReferencesCommandMode));
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
if (this.referencesChannel) {
this.referencesChannel.appendLine(msg);
this.referencesChannel.appendLine("");
this.referencesChannel.show(true);
}
} else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) {
const logChannel: vscode.OutputChannel = logger.getOutputChannel();
logChannel.appendLine(msg);
logChannel.appendLine("");
logChannel.show(true);
}
}

@bobbrow bobbrow added bug Language Service Feature: Find All References Find All References, Peek References, Rename labels Dec 17, 2024
@0tii
Copy link
Author

0tii commented Dec 17, 2024

@bobbrow thank you a lot for the fast turnaround, I think approach 3 seems to be the most viable one here. It would allow users to hide the log with loggingLevel "None" while still keeping its significance (seems like there was some thought behind it as you mentioned) through being printed as Error, while requiring the least amount of work to implement (from my non-extension-developer standpoint).

@bobbrow
Copy link
Member

bobbrow commented Dec 17, 2024

Thanks. I was actually leaning towards 1 being the easiest and also doesn't hide the warning since we do want people to at least see it if they actually look at their logs. We just won't throw it in your face. 4 seems like the best approach if we can find a way to get the message in the tool window tactfully. I believe Visual Studio has a similar approach.

The question that follows is why you are seeing it so much. Usually our indexing happens pretty quickly, but perhaps do you have a very large workspace with hundreds of thousands of source files? This message should eventually stop happening when we complete the first pass of indexing, but perhaps you are using Find all References a lot before it completes. Or perhaps there is some other problem causing you to be stuck in a bad state that no one else has run into yet.

@bobbrow
Copy link
Member

bobbrow commented Dec 17, 2024

I could also add a fifth option:

  1. Only allow for this message to be reported once per session.
    • We currently show the logging prominently because we don't want you to think that the extension found everything when it may not have. This information is important, however, we could maybe reword the message and only show it once.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 17, 2024

What is triggering the find all references request? What is causing tag parsing to not finish? Those seem like the root problems. The message is supposed to appear when a user invokes find all references (which shouldn't happen frequently) and tag parsing is still happening (it should stop). Otherwise, the find all references operation may be missing results. If we don't show the message, users may not realize the References results are missing values.

@0tii
Copy link
Author

0tii commented Dec 18, 2024

What is triggering the find all references request? What is causing tag parsing to not finish? Those seem like the root problems. The message is supposed to appear when a user invokes find all references (which shouldn't happen frequently) and tag parsing is still happening (it should stop). Otherwise, the find all references operation may be missing results. If we don't show the message, users may not realize the References results are missing values. (@sean-mcmanus )

I have no idea what i causing it, my settings and configs are in the dump in the issue body, I also don't run into any IntelliSense problems which could result from the incomplete workspace parsing. The paths in my includePath also don't contain a lot of files. I would love to find the root cause of this issue, but while I can not do so, I feel like constantly being interrupted by a popup terminal isn't a viable path.

The core of my issue is though, that even at loggingLevel "None" this pops up. A user has to manually specify to not even be alerted of "Error" when putting logginLevel "none" which, in my opinion, should suffice. The log message is also visibly tagged as "Warning", semantically quite explicitly grouping it into the "Warning" loggingLevel.

I personally am not affected in my DX from the incomplete workspace parsing, but I am very well being constantly interrupted by a warning log that does not respect the loggingLevel setting, pops up my exyplicitly closed terminal, and is impossible to disable.

@0tii
Copy link
Author

0tii commented Dec 18, 2024

@bobbrow you are correct, 1. seems to be the most efficient solution, for some reason I thought you said that the extension API doesn't allow for this behavior, but I must have mangled some comments I read around the same time in different issues here.

@bobbrow
Copy link
Member

bobbrow commented Dec 18, 2024

Option 1 has been implemented and will be included in the 1.23.3 pre-release.

@sean-mcmanus sean-mcmanus modified the milestones: 1.23, 1.23.3 Jan 8, 2025
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 8, 2025
@sean-mcmanus
Copy link
Contributor

@0tii Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.23.3 (pre-release).

@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Find All References Find All References, Peek References, Rename fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
Status: Done
3 participants