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

Add header search paths to c_cpp_properties.json #22

Closed
sebastient opened this issue Aug 24, 2016 · 14 comments
Closed

Add header search paths to c_cpp_properties.json #22

sebastient opened this issue Aug 24, 2016 · 14 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature in progress actively being working on
Milestone

Comments

@sebastient
Copy link

Currently we need to manually add the search paths to c_cpp_properties.json but it would be nice if this could be done automatically based on what cmake discovers during configure.

@vector-of-bool
Copy link
Contributor

I strongly wish to have greater support for tools to automatically consume information from the build system. For example, I work on many projects at both work and home that have drastically variable include paths and compiler options/definitions. It would be great to have my tools automatically pick up the appropriate flags.

This is possible for me to implement; however: I have an open pull request open with vscode-clang, and there is an open issue with vscode-cpptools, both of which are related to consuming the compile_commands.json file generated by build tools (including CMake). I'd rather that these tools be able to recognize the compile_commands.json file format themselves.

Unfortunately, vscode-clang seems to have stagnated since late April, with no updates or communication from the maintainer. Being one of the most popular extensions, I'm quite disappointed and greatly wish that we could get some information.

As for vscode-cpptools, the issue has been open for a while, but without much feedback from Microsoft. I'd recommend voting on the related issues/PRs to see if we can get some upstream support for compile_commands.json, which would be generally more reliable/useful that anything I could even do within my own extension.

@agauniyal
Copy link

@vector-of-bool that plugin should be built using language server feature and not as a plain plugin. You'll see completions lagging with a large code.

@lygstate
Copy link
Contributor

Ping for this.

@lygstate
Copy link
Contributor

@MathiasMagnus
Copy link
Contributor

There is a thread on the MS C/C++ extension issues list on how to notify the C/C++ extension of header files and how the IntelliSense engine pick up modification automatically. See here.

@MathiasMagnus
Copy link
Contributor

Allow me to ping this topic with the addition that it is not just the c_cpp_properties.json file that could be updated based on cmake server mode output, but also the C/C++ executable targets could be added to the launch.json file. This is virtually the last thing needed for VS Code to be a fully functional C++ IDE. (And #117)

@vector-of-bool
Copy link
Contributor

@MathiasMagnus, you should be able to use a ${command:cmake.debugTargetProgramPath} substitution within launch.json.

(Unfortunately, there's still quite a few things I haven't documented in full, although all features are at least touched on in the changelog when they were added)

@vector-of-bool vector-of-bool added enhancement an enhancement to the product that is either not present or an improvement to an existing feature in progress actively being working on labels Jun 4, 2017
@vector-of-bool vector-of-bool added this to the 0.10.0 milestone Jun 4, 2017
@vector-of-bool vector-of-bool modified the milestones: Backlog, 0.10.0 Jun 16, 2017
@bobbrow
Copy link
Member

bobbrow commented Jul 18, 2017

We have committed to support reading from the compile_commands.json file in the Microsoft C/C++ extension. Would adding a property to the c_cpp_properties.json file where you can direct the extension to find your compile_commands.json file be sufficient to resolve this issue? Or would it more align with your expectations to add a new workspace setting in settings.json where you could tell us where the file is? Do you ever expect to have more than one compile_commands.json file per workspace?

@a-teammate
Copy link

@vector-of-bool did you see @bobbrow's comment?

@vector-of-bool
Copy link
Contributor

@a-teammate, yes. The cpptools extension added support for compilation databases a while ago, although not in full. Development is ongoing on both sides. If compilation database support reaches a certain threshold of support, having CMake Tools manipulate c_cpp_properties.json will be unnecessary.

@loaden
Copy link

loaden commented Mar 29, 2018

ping

@vector-of-bool
Copy link
Contributor

@loaden, MS has been working on compilation database support and even recently released a few more bugfixes/improvements. What are you "ping"-ing about in particular?

@vector-of-bool
Copy link
Contributor

It's been a long time. But I have good news. Keep an eye out for 1.1.0.

@vector-of-bool vector-of-bool modified the milestones: Backlog, 1.1.0 Jun 27, 2018
@lygstate
Copy link
Contributor

good

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature in progress actively being working on
Projects
None yet
Development

No branches or pull requests

8 participants