Skip to content
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

VSCode template - intelissense issues #438

Open
dimitre opened this issue Nov 6, 2023 · 7 comments
Open

VSCode template - intelissense issues #438

dimitre opened this issue Nov 6, 2023 · 7 comments

Comments

@dimitre
Copy link
Member

dimitre commented Nov 6, 2023

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
@ofTheo
Copy link
Member

ofTheo commented Nov 6, 2023

@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

@dimitre
Copy link
Member Author

dimitre commented Nov 6, 2023

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

@ofTheo
Copy link
Member

ofTheo commented Nov 6, 2023 via email

@dimitre
Copy link
Member Author

dimitre commented Nov 6, 2023

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.

@danoli3
Copy link
Member

danoli3 commented Dec 14, 2023

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

@discohead
Copy link

discohead commented Dec 24, 2023

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

@artificiel
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants