hanchenye-llvm-project/clang-tools-extra/clangd
Sam McCall 3bf9b6d920 [clangd] dexp tool uses llvm::cl to parse its flags.
Summary:
We can use cl::ResetCommandLineParser() to support different types of
command-lines, as long as we're careful about option lifetimes.
(I tried using subcommands, but the error messages were bad)
I found a mostly-reasonable pattern to isolate the fiddly parts.

Added -scope and -limit flags to the `find` command to demonstrate.
(Note that scope support seems to be broken in dex?)

Fixed symbol lookup to parse symbol IDs.

Caveats:
 - with command help (e.g. `find -help`), you also get some spam
   about required arguments. This is a bug in llvm::cl, which prints
   these to errs() rather than the designated stream.

Reviewers: kbobyrev

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D51989

llvm-svn: 342456
2018-09-18 09:49:57 +00:00
..
benchmarks [clangd] NFC: Fix IndexBenchmark CLI arguments handling 2018-09-14 12:21:09 +00:00
clients/clangd-vscode [clangd] Fix category in clangd-vscode's package.json 2018-07-23 14:32:12 +00:00
fuzzer [clangd] Fix fuzzer build. 2018-08-04 01:51:10 +00:00
index [clangd] dexp tool uses llvm::cl to parse its flags. 2018-09-18 09:49:57 +00:00
indexer [clangd] Update IndexerMain.cpp file comment after rename. NFC 2018-09-14 11:39:05 +00:00
tool [clangd] Clarify and hide -index flag. 2018-09-13 12:53:23 +00:00
AST.cpp [clangd] Set SymbolID for sema macros so that they can be merged with index macros. 2018-09-06 09:59:37 +00:00
AST.h [clangd] Set SymbolID for sema macros so that they can be merged with index macros. 2018-09-06 09:59:37 +00:00
CMakeLists.txt [clangd] Introduce PostingList interface 2018-09-13 17:11:03 +00:00
Cancellation.cpp [clangd] Simplify cancellation public API 2018-09-13 11:47:48 +00:00
Cancellation.h [clangd] Simplify cancellation public API 2018-09-13 11:47:48 +00:00
ClangdLSPServer.cpp [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ClangdLSPServer.h [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ClangdServer.cpp [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ClangdServer.h [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ClangdUnit.cpp [clangd] Some nitpicking around the new split (preamble/main) dynamic index 2018-09-03 16:37:59 +00:00
ClangdUnit.h [clangd] Some nitpicking around the new split (preamble/main) dynamic index 2018-09-03 16:37:59 +00:00
CodeComplete.cpp [clangd] Update code completion for #include completions in r342449 2018-09-18 09:08:28 +00:00
CodeComplete.h [clangd] Add "Deprecated" field to Symbol and CodeCompletion. 2018-09-06 18:52:26 +00:00
CodeCompletionStrings.cpp [clangd] Show function documentation in signature help 2018-08-17 09:29:38 +00:00
CodeCompletionStrings.h [clangd] Show function documentation in signature help 2018-08-17 09:29:38 +00:00
Compiler.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Compiler.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Context.cpp NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Context.h [clangd] context key constructor is constexpr. NFC 2018-06-15 12:39:21 +00:00
Diagnostics.cpp [clangd] add an extension field to LSP to transfer the diagnostic's category 2018-08-14 22:21:40 +00:00
Diagnostics.h [clangd] send diagnostic categories only when 'categorySupport' 2018-08-22 20:30:06 +00:00
DraftStore.cpp [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
DraftStore.h [clangd] Support incremental document syncing 2018-03-26 14:41:40 +00:00
FSProvider.h [clangd] Extract FileSystemProvider into a separate header. NFC 2018-07-12 14:49:52 +00:00
FileDistance.cpp NFC: Fix build failure after rL341182 2018-08-31 08:29:48 +00:00
FileDistance.h [clangd] NFC: Document URIDistance 2018-09-07 09:18:58 +00:00
FindSymbols.cpp [clangd] Adapt API change after 342451. 2018-09-18 08:52:14 +00:00
FindSymbols.h [clangd] Correct the namespace of ParsedAST forward declaration, NFC. 2018-08-01 12:50:44 +00:00
Function.h [clangd] Replace UniqueFunction with llvm::unique_function. 2018-07-03 20:59:33 +00:00
FuzzyMatch.cpp [clangd] FuzzyMatch exposes an API for its word segmentation. NFC 2018-07-20 08:01:37 +00:00
FuzzyMatch.h [clangd] FuzzyMatch exposes an API for its word segmentation. NFC 2018-07-20 08:01:37 +00:00
GlobalCompilationDatabase.cpp [clangd] Don't double-infer compile commands after r342228 2018-09-14 12:32:08 +00:00
GlobalCompilationDatabase.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
Headers.cpp [clangd] Incorporate transitive #includes into code complete proximity scoring. 2018-07-03 08:09:29 +00:00
Headers.h [clangd] Incorporate transitive #includes into code complete proximity scoring. 2018-07-03 08:09:29 +00:00
JSONRPCDispatcher.cpp [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
JSONRPCDispatcher.h [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
Logger.cpp [clangd] Upgrade logging facilities with levels and formatv. 2018-07-11 10:35:11 +00:00
Logger.h [clangd] Fix many typos. NFC 2018-09-01 07:47:03 +00:00
Path.h
Protocol.cpp [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
Protocol.h [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ProtocolHandlers.cpp [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
ProtocolHandlers.h [clangd] Allow all LSP methods to signal cancellation via $/cancelRequest 2018-09-13 12:58:36 +00:00
Quality.cpp [clangd] Add "Deprecated" field to Symbol and CodeCompletion. 2018-09-06 18:52:26 +00:00
Quality.h NFC: Enforce good formatting across multiple clang-tools-extra files 2018-08-14 16:03:32 +00:00
RIFF.cpp Remove unnecessary semicolon to silence -Wpedantic warning. NFCI. 2018-09-11 13:42:15 +00:00
RIFF.h [clangd] Define a compact binary serialization fomat for symbol slab/index. 2018-09-04 16:16:50 +00:00
SourceCode.cpp [clangd] Support textEdit in addition to insertText. 2018-08-13 08:23:01 +00:00
SourceCode.h [clangd] Support textEdit in addition to insertText. 2018-08-13 08:23:01 +00:00
TUScheduler.cpp [clangd] Fix TUScheduler typos 2018-09-14 00:56:11 +00:00
TUScheduler.h [clangd] Fix TUScheduler typos 2018-09-14 00:56:11 +00:00
Threading.cpp [clangd] Use 'const Twine&' instead of 'Twine'. NFC 2018-07-26 16:13:52 +00:00
Threading.h [clangd] Use 'const Twine&' instead of 'Twine'. NFC 2018-07-26 16:13:52 +00:00
Trace.cpp [clangd] Remove JSON library in favor of llvm/Support/JSON 2018-07-09 14:25:59 +00:00
Trace.h [clangd] Remove JSON library in favor of llvm/Support/JSON 2018-07-09 14:25:59 +00:00
URI.cpp [clangd] Implement proximity path boosting for Dex 2018-09-06 12:54:43 +00:00
URI.h [clangd] Implement proximity path boosting for Dex 2018-09-06 12:54:43 +00:00
XRefs.cpp [clangd] Adapt API change after 342451. 2018-09-18 08:52:14 +00:00
XRefs.h [clangd] Implement findReferences function 2018-09-05 10:33:36 +00:00