2017-05-23 18:17:48 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
Support
|
|
|
|
)
|
|
|
|
|
2017-05-23 16:12:45 +08:00
|
|
|
add_clang_library(clangDaemon
|
2017-05-16 17:38:59 +08:00
|
|
|
ClangdLSPServer.cpp
|
|
|
|
ClangdServer.cpp
|
|
|
|
ClangdUnit.cpp
|
|
|
|
ClangdUnitStore.cpp
|
|
|
|
DraftStore.cpp
|
|
|
|
GlobalCompilationDatabase.cpp
|
Adds a json::Expr type to represent intermediate JSON expressions.
Summary:
This form can be created with a nice clang-format-friendly literal syntax,
and gets escaping right. It knows how to call unparse() on our Protocol types.
All the places where we pass around JSON internally now use this type.
Object properties are sorted (stored as std::map) and so serialization is
canonicalized, with optional prettyprinting (triggered by a -pretty flag).
This makes the lit tests much nicer to read and somewhat nicer to debug.
(Unfortunately the completion tests use CHECK-DAG, which only has
line-granularity, so pretty-printing is disabled there. In future we
could make completion ordering deterministic, or switch to unittests).
Compared to the current approach, it has some efficiencies like avoiding copies
of string literals used as object keys, but is probably slower overall.
I think the code/test quality benefits are worth it.
This patch doesn't attempt to do anything about JSON *parsing*.
It takes direction from the proposal in this doc[1], but is limited in scope
and visibility, for now.
I am of half a mind just to use Expr as the target of a parser, and maybe do a
little string deduplication, but not bother with clever memory allocation.
That would be simple, and fast enough for clangd...
[1] https://docs.google.com/document/d/1OEF9IauWwNuSigZzvvbjc1cVS1uGHRyGTXaoy3DjqM4/edit
+cc d0k so he can tell me not to use std::map.
Reviewers: ioeric, malaperle
Subscribers: bkramer, ilya-biryukov, mgorny, klimek
Differential Revision: https://reviews.llvm.org/D39435
llvm-svn: 317486
2017-11-06 23:40:30 +08:00
|
|
|
JSONExpr.cpp
|
2017-11-24 21:13:41 +08:00
|
|
|
JSONRPCDispatcher.cpp
|
2017-09-20 15:24:15 +08:00
|
|
|
Logger.cpp
|
2017-02-07 18:28:20 +08:00
|
|
|
Protocol.cpp
|
|
|
|
ProtocolHandlers.cpp
|
2017-11-02 17:21:51 +08:00
|
|
|
Trace.cpp
|
2017-02-07 18:28:20 +08:00
|
|
|
|
2017-05-23 18:17:48 +08:00
|
|
|
LINK_LIBS
|
2017-05-23 21:59:37 +08:00
|
|
|
clangAST
|
2017-02-07 18:28:20 +08:00
|
|
|
clangBasic
|
|
|
|
clangFormat
|
2017-02-15 23:04:20 +08:00
|
|
|
clangFrontend
|
2017-06-29 00:12:10 +08:00
|
|
|
clangIndex
|
2017-06-29 06:57:15 +08:00
|
|
|
clangLex
|
2017-04-05 03:42:29 +08:00
|
|
|
clangSema
|
2017-07-22 07:48:26 +08:00
|
|
|
clangSerialization
|
2017-02-15 23:04:20 +08:00
|
|
|
clangTooling
|
2017-03-02 00:23:40 +08:00
|
|
|
clangToolingCore
|
2017-11-09 19:30:04 +08:00
|
|
|
clangToolingRefactor
|
2017-05-23 18:29:54 +08:00
|
|
|
${LLVM_PTHREAD_LIB}
|
2017-02-07 18:28:20 +08:00
|
|
|
)
|
2017-05-23 16:12:45 +08:00
|
|
|
|
2017-10-26 18:03:11 +08:00
|
|
|
if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
|
|
|
|
add_subdirectory(fuzzer)
|
|
|
|
endif()
|
2017-05-23 16:12:45 +08:00
|
|
|
add_subdirectory(tool)
|