Comments (12)
@g-arjones See https://github.com/microsoft/vscode-cpptools-api . We could move this feature request there.
from vscode-cpptools.
Thanks!
We could move this feature request there
Sounds good to me!
from vscode-cpptools.
I believe the feature has been requested already: microsoft/vscode-cpptools-api#50
from vscode-cpptools.
As far as I understood, the other one proposes the construction of a SourceFileConfigurationItem
from a compilation database (a.k.a. parse it and fill the existing fields). My suggestion was to extend SourceFileConfigurationItem
to include a compileCommands
member and then leverage what's already implemented in vscode-cpptools/IntelliSense.
Would fit my use case as well but not the same. I think my suggestion is simpler to implement.
from vscode-cpptools.
(a.k.a. parse it and fill the existing fields)
I believe they said they had started doing that, but wanted to just give us the compile_commands.json so they wouldn't have to do it.
Currently I am trying to parse out the
command
portion of the compile_commands.json to get the compiler args/fragments, and building up thecompilerFragments
list, but it would be so much better to point at compile_commands.json directly, similar to how it is being done in the c_cpp_properties.json config.
from vscode-cpptools.
Yeah... I understood they wanted something like:
let config = SourceFileConfigurationItem("path/to/compile_commands.json");
// ... the file is parsed by **vscode-cpptools-api** (no changes to the interface)
// and the existing members are set
What I am suggesting is:
let config = SourceFileConfigurationItem();
config.compileCommands = "path/to/compile_commands.json";
// requires adding `compileCommands` to `SourceFileConfigurationItem`
// parsing is done by vscode-cpptools/IntelliSense (I'm not sure which one consumes the compilation db)
// `config` may have nothing set aside from `SourceFileConfigurationItem.compileCommands`
That's how I typically use c_cpp_properties.json
(the only option I set is compileCommands
)
from vscode-cpptools.
To be clear: I would be fine with either. Is anything like this currently a planned feature?
from vscode-cpptools.
The difference between the two examples you provided looks like an implementation detail and I believe either would achieve the same purpose. However, since the SourceFileConfiguration[Item]
interfaces are at a level more granular than a compile commands database, we probably wouldn't want to expose it there. I think a new ProjectConfiguration
or similar interface needs to be designed so that information about all known files can be provided up front.
@Colengms and I have discussed the project configuration concept before but we haven't scheduled this work yet due to competing priorities. It's possible that much of this work could be done in the Open Source portions of our codebase and we would accept help from someone in the community if they had the time to look into it.
from vscode-cpptools.
I think a new ProjectConfiguration or similar interface needs to be designed so that information about all known files can be provided up front.
Doesn't a compileCommands
fit in WorkspaceBrowseConfiguration
?
I may find some time to help with the implementation if you guys can help with design and planning. I'm not familiar with this codebase and unfortunately cannot look deep into it.
from vscode-cpptools.
Doesn't a
compileCommands
fit inWorkspaceBrowseConfiguration
?
It could, but the browse configuration is only looking for file paths to scan. It doesn't help with the IntelliSense configuration. The ProjectConfiguration
(or similar) would conceptually be a merger of the browse configuration and an array of all SourceFileConfigurations known to the project. I haven't spent a ton of time thinking about the design yet, but if an extension supported the ProjectConfiguration, we would only request that object and not request separate WorkspaceBrowseConfigurations or individual SourceFileConfigurations - I would expect that all of that information is provided up front. A compile commands database would satisfy those requirements.
from vscode-cpptools.
That makes sense.
I haven't spent a ton of time thinking about the design yet
Please, let me know if/when you do. I'll be happy to take care of the implementation since that would save me a lot of work on a feature I'm working on.
from vscode-cpptools.
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.
from vscode-cpptools.
Related Issues (20)
- Display additional Doxygen tags in tooltip documentation HOT 4
- C_Cpp.codeAnalysis.exclude does work with ${workspaceFolder} or ${workspaceFolder]/** HOT 8
- integrated terminal does not support std::thread output HOT 1
- Annoying false-positives in C code HOT 7
- Version v1.20.5 does not find standard headers HOT 5
- After setting win11 folder with file name case sensitive, IntelliSense can't parse symbol HOT 4
- Duplicate Intellisense Hints HOT 6
- Constants defined c++ highlight not working HOT 2
- class "_PEB::<unnamed>" has no field "ImageUsedLargePages" HOT 4
- C/C++ tag parsing status is not in a busy state when the status shows "Initializing..."
- Undefined functions do not report errors HOT 4
- Undefined reference to `WinMain` HOT 5
- Is the warning a bug or a setting problem?
- Semantic token for _countof macro specifically is incorrect HOT 4
- Have trouble when Run VS Code outside the Developer Command Prompt HOT 4
- Dumps cores a lot HOT 2
- strdup missing from intellisense HOT 6
- IntelliSense completion fails to give results in many cases -- after return/public and before a comment (works in VS) HOT 1
- [Regression] The 'Learn how to install a library for this header with vcpkg' option has disappeared HOT 5
- Found a Spelling mistake in the code snippet in time_t description HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cpptools.