This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Don't run the prepare for tweaks that are disabled.
ClosedPublic

Authored by hokein on Jul 11 2019, 6:48 AM.

Event Timeline

hokein created this revision.Jul 11 2019, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 6:48 AM
hokein updated this revision to Diff 209216.Jul 11 2019, 7:35 AM

Simplify the code further based on offline discussion.

ilya-biryukov added inline comments.Jul 11 2019, 7:49 AM
clang-tools-extra/clangd/ClangdServer.h
136

NIT: the comment mentions StringRef, but function accepts a Tweak now.
Maybe update the comment?

clang-tools-extra/clangd/refactor/Tweak.h
117

NIT: maybe use function_ref here

hokein updated this revision to Diff 209223.Jul 11 2019, 8:09 AM
hokein marked 3 inline comments as done.

Address comments.

clang-tools-extra/clangd/ClangdServer.h
136

good catch, thanks!

sammccall accepted this revision.Jul 11 2019, 9:03 AM
sammccall added inline comments.
clang-tools-extra/clangd/ClangdServer.h
138

the default value should reject hidden checks, for API users. The duplication is a bit sad

clang-tools-extra/clangd/tool/ClangdMain.cpp
535

nit: -hidden-features

536

nit: seems clearer to write:

if (hidden && !HiddenFeatures)
  return false;
if (flag passed && !name matches flag)
  return false;
return true
This revision is now accepted and ready to land.Jul 11 2019, 9:03 AM
hokein updated this revision to Diff 209429.Jul 12 2019, 1:48 AM

Address comments.

hokein marked 3 inline comments as done.Jul 12 2019, 1:49 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2019, 1:50 AM