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 9syntax = "proto2"; 10 11package clang.clangd.remote; 12 13// Common final result for streaming requests. 14message FinalResult { optional bool has_more = 1; } 15 16message 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. 20message LookupReply { 21 oneof kind { 22 Symbol stream_result = 1; 23 FinalResult final_result = 2; 24 } 25} 26 27message 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. 39message FuzzyFindReply { 40 oneof kind { 41 Symbol stream_result = 1; 42 FinalResult final_result = 2; 43 } 44} 45 46message RefsRequest { 47 repeated string ids = 1; 48 optional uint32 filter = 2; 49 optional uint32 limit = 3; 50} 51 52// The response is a stream of reference messages, and one terminating has_more 53// message. 54message RefsReply { 55 oneof kind { 56 Ref stream_result = 1; 57 FinalResult final_result = 2; 58 } 59} 60 61message Symbol { 62 optional string id = 1; 63 optional SymbolInfo info = 2; 64 optional string name = 3; 65 optional SymbolLocation definition = 4; 66 optional string scope = 5; 67 optional SymbolLocation canonical_declaration = 6; 68 optional int32 references = 7; 69 optional uint32 origin = 8; 70 optional string signature = 9; 71 optional string template_specialization_args = 10; 72 optional string completion_snippet_suffix = 11; 73 optional string documentation = 12; 74 optional string return_type = 13; 75 optional string type = 14; 76 repeated HeaderWithReferences headers = 15; 77 optional uint32 flags = 16; 78} 79 80message Ref { 81 optional SymbolLocation location = 1; 82 optional uint32 kind = 2; 83} 84 85message SymbolInfo { 86 optional uint32 kind = 1; 87 optional uint32 subkind = 2; 88 optional uint32 language = 3; 89 optional uint32 properties = 4; 90} 91 92message SymbolLocation { 93 optional Position start = 1; 94 optional Position end = 2; 95 // clangd::SymbolLocation stores FileURI, but the protocol transmits a the 96 // relative path. Because paths are different on the remote and local machines 97 // they will be translated in the marshalling layer. 98 optional string file_path = 3; 99} 100 101message Position { 102 optional uint32 line = 1; 103 optional uint32 column = 2; 104} 105 106message HeaderWithReferences { 107 optional string header = 1; 108 optional uint32 references = 2; 109} 110 111message RelationsRequest { 112 repeated string subjects = 1; 113 optional uint32 predicate = 2; 114 optional uint32 limit = 3; 115} 116 117// The response is a stream of reference messages, and one terminating has_more 118// message. 119message RelationsReply { 120 oneof kind { 121 Relation stream_result = 1; 122 FinalResult final_result = 2; 123 } 124} 125 126// This struct does not mirror clangd::Relation but rather the arguments of 127// SymbolIndex::relations callback. 128message Relation { 129 optional string subject_id = 1; 130 optional Symbol object = 2; 131} 132