1 //===--- Index.proto - Remote index Protocol Buffers definition -----------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 package clang.clangd.remote;
13 // Common final result for streaming requests.
14 message FinalResult { optional bool has_more = 1; }
16 message LookupRequest { repeated string ids = 1; }
18 // The response is a stream of symbol messages and the terminating message
19 // indicating the end of stream.
22 Symbol stream_result = 1;
23 FinalResult final_result = 2;
27 message FuzzyFindRequest {
28 optional string query = 1;
29 repeated string scopes = 2;
30 optional bool any_scope = 3;
31 optional uint32 limit = 4;
32 optional bool restricted_for_code_completion = 5;
33 repeated string proximity_paths = 6;
34 repeated string preferred_types = 7;
37 // The response is a stream of symbol messages, and one terminating has_more
39 message FuzzyFindReply {
41 Symbol stream_result = 1;
42 FinalResult final_result = 2;
47 repeated string ids = 1;
48 optional uint32 filter = 2;
49 optional uint32 limit = 3;
50 optional bool want_container = 4;
53 // The response is a stream of reference messages, and one terminating has_more
57 Ref stream_result = 1;
58 FinalResult final_result = 2;
63 optional string id = 1;
64 optional SymbolInfo info = 2;
65 optional string name = 3;
66 optional SymbolLocation definition = 4;
67 optional string scope = 5;
68 optional SymbolLocation canonical_declaration = 6;
69 optional int32 references = 7;
71 optional string signature = 9;
72 optional string template_specialization_args = 10;
73 optional string completion_snippet_suffix = 11;
74 optional string documentation = 12;
75 optional string return_type = 13;
76 optional string type = 14;
77 repeated HeaderWithReferences headers = 15;
78 optional uint32 flags = 16;
82 optional SymbolLocation location = 1;
83 optional uint32 kind = 2;
87 optional uint32 kind = 1;
88 optional uint32 subkind = 2;
89 optional uint32 language = 3;
90 optional uint32 properties = 4;
93 message SymbolLocation {
94 optional Position start = 1;
95 optional Position end = 2;
96 // clangd::SymbolLocation stores FileURI, but the protocol transmits a the
97 // relative path. Because paths are different on the remote and local machines
98 // they will be translated in the marshalling layer.
99 optional string file_path = 3;
103 optional uint32 line = 1;
104 optional uint32 column = 2;
107 message HeaderWithReferences {
108 optional string header = 1;
109 optional uint32 references = 2;
110 optional uint32 supported_directives = 3;
113 message RelationsRequest {
114 repeated string subjects = 1;
115 optional uint32 predicate = 2;
116 optional uint32 limit = 3;
119 // The response is a stream of reference messages, and one terminating has_more
121 message RelationsReply {
123 Relation stream_result = 1;
124 FinalResult final_result = 2;
128 // This struct does not mirror clangd::Relation but rather the arguments of
129 // SymbolIndex::relations callback.
131 optional string subject_id = 1;
132 optional Symbol object = 2;