projectGenerator icon indicating copy to clipboard operation
projectGenerator copied to clipboard

VSCode template - intelissense issues

Open dimitre opened this issue 2 years ago • 7 comments

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?

Screenshot 2023-11-06 at 10 54 29

dimitre avatar Nov 06 '23 14:11 dimitre

@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.

image

These are the only extensions I have installed: image

ofTheo avatar Nov 06 '23 16:11 ofTheo

Yeah it is the same here. asdf was just to introduce an error. is intellisense working for you?

dimitre avatar Nov 06 '23 17:11 dimitre

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.

ofTheo avatar Nov 06 '23 17:11 ofTheo

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.

dimitre avatar Nov 06 '23 22:11 dimitre

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

danoli3 avatar Dec 14 '23 07:12 danoli3

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. image

EDIT: My issues were resolved by...

image

discohead avatar Dec 24 '23 00:12 discohead

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?

Capture d’écran, le 2023-12-24 à 14 41 50 Capture d’écran, le 2023-12-24 à 14 42 20

artificiel avatar Dec 24 '23 20:12 artificiel