This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Introduce config parsing for External blocks
ClosedPublic

Authored by kadircet on Nov 4 2020, 2:15 AM.

Details

Summary

Enable configuration of remote and static indexes through config files
in addition to command line arguments.

Diff Detail

Event Timeline

kadircet created this revision.Nov 4 2020, 2:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2020, 2:15 AM
kadircet requested review of this revision.Nov 4 2020, 2:15 AM

LG (comment nits) thanks!
(Meta-point: not sure how useful splitting this patch out from the compile step is...)

clang-tools-extra/clangd/ConfigFragment.h
165

I'd move the file-take-precedence-over-server part to server.

Or even just say only one source (file/server) should be configured, leave the behavior unspecified, and report an error when compiling the fragment.

165

"Configuration information for" is redundant here.

maybe just

/ An external index uses data source outside of clangd itself.
/ This is usually prepared using clangd-indexer.

170

nit: I'm not sure "monolithic" is a useful qualifier to the audience here.
Path to an index file generated by clangd-indexer?

171

Generalize this as "Relative paths may be used, if the config fragment is associated with a directory."?

173

Should we mention slashes here too? :-\

Maybe we should just lift "all paths use forward-slashes" to a top-level comment.

174

nit: for a clangd-index-server

176

Again: "Default is the directory associated with the config frament".

(Repeating this makes me wonder if we should have defined a more specific name like "Home"...)

clang-tools-extra/clangd/ConfigYAML.cpp
127

nit: this sort of validation would normally live in ConfigCompile, since it's not to do with serialization

kadircet updated this revision to Diff 303824.Nov 9 2020, 4:30 AM
kadircet marked 6 inline comments as done.
  • Update comments
  • Drop the warning for specifying server on non-grpc builds
sammccall accepted this revision.Nov 9 2020, 9:07 AM
This revision is now accepted and ready to land.Nov 9 2020, 9:07 AM

(Meta-point: not sure how useful splitting this patch out from the compile step is...)

I wanted to keep them separate especially to ensure testing isn't mixed up. As these things tend to get big easily :/

clang-tools-extra/clangd/ConfigFragment.h
173

This is literally used for pointing at a file on disk though. So it doesn't really matter if this is forward or back slashes?

176

not sure where else we repeated this ?

clang-tools-extra/clangd/ConfigYAML.cpp
127

moving into compile logic.

(sorry looks like i forgot to hit submit :( )

kadircet updated this revision to Diff 304060.Nov 9 2020, 11:45 PM
  • Preserve location of external block
This revision was landed with ongoing or failed builds.Nov 22 2020, 12:13 PM
This revision was automatically updated to reflect the committed changes.