[clang-include-fixer] Added Vim integration for clang-include-fixer.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
| include-fixer/tool/ClangIncludeFixer.cpp | ||
|---|---|---|
| 51 ↗ | (On Diff #57474) | This isn't really specific to vim, we should name it differently. '-stdin' maybe? Then document what it really does. |
| include-fixer/tool/clang-include-fixer.py | ||
| 38 ↗ | (On Diff #57474) | yaml is the default, maybe we shouldn't specify it here? Or leave the user a way to configure it. |
| 49 ↗ | (On Diff #57474) | This always inserts at the top. Can we emit the position where to insert from the tool and put it there? |
| include-fixer/tool/ClangIncludeFixer.cpp | ||
|---|---|---|
| 51 ↗ | (On Diff #57474) | I think we can make the include-fixer accept stdin input by default if there is no command-line file path. In this case, there is no need to add a command-line option here. |
| include-fixer/tool/clang-include-fixer.py | ||
| 50 ↗ | (On Diff #57474) | Add if __name__ == '__main__':. |
- Changed VimMode to STDINMode, and made clang-include-fixer return insertion line number in this mode.
- Added -db, -input options into Vim integration.
| include-fixer/tool/ClangIncludeFixer.cpp | ||
|---|---|---|
| 51 ↗ | (On Diff #57474) | We can't get the compile options for the code if we only accept <stdin> input (without the corresponding file path). |
I expect the insertion code in the python part to cause trouble in the future again but I guess this is fine for now.
Can you add a section to include-fixer.rst on how to set this up?