Comments (7)
It's creating a new TU for the #include
d .cpp files instead of using main.cpp's TU. @Colengms Do you know anything about this?
It works in VS (with a project).
from vscode-cpptools.
This is because the C/C++ Extension will currently assume that a file with a source extension such as .cpp
can be interpreted independently, not as a header of another source file. We could improve this for your scenario by always performing a (costly) lookup to detect this scenario, when opening any file instead of just those with header extensions. We can use this issue to track implementing that.
from vscode-cpptools.
That makes sense, but i am still confused as to why it worked before. I have used this style for projects for a few years now and it always worked. I only noticed that when i opened the files independently the lookup does not work. But when i opened my projects as a whole workspace or as the whole folder the lookup worked. That made sense to me and I always assumed it was an IntelliSense feature to notice things within the workspace and that the other source files are included in the main.cpp. Could there be an explanation why it worked before?
from vscode-cpptools.
@Colengms This is a 1.19.4 regression, i.e. it works correctly with 1.18.5. @Sochsenfeld You should be able to downgrade to 1.18.5 and it should work.
from vscode-cpptools.
Amazing, thank you! That works for now!
from vscode-cpptools.
@Colengms This is a 1.19.4 regression, i.e. it works correctly with 1.18.5. @Sochsenfeld You should be able to downgrade to 1.18.5 and it should work.
This also affects #include MACRO_NAME
forms when the a file is included in the source (or the header file) designated by MACRO_NAME
indirectly after macro expansion. However in this case the downgrade also does not work. The behavior is a slightly different: 1.18.5 would still generate further diagnostics about the failure on subsequent multiple #include MACRO_NAME
lines, while 1.19.4 would only complain at the first line. Perhaps better a separate issue?
(NOTE: The value of includePath
contains something like ${workspaceFolder}/**
. Without **
there is no problem.)
from vscode-cpptools.
@Sochsenfeld @FrankHB Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.19.5
from vscode-cpptools.
Related Issues (20)
- #include completion incorrectly completes -isystem includes in `#include ""` HOT 1
- crashes on startup HOT 15
- rename function name doesn't work in C project HOT 8
- Designated initializers squiggles HOT 1
- Debugging on WSL - Must kill the integrated terminal after each debugging session, or gdb will not launch.
- C long double bug HOT 1
- 调试控制台显示异常的汉字
- CPP2 - Modules HOT 2
- IntelliSense not linting code if headers are incorrect. HOT 1
- Single step in debugger collapses all variables being watched
- __attribute__((packed)) breaks intellisense HOT 21
- JSDoc-style multi-line comments are wrongly indented HOT 1
- outline view doesn't keep updated when adding/removing code HOT 3
- Allow configuration providers to provide the `compileCommands` file path HOT 11
- On Windows arm64 with LIBPATH set: command-line error: invalid option: --using_directoryC/C++(571) HOT 1
- Outline for C is wrong. HOT 5
- Spurious Intellisense Errors on MacOS CMake project HOT 3
- Parsing Open Files Stuck in Infinite Loop HOT 12
- The GitHub readme is great, but the marketplace readme is bare HOT 1
- Cannot find c++ std headers even manually set include path. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cpptools.