Skip to content

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

Closed

Description

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?

Activity

  1. MathiasMagnus commented on Oct 24, 2017

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

  2. bobbrow commented on Oct 24, 2017

    @bobbrow
    Contributor

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

  3. MathiasMagnus commented on Oct 24, 2017

    @MathiasMagnus
    Author

    Thanks Bob Brown (@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.

  4. bobbrow commented on Oct 24, 2017

    @bobbrow
    Contributor

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

  5. 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[/+] on Jul 16, 2018
  6. sean-mcmanus commented on Sep 28, 2018

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

  7. added this to the Backlog milestone on Oct 30, 2019
  8. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on May 8, 2020
  9. elahehrashedi commented on May 13, 2020

    @elahehrashedi
    Contributor

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

  10. locked and limited conversation to collaborators on Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions