Commit Graph

50 Commits

Author SHA1 Message Date
Jacob Dufault
f6a2a55209 Import pipeline improvements
- Cache manager is created by request
- Index is always associated with its contents
- Reduced frequently of file reads
2018-01-29 21:34:36 -08:00
Jacob Dufault
7579d71b85 Simplify MAKE_REFLECT_TYPE_PROXY 2018-01-29 16:35:01 -08:00
Jacob Dufault
a392301be3 Format 2018-01-29 16:27:43 -08:00
Fangrui Song
70bbe6c64c Use major/minor versions for IndexFile
Fixes #364
2018-01-27 21:47:37 -08:00
Fangrui Song
556f32ec1b Throw std::invalid_argument for deserialization type error 2018-01-18 22:47:44 -08:00
Fangrui Song
bffe9203eb Serialize int/long/long long instead of int32_t/int64_t 2018-01-18 10:41:46 -08:00
Fangrui Song
545838f7eb Support uint32_t serialization for size_t (which is either uint32_t or uint64_t on known systems) 2018-01-18 00:43:15 -08:00
Fangrui Song
cf54cc9f26 Fix clang compile error. #297 2018-01-15 09:23:59 -08:00
Fangrui Song
1388e5190d Fix gcc compile error. #297 2018-01-15 08:58:08 -08:00
Fangrui Song
4d07189b47 Comment optional<T> in serializers and remove redundant Writer ReflectMember on std::vector 2018-01-11 00:32:28 -08:00
Fangrui Song
5f1aa34a9c Comment serializer 2018-01-11 00:07:54 -08:00
Fangrui Song
27ddce4cd6 Reader reflection of std::variant<Ts...> 2018-01-10 23:17:27 -08:00
Jacob Dufault
54394ed868 Format 2018-01-10 18:43:01 -08:00
Fangrui Song
060b92b214 Change lsVersionedTextDocumentIdentifier::version to variant<monostate,int>
version: number | null

Maybe we need to change it to double
2018-01-09 23:57:44 -08:00
Fangrui Song
503127e0da Reflect std::variant and change lsRequestId to variant<monostate,double,string> (#279) 2018-01-09 22:34:58 -08:00
Fangrui Song
37152da0fc Add std::monostate to represent null field and add Ipc::Shutdown
Fixes #265

// FIXME lsRequestId should be number | string | null (std::variant<std::monostate, double, string>
2018-01-09 00:23:00 -08:00
Fangrui Song
a7bf90f50b Serialize cacheFormat as string literal 2018-01-08 22:22:24 -08:00
Fangrui Song
11436c1f0d Flatten msgpack by replacing pack_array() with pack()
msgpack::unpacker is not a complete streaming deserializer. It returns maps/arrays as a whole but does not allow us to step into individual elements. There is some memory overhead and it is also likely less efficient. By flattening maps, we also no longer need to track how many fields a struct has, which is less error-prone.
2018-01-07 20:52:16 -08:00
Fangrui Song
4e6c585e59 Add mnemonic constants to ClangSymbolKind 2018-01-07 16:06:07 -08:00
Fangrui Song
286a0649c1 msgpack seems to work
Specify cacheFormat: 1 (SerializeFormat::MessagePack) in initializationOptions to write to .mpack cache files.
2018-01-06 21:12:10 -08:00
Fangrui Song
aa139a4b65 Serialize Config::cacheFormat 2018-01-06 18:56:15 -08:00
Fangrui Song
5809d0c436 Make Serialize accept argument SerializeFormat format
Rename `const char* GetString()` to GetCString and add `std::string GetString()`
WIP on serializers/msgpack.h
2018-01-06 18:01:36 -08:00
Fangrui Song
fe0313f0b5 Add a parameter (number of __VA_ARGS__) to REFLECT_MEMBER_START
rapidjson StartArray StartObject do not need the number of fields, but msgpack-c does.
2018-01-06 16:42:22 -08:00
Fangrui Song
3f1cb5c072 Add submodule https://github.com/msgpack/msgpack-c and make Serialize/Deserialize aware of SerializeFormat 2018-01-06 15:29:53 -08:00
Fangrui Song
734f9b6380 Add serializers/json.h 2018-01-06 14:59:05 -08:00
Fangrui Song
02a457f65d Make Reader/Writer abstract classes instead of type aliases of rapidjson classes
Added src/serializers/json.h (which includes rapidjson)
2018-01-06 14:47:43 -08:00
Fangrui Song
4758b70d00 Reorder Reflect functions 2018-01-06 11:26:41 -08:00
Jacob Dufault
48f3c75053 Add using declaration to optional.h, include STL optional if available or fallback to third-party one. 2017-12-29 12:00:52 -06:00
Fangrui Song
6636617b4d [comments] Import mpark/variant and make MarkedString a variant (#200) 2017-12-28 15:21:40 -08:00
Jacob Dufault
12bfabf9c2 No more NonElidedVector 2017-12-11 21:20:29 -08:00
Jacob Dufault
e535fab581 Do not elide vector in serialization 2017-12-11 21:15:37 -08:00
Jacob Dufault
7a5eb3c4d5 Move src/messages/*.cc to anonymous namespace 2017-12-05 21:03:38 -08:00
Peter Goodman
3f45c05476 This commit fixes severak compiler errors when trying to build cquery. I gave up after a bit and didn't fix them all though, there are a ton of signed to unsigned comparisons. 2017-11-18 16:09:14 -05:00
Jacob Dufault
eea8a1b07a Try to avoid crashing when deserializing JSON 2017-11-18 09:27:37 -08:00
Jacob Dufault
f5314b62b1 Reformat to Chromium style. 2017-09-21 18:14:57 -07:00
Jacob Dufault
6d9e4242d1 Use shared_ptr, try to fix a crash. 2017-07-29 23:51:32 -07:00
Jacob Dufault
e771f05f3f Linux build fixes 2017-07-29 21:46:21 -07:00
Jacob Dufault
511f6c5248 Fix crash when loading old cache when file format changed.
Also eliminate an unnecessary copy after finishing deserialization.
2017-06-13 21:00:51 -07:00
Jacob Dufault
f3d00dea23 Implement code actions using clang FixIts
- Also make server check client version and show an error message if they do not match.
2017-05-20 12:31:07 -07:00
Jacob Dufault
00143bef8e Log index updates before applying them 2017-05-19 00:02:01 -07:00
Jacob Dufault
ff421723a5 Renames and fix some operator < implementations 2017-05-11 23:08:15 -07:00
Jacob Dufault
d83b1591a4 Serialized indexes are now versioned. Old versions are not imported. 2017-04-19 23:02:24 -07:00
Jacob Dufault
b4fb350140 Include file modification time in index 2017-04-19 21:57:44 -07:00
Jacob Dufault
ae993d6446 wip 2017-04-02 18:34:15 -07:00
Jacob Dufault
876296d62f more code completion work 2017-03-26 21:04:48 -07:00
Jacob Dufault
cc85f196f4 never elide data for language server json serialization 2017-03-25 17:22:06 -07:00
Jacob Dufault
c8afc0f022 more changes 2017-03-25 16:58:11 -07:00
Jacob Dufault
8219a39a32 move some things into language_server_api.cc 2017-03-25 15:13:19 -07:00
Jacob Dufault
38acb8c1a1 move optional to third_party 2017-03-25 13:32:44 -07:00
Jacob Dufault
695048baa7 move code into src 2017-03-25 13:15:00 -07:00