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

browse.path not set automatically when using compile_commands.json #1163

Closed
MathiasMagnus opened this issue Oct 24, 2017 · 6 comments
Closed
Assignees
Labels
Feature: Compile Commands Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@MathiasMagnus
Copy link

I have VS Code 1.17.2 with CppTools 0.14.0 and CMakeTools 0.10.2 and there are some problems with the IntelliSense engine lighting up.

Relevant entries from settings.json

// CMake Configuration
  "cmake.cmakePath": "C:/Kellekek/Kitware/CMake/3.9.0/bin/cmake.exe",

// C/C++ Configuration
  "C_Cpp.intelliSenseEngineFallback": "Disabled",
  "C_Cpp.loggingLevel": "Information"

Because all my C++ projects are CMake based, I turn off the Tag-based engine, because I want to make sure. IntelliSense errors should always be compilation errors (as it usually is in big brother VS).

In c_cpp_propertires.json under Win32 I got

"compileCommands": "${workspaceRoot}/build/compile_commands.json"

Once I do this, symbols show in the hover tooltips correctly (std::vector<T, alloc<T>>::cend() shows properly with correct return type), but trying to navigate there in code does not work. The blue tooltip says No definition found for 'cend'.

Am I doing something wrong?

@MathiasMagnus
Copy link
Author

The log.txt of the extension only argues about

Unable to retrieve file system information for C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*. error = -1

which seems fair enough, because the STL headers are not located in that folder, because VS is installed in a non-default location, hence there's nothing to find in the folder where the log entry suggests to find system information.

@bobbrow
Copy link
Member

bobbrow commented Oct 24, 2017

code browsing (navigation) is still powered by the tag parser engine, so you still need to set "browse.path" for the time being.

@MathiasMagnus
Copy link
Author

Thanks @bobbrow for the heads up. I am preparing slides for a seminar series at my institute on Nov. 20-21 where I wanted to demo the new awesome in VS Code, how I finally caught up to big brother VS in terms of C++ usability in the context of CMake. It seems code navigation did not make it into this release. Could I hope to incorporate this feature if I made my slides on the 19th? :)

Really, the less json I have to show to people, the better the impression is. I am surprised that only the hotkey menu received a GUI, but not the ordinary settings.json.

@bobbrow
Copy link
Member

bobbrow commented Oct 24, 2017

Unfortunately, this will not be ready in November. When opening a new folder without a c_cpp_properties.json file in it, we should (hopefully) be picking a reasonable set of defaults for you (system includes + workspaceRoot).

@microsoft microsoft deleted a comment from Flamefire Jul 16, 2018
@microsoft microsoft deleted a comment from Flamefire Jul 16, 2018
@microsoft microsoft deleted a comment from Flamefire Jul 16, 2018
@microsoft microsoft deleted a comment from Flamefire Jul 16, 2018
@microsoft microsoft deleted a comment from Flamefire Jul 16, 2018
@bobbrow bobbrow changed the title CppTools + compile_commands.json + CMakeTools + Go to Definition = No definition found for symbol browse.path not set automatically when using compile_commands.json Jul 16, 2018
@sean-mcmanus
Copy link
Contributor

Go to Defintion on std::vector<>::cend() should work with 0.19.0. I don't think the browse.path population with compile_commands.json was implemented though.

@elahehrashedi
Copy link
Contributor

This issue is fixed in 0.28.0.
0.28.0 release: https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Compile Commands Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

4 participants