This is an archive of the discontinued LLVM Phabricator instance.

[clang-include-fixer] Added Emacs integration for clang-include-fixer.
ClosedPublic

Authored by massberg on Jul 26 2016, 6:37 AM.

Diff Detail

Event Timeline

massberg updated this revision to Diff 65504.Jul 26 2016, 6:37 AM
massberg retitled this revision from to [clang-include-fixer] Added Emacs integration for clang-include-fixer..
massberg updated this object.
massberg added reviewers: bkramer, hokein.
massberg added a subscriber: cfe-commits.
hokein edited edge metadata.Jul 26 2016, 6:59 AM

Nice! Thanks very much for making emacs integration. I'm not familiar with elisp, but it looks almost good to me. Just a few nits.

include-fixer/tool/clang-include-fixer.el
9

s/envoke/invoke

13

Could you add some documents describing how to setup the environment in emacs in docs/include-fixer.rst?

massberg updated this revision to Diff 65521.Jul 26 2016, 8:04 AM
massberg edited edge metadata.

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

  • Fixed typo
  • Added documentation how to setup tools within emacs
  • Removed unnecessary yes-no question
bkramer added inline comments.Jul 26 2016, 8:09 AM
include-fixer/tool/clang-include-fixer.el
9

clnag is another typo

massberg updated this revision to Diff 65524.Jul 26 2016, 8:11 AM

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

-Fixed documentation

massberg updated this revision to Diff 65525.Jul 26 2016, 8:13 AM

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

  • Fixed typo
massberg marked 3 inline comments as done.Jul 26 2016, 8:17 AM

Thanks for the comments. I fixed the typos and wrote a (short) documentation.

hokein added inline comments.Jul 26 2016, 8:55 AM
include-fixer/tool/clang-include-fixer.el
126

Looks like you are using an old-version of clang-include-fixer. It won't work with latest version. The latest clang-include-fixer changes this interfaces for supporting adding qualifiers for all instances of an unidentified symbol. So please update to use the latest version.

You can refer to the change of "tool/clang-include-fixer.py" in https://reviews.llvm.org/D22567.

PS. The "-output-header" option is changed from

{
   "SymbolIdentifier": "foo",
   "Range": {"Offset":0, "Length": 3},
   "HeaderInfos": [ {"Header": "\"foo_a.h\"",
                               "QualifiedName": "a::foo"} ]
}

to

{
   "QuerySymbolInfos": [
      {"RawIdentifier": "foo",
       "Range": {"Offset": 0, "Length": 3}}
   ],
    "HeaderInfos": [ {"Header": "\"foo_a.h\"",
                               "QualifiedName": "a::foo"} ]
}
massberg updated this revision to Diff 65546.Jul 26 2016, 9:44 AM

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

Now working with the newest clang-include-fixer input/output format.

massberg marked an inline comment as done.Jul 26 2016, 9:46 AM

Thanks, now supporting the new format.

hokein added inline comments.Jul 26 2016, 10:03 AM
include-fixer/tool/clang-include-fixer.el
33

You forgot to remove the private path here.

125

Is it a debug statement?

massberg updated this revision to Diff 65562.Jul 26 2016, 11:17 AM

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

  • fixed private path
  • removed debug message
massberg marked 2 inline comments as done.Jul 26 2016, 11:18 AM

Thanks for the comments!

include-fixer/tool/clang-include-fixer.el
126

You are right, removed.

hokein accepted this revision.Jul 27 2016, 1:20 AM
hokein edited edge metadata.

It looks good to me now, a few comments. Let's wait to see whether @bkramer has any further comments.

docs/include-fixer.rst
81

s/diretory/directory

include-fixer/tool/clang-include-fixer.el
24

I might be wrong, I think it is missing a " at the end?

52

code indentation.

This revision is now accepted and ready to land.Jul 27 2016, 1:20 AM
massberg updated this revision to Diff 65679.Jul 27 2016, 1:30 AM
massberg marked an inline comment as done.
massberg edited edge metadata.

Updating D22805: [clang-include-fixer] Added Emacs integration for clang-include-fixer.

  • Corrected typos and code indentation.
massberg marked 2 inline comments as done.Jul 27 2016, 1:33 AM

Thanks for the comments!

include-fixer/tool/clang-include-fixer.el
25

The ending " is two lines below.

bkramer accepted this revision.Jul 27 2016, 2:16 AM
bkramer edited edge metadata.

Looks good from my side.

This revision was automatically updated to reflect the committed changes.