Intellisense stops working after modifying includes - c++

Good evening all,
I currently have a source which behaves very unusually and I am completely stumped as to why.
The issue:
When initially opening the source, the project includes and libraries are broken
This path does not exist
However, when I attempt to amend this issue by removing the broken directories, Intellisense stops working. This is obviously a problem because Intellisense is pog. Stops working after path change
I have never seen this before and I have spent quite a while try to fix it but with no success, here are some of the things I have tried:
Including the rest of the DX9 files I needed
Trying Visual Studio 17, 19, and 22
Updating SDK and VS to latest versions
Resetting VS preferences
Also, Yes it is turned on, it breaks as soon as I change anything
I hope someone knows how to fix this thx
Edit: Here is a gif showing it in action: https://i.imgur.com/l4JsxN3.gif

Related

VSCode does not show errors before building

I use VSCode(code editor, not IDE) for C++ with only Microsoft's C++ extension and today I have encountered a problem here. When I write the wrong syntax, the "PROBLEMS" panel does not show errors. It only shows errors on building the code. Earlier that wasn't the case. How do I fix this ?
Before building:
After building:
I got that error by Disable error squiggles. If you don't reach that error in my case, don't read anymore.
After ignoring, I got your problem:
To fix this, open settings.json file:
Scroll to the end, then set "C_Cpp.errorSquiggles": from Disabled to Enabled.
After reading the question, and the comments, my understanding is that you want Visual Studio Code to tell you when you make a mistake on the sintax, without having to compile the project.
What could be wrong is your C++ IntelliSense, which is odd because it comes in bundle with the C/C++ extension from Microsoft. The extension itself might be disabled, corrupted during an aborted update, or uninstalled.
Have you tried the good old and helpful uninstall and reinstall the extension? That normally fixes my problems with extensions in Visual Studio and VS Code
Note: You have to install the extension first: C/C++ IntelliSense, debugging, and code browsing extension
This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project.
Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select
Project, and then select the correct project that you want to work with.
This will help you see the problems as you create your code without requiring you to run it.
The extension has to know that it is allowed to continuously check your code.
I hope this helps you in the future with other extensions too...
Try and close your current folder and open a different folder. Then come back to your original folder. This worked for me.

Where is snippet explorer located?

I have successfully installed the snippet designer (by Mathew Manela) and had successfully exported my own code snippet once from my VS 2017 by following the instruction from this site:
https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.SnippetDesigner
However, after I closed the VS2017 and come back and attempted to export another code snippet, I can no longer see the option to export code snippet after I highlighted the code and right clicked on it.
I wonder where has the functionality gone?
Also I no longer see the snippet explorer, which according to the link, it is located under view->other window. I did see it before I closed the vs 2017 application.
The snippet I originally created worked and is still working though, which amazes me.
I wonder what have I done incorrectly? How do I export another snippet?
I think I finally figured out what have I done wrong the hard way.
What I did earlier and probably should not have done was downloading the extension from the link above and clicked on it to install. It downloaded and installed like a champ, no complaint. It even worked for 1 time but then vanished in thin air the next time I got into VS2017. There is no way to find it. Maybe I am not supposed to click on the extension to install it outside of VS2017, but there was no warning or error message, which gave user the false impression that everything was fine.
Now, to fix the issue, I went into VS2017, Tools --> Extension And Updates and pick up the SnippetDesigner from there, re-installed it and closed VS2017 for it to finalize.
Then going back into VS 2017 and everything comes back!
Just posted my experience, hopefully someone else does not have to hit their head against the wall trying to figure out why SnippetDesigner is behaving the way I described above.

Visual Studio stopped recognizing any include files

So, I was randomly working on my project and visual studio 2017 was recognizing all my OpenCV stuff just fine, but randomly all of a sudden, it stopped recognizing it right while I was in the middle of coding it, there's errors all over the place saying that functions from OpenCV are undefined and that the source files cannot be opened, this literally makes no sense as it was just working and I had gotten stuff to compile and then all of a sudden in the middle of coding, it just will refuse to recognize anything, I'm really confused and I checked the include and library files and everything was just the same as it was when I had started out, I think something might be wrong with Visual Studio, but I have no idea what to do. I even tried restarting my computer to see if that fixed it, but I'm still stuck in the same boat :/
Edit: Interesting note, when I go to access the project properties, it no longer says properties, it just says properties, could it be a corrupt project?
Okay, so Richard Critten's suggestion of doing a chkdsk /f worked, I rebooted to have it check my main disk and now it oddly requires me to specify a folder in the include directory which I didn't have to do before which is odd, but now it's finally working and recognizing everything as it should. Thanks for the help, I just had never seen it before do that while in the middle of a project randomly which severely confused me.

(VS2017) Randomly losing reference and intelliscense

I am currently facing a weird problem with visual studio 2017 community edition.
It randomly lose all reference in the "reference tab" and the intellisense stop work at all.
It is only at design time, even with tons of "false errors" in the error window, if you compile and run, it will work just fine.
I was looking over some similar problems and one solution said to remove one tag from the .projec file.
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
I did it, at first time it worked, but after while, it randomly stopped working again. I went back to the file but that particular tag wasn't there.
The weird part is that when it happens, if I go to the reference window, it have all namespaces unselected. if I select any namespace, it throws me an error and select all corretc namespaces at same time.
After selecting the namespace, when I save the project I get this error.
If I close everything and open again, it is working just fine, until randomly stop working again.
I have tried other solutions as well but it always back to the same scenario.
It started happening after I had to delete the folder "C:\Users\xxxxxx\AppData\Local\Microsoft\VisualStudio".
I had to delete that folder because it freeze every single time I tried to open any project, the only solution that solve was deleting that particular folder.
After that the all projects open just fine, but I need to select the reference again and that when the problem starts.
It is a new project made in the current version of the visual studio, not a migration.
As suggested by #Sara Liu, I will mark
updating the visual studio to a version >= 15.5.5
As an answer to the problem.

Newly created items are not added to the solution until I close and reopen it (VS2017)

This is slowly driving me crazy. It is a problem I did not have with VS2015 and only showed up when I started using VS2017. I have upgraded to the first service pack and that did not change anything.
It is a C# .NET Core project if that matters. Any time I create a new file (e.g. Foo.cs) it doesn't seem to get associated with the solution. If I try and reference it from an existing file then the IDE doesn't recognize it and it reports an error. Any open tabs I have with these files shows them as "Miscellaneous files" where it would normally have "ProjectName(netcoreapp1.1)".
If I close the solution and then reopen it then everything works fine. Building or rebuilding the solution does not fix the issue. Is anyone else seeing this problem?