VSCode template - intelissense issues
I can't get intellisense working with the latest vscode template. one curiosity, when it indicate problems it seems to get the wrong path (the first slash is missing like in attached image) Is there something missing from the configuration? maybe a settings.json file with makefile configuration? Can you check it with latest nightly? @ofTheo @NickHardeman?
@dimitre is asdf defined? or are you saying if you click on the problem it doesn't jump to the file ( it did for me ).
I just tried with the nightly. Used the PG to make a project for Linux64 for the assimp example. Then opened it. I did click the allow makefile configure when the project opened.
These are the only extensions I have installed:
Yeah it is the same here. asdf was just to introduce an error. is intellisense working for you?
Yeah, it’s working great for me. Can you try testing it from your downloads folder?
Also the intellisense can take some time to generate so if you are on an older machine it might take more time before it kicks in.
Finally it is working for me, I've wiped out Visual Studio Code with AppCleaner and installed from scratch. I've noticed it offers to install CMake extension, and we have to decline all to make it work as expected.
Intellisense and VS / VSCode notoriously break for no specific reason.
It has to be a cache issue or something in the system gets looped and stuck processing something. I would switch between VS studio and VS Code while one was broken for this over the years. Reinstalling / cleaning caches sometimes worked
Any ideas for specific locations of how to destroy / flush the cache locations would be ideal to be documented
I'm just testing this out on the current nightly build of_v20231223_osx_release on macOS 13.6.3 (M2) and indeed, as @danoli3 says, it seems the intellisense breaks for no reason. It was working at first but now I'm back to #include errors detected everywhere. Project builds/runs/debugs just fine.
EDIT: My issues were resolved by...
here's what I did on macOS14:
- download vscodium as a normal user (placed in an arbitrary directory)
- download OF12.0
- launch vscodium, install the clangd extension
- open
3DPrimitivesExample.code-workspace - (incorrect syntax hilight -- OF stuff looks like errors; more below)
- run build task / run release -> compiles and runs
to get correct completion, clangd relies on the compile_commands.json file. to generate I did (in the 3D primitive dir):
brew install bear # of course only needed once
bear -- make
then syntax highlight works (with the single clangd extension installed). considering the computer has a complete Xcode install, perhaps some things are found within the system (would have to try on a Xcode-less machine).
as I understand, adding a file to a project requires updating compile_commands.json for clangd to "know" how to interpret it. a CMake project will update it's compile_commands.json automatically, otherwise bear seems the usual thing to do. I don't know if that's ideal, but for a lot of users (and the examples) providing a default compile_commands.json is probably reasonable.
NOTE: I'm not using VScode for OF and I'm not sure if debugging is available. maybe there are ways to make the compile_commands.json easier to manage?