Skip to content

Add argument to parse headers via a source's flags#58

Open
Steelskin wants to merge 1 commit intocompnerd:mainfrom
Steelskin:fabrice/add-cdb-source-parameter
Open

Add argument to parse headers via a source's flags#58
Steelskin wants to merge 1 commit intocompnerd:mainfrom
Steelskin:fabrice/add-cdb-source-parameter

Conversation

@Steelskin
Copy link
Copy Markdown

idt requires input to have an entry in the compilation database in order to be properly parsed. This is not always the case when parsing headers, depending on the project configuration.

This change adds --cdb-source=<path>. When set, idt looks up <path> in the compilation database and adjusts the command line to parse the positional argument with the same flags as <path>, assuming that the positional argument is a header.

Fixits are gated behind the is_in_main_tu() helper when --cdb-source is set to prevent spilling of fixits outside of the positional input. The helper is a no-op otherwise, preserving existing behavior.

idt requires input to have an entry in the compilation database in order
to be properly parsed. This is not always the case when parsing headers,
depending on the project configuration.

This change adds `--cdb-source=<path>`. When set, idt looks up `<path>`
in the compilation database and adjusts the command line to parse the
positional argument with the same flags as `<path>`, assuming that the
positional argument is a header.

Fixits are gated behind the `is_in_main_tu()` helper when `--cdb-source`
is set to prevent spilling of fixits outside of the positional input.
The helper is a no-op otherwise, preserving existing behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant