Lines Matching +refs:clang +refs:include +refs:fixer
8 management of ``#include`` directives in any file.
9 :program:`clang-include-fixer` addresses one aspect of this problem by providing
10 an automated way of adding ``#include`` directives for missing symbols in one
13 While inserting missing ``#include``, :program:`clang-include-fixer` adds
20 To use :program:`clang-include-fixer` two databases are required. Both can be
30 correspond to. Then the :program:`clang-include-fixer` can automatically pick
32 ``compile_commands.json`` as generated by CMake does not include header files,
35 .. _How To Setup Tooling For LLVM: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
40 The include fixer contains :program:`find-all-symbols`, a tool to create a
49 $ ninja clang-include-fixer // build clang-include-fixer tool.
52 …$ path/to/llvm/source/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-sym…
53 ... wait as clang indexes the code base ...
57 $ /path/to/clang-include-fixer -db=yaml path/to/file/with/missing/include.cpp
58 Added #include "foo.h"
62 To run `clang-include-fixer` on a potentially unsaved buffer in Vim. Add the
67 …noremap <leader>cf :pyf path/to/llvm/source/clang-tools-extra/clang-include-fixer/tool/clang-inclu…
69 This enables `clang-include-fixer` for NORMAL and VISUAL mode. Change
70 `<leader>cf` to another binding if you need clang-include-fixer on a different
76 Make sure vim can find :program:`clang-include-fixer`:
78 - Add the path to :program:`clang-include-fixer` to the PATH environment variable.
79 …clang_include_fixer_path`` in vimrc: ``let g:clang_include_fixer_path=path/to/clang-include-fixer``
86 - ``let g:clang_include_fixer_path = "clang-include-fixer"``
88 Set clang-include-fixer binary file path.
101 Set to 1 if you want to jump to the new inserted ``#include`` line. Default is
106 Set to 1 if you want to insert ``#include`` for the symbol under the cursor.
110 See ``clang-include-fixer.py`` for more details.
114 To run `clang-include-fixer` on a potentially unsaved buffer in Emacs.
115 Ensure that Emacs finds ``clang-include-fixer.el`` by adding the directory
116 containing the file to the ``load-path`` and requiring the `clang-include-fixer`
121 (add-to-list 'load-path "path/to/llvm/source/clang-tools-extra/clang-include-fixer/tool/"
122 (require 'clang-include-fixer)
125 ``M-x clang-include-fixer``. This will insert the header that defines the
129 To include the header that defines the symbol at point, run
130 ``M-x clang-include-fixer-at-point``.
132 Make sure Emacs can find :program:`clang-include-fixer`:
134 - Either add the parent directory of :program:`clang-include-fixer` to the PATH
136 ``clang-include-fixer-executable`` to point to the file name of the program.
142 :program:`clang-include-fixer` runs in tandem with the parse and receives
145 it emits a callback to the include fixer which then looks for a corresponding
150 header file is returned it is added as an include directive at the top of the
153 Currently :program:`clang-include-fixer` only inserts a single include at a
154 time to avoid getting caught in follow-up errors. If multiple `#include`