Vscode-cpptools: `Include file not found...` reported for files that don't belong to the project

Created on 18 Jan 2017  路  10Comments  路  Source: microsoft/vscode-cpptools

I have opened a file from another project in Code and it keeps reporting Include file not found in include directory. Because it does this, the problem view is never empty and so the cursor for F8 (next error) is not reset for a new build, therefore F8 moves me to next of dozens of Include file not found... issues. That said, the cursor should reset when I'm making a new build (but that is probably an issue for Code itself).

image

Language Service bug

All 10 comments

If you want the "Include file not found" info message to go away you'll need to add the path to the headers to the IncludePath. Does doing that not work?

Well as I've said, the file app.cpp belongs to a different project of mine (and I opened it just for a reference), so I cannot really add include paths, as the file does not belong to the project I'm working on. Also the info doesn't go away if I close the file (and run build).

The publishing of the "Include file not found" for non-workspace files is "by design", but I suppose we could add a setting for that later. The fact that it doesn't go away on close can be considered a bug (the didClose updating was never implemented).

Can the cursor in Problem view be at least reset when I start a new build?

Our extensions doesn't control the cursor or the UI in the Problems view. You should report the issue on the Microsoft/vscode GitHub page. We just supply the string and Diagnostic info (see https://github.com/Microsoft/language-server-protocol/blob/b082a3bd761f7c50db0b538e954ac467e8aa5ba8/protocol.md#textDocument_publishDiagnostics ).

Okay, thanks for the info, I've added the issue about the cursor reset to vscode: https://github.com/Microsoft/vscode/issues/18695

I think I have a similar problem. The file was in the project directory (but not included in normal builds so I hadn't set the include path). After opening and then closing the file, the info message 'Include file not found in include directory' stayed in in problems window. So the issue is that the messages aren't removed when the file is closed. I seen a similar issue for a spelling extension (https://github.com/Jason-Rev/vscode-spell-checker/issues/54 and python (https://github.com/DonJayamanne/pythonVSCode/issues/634).

The bug where the messages aren't removed onClose has been fixed (in the C++ extension). It should be in the next update.

Awesome! <3

In 0.10.0, the "Include files missing" message goes away after the file is closed.

Was this page helpful?
0 / 5 - 0 ratings