Debian Codegraph @

clang-tools-extra/clangd/index/remote/Index.proto

raw
1 //===--- Index.proto - Remote index Protocol Buffers definition -----------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 syntax = "proto2";
10
11 package clang.clangd.remote;
12
13 // Common final result for streaming requests.
14 message FinalResult { optional bool has_more = 1; }
15
16 message LookupRequest { repeated string ids = 1; }
17
18 // The response is a stream of symbol messages and the terminating message
19 // indicating the end of stream.
20 message LookupReply {
21 oneof kind {
22 Symbol stream_result = 1;
23 FinalResult final_result = 2;
24 }
25 }
26
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;
35 }
36
37 // The response is a stream of symbol messages, and one terminating has_more
38 // message.
39 message FuzzyFindReply {
40 oneof kind {
41 Symbol stream_result = 1;
42 FinalResult final_result = 2;
43 }
44 }
45
46 message RefsRequest {
47 repeated string ids = 1;
48 optional uint32 filter = 2;
49 optional uint32 limit = 3;
50 optional bool want_container = 4;
51 }
52
53 // The response is a stream of reference messages, and one terminating has_more
54 // message.
55 message RefsReply {
56 oneof kind {
57 Ref stream_result = 1;
58 FinalResult final_result = 2;
59 }
60 }
61
62 message Symbol {
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;
70 reserved 8;
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;
79 }
80
81 message Ref {
82 optional SymbolLocation location = 1;
83 optional uint32 kind = 2;
84 optional string container = 3;
85 }
86
87 message SymbolInfo {
88 optional uint32 kind = 1;
89 optional uint32 subkind = 2;
90 optional uint32 language = 3;
91 optional uint32 properties = 4;
92 }
93
94 message SymbolLocation {
95 optional Position start = 1;
96 optional Position end = 2;
97 // clangd::SymbolLocation stores FileURI, but the protocol transmits a the
98 // relative path. Because paths are different on the remote and local machines
99 // they will be translated in the marshalling layer.
100 optional string file_path = 3;
101 }
102
103 message Position {
104 optional uint32 line = 1;
105 optional uint32 column = 2;
106 }
107
108 message HeaderWithReferences {
109 optional string header = 1;
110 optional uint32 references = 2;
111 optional uint32 supported_directives = 3;
112 }
113
114 message RelationsRequest {
115 repeated string subjects = 1;
116 optional uint32 predicate = 2;
117 optional uint32 limit = 3;
118 }
119
120 // The response is a stream of reference messages, and one terminating has_more
121 // message.
122 message RelationsReply {
123 oneof kind {
124 Relation stream_result = 1;
125 FinalResult final_result = 2;
126 }
127 }
128
129 // This struct does not mirror clangd::Relation but rather the arguments of
130 // SymbolIndex::relations callback.
131 message Relation {
132 optional string subject_id = 1;
133 optional Symbol object = 2;
134 }
135
136 message ContainedRefsRequest {
137 optional string id = 1;
138 optional uint32 limit = 2;
139 }
140
141 message ContainedRefsReply {
142 oneof kind {
143 ContainedRef stream_result = 1;
144 FinalResult final_result = 2;
145 }
146 }
147
148 message ContainedRef {
149 optional SymbolLocation location = 1;
150 optional uint32 kind = 2;
151 optional string symbol = 3;
152 }