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
intellisense not working for project headers #195
Comments
I too am running into this issue, or a very similar issue with Visual Studio 2017 15.4. I have a single project (library) and specified all my file includes like Additionally, other external libs I'm referencing includes from do not show up either. I think 'CMake' should be added to the title. EDIT: On further investigation, my bug makes sense. Since VSLinux doesn't have a way to pull includes from the remote box, includes don't work when targetting Linux. However, if I change my cmake target to Windows, I'm able to view all includes. It'd be nice if we could somehow use the |
I'm still experiencing the same issue with the latest version - has there been any update on this? |
I've found a workaround for this. You have to add |
It's not possible to change IncludePath directly for CMake projects, right?
Because these only have the CMake files and one small CMakeSettings.json.
Or is there another way to change this variable?
I tried it with specifying a CppProperties.json but that one also seems to
be completely ignored.
…On Thu, Jan 3, 2019, 16:40 Sven Bieg ***@***.*** wrote:
I've found a workaround for this. You have to add $(SolutionDir) and
$(ProjectDir) to $(IncludePath) instead of $(AdditionalIncludeDirectories),
then IntelliSense recognises the project-files!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#195 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNwxUKRCaM-6StVO3tdF4dt3pZaeLgFks5u_iRugaJpZM4P4GLP>
.
|
Hi, there was a bug in this that we just fixed, target_include_directories will absolutely work with the bug fix, it was a bug that it didn't work before, currently we are expecting a full remote path in there, could you tell me if you use relative paths? |
Yes, relative, as in the example from my first post - the target include
directory includes .. - its parent directory.
target_include_directories(a1 INTERFACE ..)
So, that's why further includes to that library are done as a1/a1.h (dir
name from the parent plus header file name)
…-Floris
On Thu, Jan 3, 2019, 19:54 Ion Todirel ***@***.*** wrote:
Hi, there was a bug in this that we just fixed, target_include_directories
will absolutely work with the bug fix, it was a bug that it didn't work
before, currently we are expecting a full remote path in there, could you
tell me if you use relative paths?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#195 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNwxXHHT0E4sEjt0X1Ftidk_B2ptQPqks5u_lHJgaJpZM4P4GLP>
.
|
@itodirel Does 'just fixed' mean that it's in any (preview) release already or that it's still in testing? |
@itodirel any update on when it'll be available? |
I just tried my previously attached example (CMakeProject1.zip) with the latest release of VS 2019 Preview 2.1. It has definitely not been fixed - the problem is exactly the same as with any other release of VS. |
@itodirel if not fixing the issue, can you at least remove the 'fixed' label from the issue on github, as it has not been fixed yet? |
I'm having similar issues but I am confused whether it's the same. I have done this: `# Project Root Cmake add_subdirectory("my_interface_lib") `# Interface Library Subdir Cmake target_include_directories( Intellisense not working at all for #include < or " :( |
hi @danielmrussell - that's quite possibly the same. Microsoft abandoned this site for issue tracking though. Could you please upvote if you want to indicate to Microsoft that this is an issue? |
This issue is being tracked with a feedback ticket, and it has been fixed. We have retired this issue list, here on Github. We now adopted and are using the Developer Community (https://developercommunity.visualstudio.com/spaces/62/index.html), for Cross Plat and Linux experiences (and C++ all up generally), which we are actively monitoring. Please use the Developer Community, to report issues or suggestions for bugs or new experiences. Further discussions on this thread here on Github might be unmonitored. If there is further comments or context to this current issue, please create a new issue on the Developer Community, and provide the context there. For any existing issues, which we can or able to reproduce, or for anything that is actionable to us and understood, we will provide an update right here in this thread. Additionally, for new suggestions or new issues, which at this time are in our roadmap, or for which we believe and have evidence that broadly and/or significantly benefit everyone, we will open a suggestion ticket, and link it here. For anything else, we recommend to please open a ticket on the Developer Community. That isn't because we will not look at the problem, or not investigate it otherwise, but simply because we need additional information. And for features, we are tracking them on the Developer Community. |
Please use the following bug reporting template to help produce actionable and reproducible issues:
Intellisense fails to recognize .h includes. Suppose we have the following directory structure:
a
...a1
.......a1.h
........a1.cpp
.......CMakeLists.txt
...a2
......a2.h
.......a2.cpp
.......CMakeLists.txt
a1 is a library, CMakeLists.txt in that directory specifies:
target_include_directories(a1 INTERFACE ..)
a2 is an executable. CMakeLists.txt in that directory specifies a dependency on a1 by target_link_libraries.
a2 includes a1.h by #include <a1/a1.h>.
Expected results
Intellisense recognizes the include file.
Actual results (with build output window contents if applicable)
Intellisense does not recognize the include file.
It does however recognize include files like #include <a1.h> directly, without prefixing with the directory a1.
CMake runs OK remotely. Build also OK.
VC++ version, Linux system name and version, GCC/GDB/gdbserver version, CPU arch, etc. If you are using a specific version of Linux on an embedded board, we might need to know about it to get a repro on similar hardware
VS2017.5 preview, ubuntu 17.04, GCC6, CMake 3.9
Steps required to reproduce the error
See above.
Required packages and commands to install
The text was updated successfully, but these errors were encountered: