Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upc/cpp: Use compile_commands if present to determine compiler args #78
Conversation
The old behavior without a compile_commands.json present in the working dir was kept available. If a this file is present, the new mechanism will use the actual compiler flags as specified by the build system to parse the actual file the user is working in and retrieve info about the token under the user's cursor.
|
I just realized that I committed under the wrong author name. I will fix this soon, please hold off on merging for now. |
| output['name'] = node.spelling | ||
| output['returnType'] = node.result_type.spelling | ||
| output['parameters'] = [] | ||
| output["name"] = node.spelling |
| """ | ||
| Check the actual cpp file with the compile arguments retrieved from compile_commands.json. | ||
| :param filename: file to check |
kkoomen
Feb 14, 2020
Owner
Capitalize the first letter of a description and add a period to the end of a description. The same goes for other comments.
sure Thanks for your time for doing this. I really appreciate it. I haven't reviewed your code yet functionality-based, but it looks good enough. I'm not an experienced C dev, so any help I get is appreciated.
It is preferred that we look from the cwd up until root (
This is true, since DoGe defines multiple patterns in the Detecting the last pattern requires a bit more work and I'll help you with it once we confirmed the caching strategy is an option. |
|
Closing due to new rewrite where clang is no longer needed, see #101. |
The old behavior without a compile_commands.json present in the working
dir was kept available. If this file is present, the new mechanism
will use the actual compiler flags as specified by the build system to
parse the actual file the user is working in and retrieve info about the
token under the user's cursor.
Prelude
Thank you for helping out DoGe!
By contributing to DoGe you agree to the following statements (Replace
[ ]with[x]with those you agree with):Why this PR?
In environments where the compiler generates a compile commands database (compile_commands.json). The clang toolchain can use this database to parse files in the exact way the compiler would. This enables reliable identification of the token type for which the user has requested documentation to be generated and associated tokens, such as parameters.
This PR is probably par from perfect, but it improves upon the existing mechanism if a compile commands database is present. The old mechanism for parsing has been preserved.
It should be noted that: