microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

How to diagnose a source file without configuration #8379

Open andreeis opened 2 years ago

andreeis commented 2 years ago

Currently when VSCode loads a c/c++ source file that Makefile Tools did not find an IntelliSense configuration for, we log a message in the output channel. Replace with a diagnostic item in the problems tab.

Inspired from comment about files without configuration.

bobbrow commented 2 years ago

cpptools is supposed to warn about this case with a popup, though a user can also tell cpptools never to nag about it again. Adding a problem to the problems tab or status bar for this feels like a job for cpptools, not makefile tools

Florin-Popescu commented 2 years ago

Could it be configurable by a setting whether or not this particular error would be reported? While it is useful when it indicates that a file you opened is actually never built, I also wouldn't like to pollute the Problems window with errors that show up on every header file, see #225 in makefile-tools.

Colengms commented 2 years ago

I don't believe we currently report any warning in this case. We then use the 'custom browse config' to configure the file (as it includes a compiler, args, standard).

I think we should use a "Configuration Warning". Currently, we only bring that output channel to front the first time something is logged to it. We also have an issue tracking adding a setting to optionally never bring it to the front: https://github.com/microsoft/vscode-cpptools/issues/7234