From 6990baeaf77504d86f92f89721df2999b73ad42d Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Thu, 17 Oct 2024 12:57:20 +0800 Subject: [PATCH] chore: Bump rust-protobuf crates to 3.7.1 (#287) We also bump the Rust version to 1.74.0 as older Rust toolchains are unable to compile the protobuf dependency --- .tool-versions | 2 +- bindings/rust/Cargo.toml | 2 +- bindings/rust/src/generated/scip.rs | 379 +++++++++++++++++++++++++--- buf.gen.yaml | 2 +- dev/proto-generate.sh | 4 +- 5 files changed, 351 insertions(+), 38 deletions(-) diff --git a/.tool-versions b/.tool-versions index 7fb73813..073ee1d7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -2,5 +2,5 @@ golang 1.20.14 nodejs 16.20.2 shellcheck 0.7.1 yarn 1.22.22 -rust 1.71.0 +rust 1.74.0 python 3.11.9 diff --git a/bindings/rust/Cargo.toml b/bindings/rust/Cargo.toml index c17fe513..45f81ef5 100644 --- a/bindings/rust/Cargo.toml +++ b/bindings/rust/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.60.0" [dependencies] # Keep in sync with dev/proto-generate.sh -protobuf = "=3.2.0" +protobuf = "=3.7.1" [dev-dependencies] pretty_assertions = "1.2.1" diff --git a/bindings/rust/src/generated/scip.rs b/bindings/rust/src/generated/scip.rs index 5fae7a8d..19eb8ba0 100644 --- a/bindings/rust/src/generated/scip.rs +++ b/bindings/rust/src/generated/scip.rs @@ -1,5 +1,5 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit -// .proto file is parsed by protoc --rust-out=... +// This file is generated by rust-protobuf 3.7.1. Do not edit +// .proto file is parsed by protoc --rs_out=... // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1; /// Index represents a complete SCIP index for a workspace this is rooted at a /// single directory. An Index message payload can have a large memory footprint @@ -31,8 +30,8 @@ const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0; /// value at a time. To permit streaming consumption of an Index payload, the /// `metadata` field must appear at the start of the stream and must only appear /// once in the stream. Other field values may appear in any order. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Index) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Index { // message fields /// Metadata about this index. @@ -199,8 +198,8 @@ impl ::protobuf::reflect::ProtobufValue for Index { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Metadata) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Metadata { // message fields /// Which version of this protocol was used to generate this index? @@ -384,8 +383,8 @@ impl ::protobuf::reflect::ProtobufValue for Metadata { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.ToolInfo) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ToolInfo { // message fields /// Name of the indexer that produced this index. @@ -546,8 +545,8 @@ impl ::protobuf::reflect::ProtobufValue for ToolInfo { } /// Document defines the metadata about a source file on disk. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Document) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Document { // message fields /// The string ID for the programming language this file is written in. @@ -829,8 +828,8 @@ impl ::protobuf::reflect::ProtobufValue for Document { /// /// Local symbols MUST only be used for entities which are local to a Document, /// and cannot be accessed from outside the Document. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Symbol) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Symbol { // message fields // @@protoc_insertion_point(field:scip.Symbol.scheme) @@ -992,8 +991,8 @@ impl ::protobuf::reflect::ProtobufValue for Symbol { /// Unit of packaging and distribution. /// /// NOTE: This corresponds to a module in Go and JVM languages. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Package) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Package { // message fields // @@protoc_insertion_point(field:scip.Package.manager) @@ -1150,8 +1149,8 @@ impl ::protobuf::reflect::ProtobufValue for Package { type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Descriptor) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Descriptor { // message fields // @@protoc_insertion_point(field:scip.Descriptor.name) @@ -1385,6 +1384,22 @@ pub mod descriptor { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedSuffix" => ::std::option::Option::Some(Suffix::UnspecifiedSuffix), + "Namespace" => ::std::option::Option::Some(Suffix::Namespace), + "Type" => ::std::option::Option::Some(Suffix::Type), + "Term" => ::std::option::Option::Some(Suffix::Term), + "Method" => ::std::option::Option::Some(Suffix::Method), + "TypeParameter" => ::std::option::Option::Some(Suffix::TypeParameter), + "Parameter" => ::std::option::Option::Some(Suffix::Parameter), + "Meta" => ::std::option::Option::Some(Suffix::Meta), + "Local" => ::std::option::Option::Some(Suffix::Local), + "Macro" => ::std::option::Option::Some(Suffix::Macro), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [Suffix] = &[ Suffix::UnspecifiedSuffix, Suffix::Namespace, @@ -1439,8 +1454,8 @@ pub mod descriptor { /// SymbolInformation defines metadata about a symbol, such as the symbol's /// docstring or what package it's defined it. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.SymbolInformation) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SymbolInformation { // message fields /// Identifier of this symbol, which can be referenced from `Occurence.symbol`. @@ -2004,6 +2019,97 @@ pub mod symbol_information { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedKind" => ::std::option::Option::Some(Kind::UnspecifiedKind), + "AbstractMethod" => ::std::option::Option::Some(Kind::AbstractMethod), + "Accessor" => ::std::option::Option::Some(Kind::Accessor), + "Array" => ::std::option::Option::Some(Kind::Array), + "Assertion" => ::std::option::Option::Some(Kind::Assertion), + "AssociatedType" => ::std::option::Option::Some(Kind::AssociatedType), + "Attribute" => ::std::option::Option::Some(Kind::Attribute), + "Axiom" => ::std::option::Option::Some(Kind::Axiom), + "Boolean" => ::std::option::Option::Some(Kind::Boolean), + "Class" => ::std::option::Option::Some(Kind::Class), + "Constant" => ::std::option::Option::Some(Kind::Constant), + "Constructor" => ::std::option::Option::Some(Kind::Constructor), + "Contract" => ::std::option::Option::Some(Kind::Contract), + "DataFamily" => ::std::option::Option::Some(Kind::DataFamily), + "Delegate" => ::std::option::Option::Some(Kind::Delegate), + "Enum" => ::std::option::Option::Some(Kind::Enum), + "EnumMember" => ::std::option::Option::Some(Kind::EnumMember), + "Error" => ::std::option::Option::Some(Kind::Error), + "Event" => ::std::option::Option::Some(Kind::Event), + "Extension" => ::std::option::Option::Some(Kind::Extension), + "Fact" => ::std::option::Option::Some(Kind::Fact), + "Field" => ::std::option::Option::Some(Kind::Field), + "File" => ::std::option::Option::Some(Kind::File), + "Function" => ::std::option::Option::Some(Kind::Function), + "Getter" => ::std::option::Option::Some(Kind::Getter), + "Grammar" => ::std::option::Option::Some(Kind::Grammar), + "Instance" => ::std::option::Option::Some(Kind::Instance), + "Interface" => ::std::option::Option::Some(Kind::Interface), + "Key" => ::std::option::Option::Some(Kind::Key), + "Lang" => ::std::option::Option::Some(Kind::Lang), + "Lemma" => ::std::option::Option::Some(Kind::Lemma), + "Library" => ::std::option::Option::Some(Kind::Library), + "Macro" => ::std::option::Option::Some(Kind::Macro), + "Method" => ::std::option::Option::Some(Kind::Method), + "MethodAlias" => ::std::option::Option::Some(Kind::MethodAlias), + "MethodReceiver" => ::std::option::Option::Some(Kind::MethodReceiver), + "MethodSpecification" => ::std::option::Option::Some(Kind::MethodSpecification), + "Message" => ::std::option::Option::Some(Kind::Message), + "Mixin" => ::std::option::Option::Some(Kind::Mixin), + "Modifier" => ::std::option::Option::Some(Kind::Modifier), + "Module" => ::std::option::Option::Some(Kind::Module), + "Namespace" => ::std::option::Option::Some(Kind::Namespace), + "Null" => ::std::option::Option::Some(Kind::Null), + "Number" => ::std::option::Option::Some(Kind::Number), + "Object" => ::std::option::Option::Some(Kind::Object), + "Operator" => ::std::option::Option::Some(Kind::Operator), + "Package" => ::std::option::Option::Some(Kind::Package), + "PackageObject" => ::std::option::Option::Some(Kind::PackageObject), + "Parameter" => ::std::option::Option::Some(Kind::Parameter), + "ParameterLabel" => ::std::option::Option::Some(Kind::ParameterLabel), + "Pattern" => ::std::option::Option::Some(Kind::Pattern), + "Predicate" => ::std::option::Option::Some(Kind::Predicate), + "Property" => ::std::option::Option::Some(Kind::Property), + "Protocol" => ::std::option::Option::Some(Kind::Protocol), + "ProtocolMethod" => ::std::option::Option::Some(Kind::ProtocolMethod), + "PureVirtualMethod" => ::std::option::Option::Some(Kind::PureVirtualMethod), + "Quasiquoter" => ::std::option::Option::Some(Kind::Quasiquoter), + "SelfParameter" => ::std::option::Option::Some(Kind::SelfParameter), + "Setter" => ::std::option::Option::Some(Kind::Setter), + "Signature" => ::std::option::Option::Some(Kind::Signature), + "SingletonClass" => ::std::option::Option::Some(Kind::SingletonClass), + "SingletonMethod" => ::std::option::Option::Some(Kind::SingletonMethod), + "StaticDataMember" => ::std::option::Option::Some(Kind::StaticDataMember), + "StaticEvent" => ::std::option::Option::Some(Kind::StaticEvent), + "StaticField" => ::std::option::Option::Some(Kind::StaticField), + "StaticMethod" => ::std::option::Option::Some(Kind::StaticMethod), + "StaticProperty" => ::std::option::Option::Some(Kind::StaticProperty), + "StaticVariable" => ::std::option::Option::Some(Kind::StaticVariable), + "String" => ::std::option::Option::Some(Kind::String), + "Struct" => ::std::option::Option::Some(Kind::Struct), + "Subscript" => ::std::option::Option::Some(Kind::Subscript), + "Tactic" => ::std::option::Option::Some(Kind::Tactic), + "Theorem" => ::std::option::Option::Some(Kind::Theorem), + "ThisParameter" => ::std::option::Option::Some(Kind::ThisParameter), + "Trait" => ::std::option::Option::Some(Kind::Trait), + "TraitMethod" => ::std::option::Option::Some(Kind::TraitMethod), + "Type" => ::std::option::Option::Some(Kind::Type), + "TypeAlias" => ::std::option::Option::Some(Kind::TypeAlias), + "TypeClass" => ::std::option::Option::Some(Kind::TypeClass), + "TypeClassMethod" => ::std::option::Option::Some(Kind::TypeClassMethod), + "TypeFamily" => ::std::option::Option::Some(Kind::TypeFamily), + "TypeParameter" => ::std::option::Option::Some(Kind::TypeParameter), + "Union" => ::std::option::Option::Some(Kind::Union), + "Value" => ::std::option::Option::Some(Kind::Value), + "Variable" => ::std::option::Option::Some(Kind::Variable), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [Kind] = &[ Kind::UnspecifiedKind, Kind::AbstractMethod, @@ -2204,8 +2310,8 @@ pub mod symbol_information { } } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Relationship) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Relationship { // message fields // @@protoc_insertion_point(field:scip.Relationship.symbol) @@ -2428,8 +2534,8 @@ impl ::protobuf::reflect::ProtobufValue for Relationship { /// /// If possible, indexers should try to bundle logically related information /// across occurrences into a single occurrence to reduce payload sizes. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Occurrence) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Occurrence { // message fields /// Half-open [start, end) range of this occurrence. Must be exactly three or four @@ -2594,9 +2700,7 @@ impl ::protobuf::Message for Occurrence { #[allow(unused_variables)] fn compute_size(&self) -> u64 { let mut my_size = 0; - for value in &self.range { - my_size += ::protobuf::rt::int32_size(1, *value); - }; + my_size += ::protobuf::rt::vec_packed_int32_size(1, &self.range); if !self.symbol.is_empty() { my_size += ::protobuf::rt::string_size(2, &self.symbol); } @@ -2613,18 +2717,14 @@ impl ::protobuf::Message for Occurrence { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len; }; - for value in &self.enclosing_range { - my_size += ::protobuf::rt::int32_size(7, *value); - }; + my_size += ::protobuf::rt::vec_packed_int32_size(7, &self.enclosing_range); my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); self.special_fields.cached_size().set(my_size as u32); my_size } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> { - for v in &self.range { - os.write_int32(1, *v)?; - }; + os.write_repeated_packed_int32(1, &self.range)?; if !self.symbol.is_empty() { os.write_string(2, &self.symbol)?; } @@ -2640,9 +2740,7 @@ impl ::protobuf::Message for Occurrence { for v in &self.diagnostics { ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?; }; - for v in &self.enclosing_range { - os.write_int32(7, *v)?; - }; + os.write_repeated_packed_int32(7, &self.enclosing_range)?; os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2704,8 +2802,8 @@ impl ::protobuf::reflect::ProtobufValue for Occurrence { /// Represents a diagnostic, such as a compiler error or warning, which should be /// reported for a document. -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:scip.Diagnostic) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Diagnostic { // message fields /// Should this diagnostic be reported as an error, warning, info, or hint? @@ -2827,9 +2925,7 @@ impl ::protobuf::Message for Diagnostic { if !self.source.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.source); } - for value in &self.tags { - my_size += ::protobuf::rt::int32_size(5, value.value()); - }; + my_size += ::protobuf::rt::vec_packed_enum_or_unknown_size(5, &self.tags); my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields()); self.special_fields.cached_size().set(my_size as u32); my_size @@ -2848,9 +2944,7 @@ impl ::protobuf::Message for Diagnostic { if !self.source.is_empty() { os.write_string(4, &self.source)?; } - for v in &self.tags { - os.write_enum(5, ::protobuf::EnumOrUnknown::value(v))?; - }; + os.write_repeated_packed_enum_or_unknown(5, &self.tags)?; os.write_unknown_fields(self.special_fields.unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2927,6 +3021,13 @@ impl ::protobuf::Enum for ProtocolVersion { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedProtocolVersion" => ::std::option::Option::Some(ProtocolVersion::UnspecifiedProtocolVersion), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [ProtocolVersion] = &[ ProtocolVersion::UnspecifiedProtocolVersion, ]; @@ -2983,6 +3084,15 @@ impl ::protobuf::Enum for TextEncoding { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedTextEncoding" => ::std::option::Option::Some(TextEncoding::UnspecifiedTextEncoding), + "UTF8" => ::std::option::Option::Some(TextEncoding::UTF8), + "UTF16" => ::std::option::Option::Some(TextEncoding::UTF16), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [TextEncoding] = &[ TextEncoding::UnspecifiedTextEncoding, TextEncoding::UTF8, @@ -3045,6 +3155,16 @@ impl ::protobuf::Enum for PositionEncoding { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedPositionEncoding" => ::std::option::Option::Some(PositionEncoding::UnspecifiedPositionEncoding), + "UTF8CodeUnitOffsetFromLineStart" => ::std::option::Option::Some(PositionEncoding::UTF8CodeUnitOffsetFromLineStart), + "UTF16CodeUnitOffsetFromLineStart" => ::std::option::Option::Some(PositionEncoding::UTF16CodeUnitOffsetFromLineStart), + "UTF32CodeUnitOffsetFromLineStart" => ::std::option::Option::Some(PositionEncoding::UTF32CodeUnitOffsetFromLineStart), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [PositionEncoding] = &[ PositionEncoding::UnspecifiedPositionEncoding, PositionEncoding::UTF8CodeUnitOffsetFromLineStart, @@ -3124,6 +3244,20 @@ impl ::protobuf::Enum for SymbolRole { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedSymbolRole" => ::std::option::Option::Some(SymbolRole::UnspecifiedSymbolRole), + "Definition" => ::std::option::Option::Some(SymbolRole::Definition), + "Import" => ::std::option::Option::Some(SymbolRole::Import), + "WriteAccess" => ::std::option::Option::Some(SymbolRole::WriteAccess), + "ReadAccess" => ::std::option::Option::Some(SymbolRole::ReadAccess), + "Generated" => ::std::option::Option::Some(SymbolRole::Generated), + "Test" => ::std::option::Option::Some(SymbolRole::Test), + "ForwardDefinition" => ::std::option::Option::Some(SymbolRole::ForwardDefinition), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [SymbolRole] = &[ SymbolRole::UnspecifiedSymbolRole, SymbolRole::Definition, @@ -3355,6 +3489,49 @@ impl ::protobuf::Enum for SyntaxKind { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedSyntaxKind" => ::std::option::Option::Some(SyntaxKind::UnspecifiedSyntaxKind), + "Comment" => ::std::option::Option::Some(SyntaxKind::Comment), + "PunctuationDelimiter" => ::std::option::Option::Some(SyntaxKind::PunctuationDelimiter), + "PunctuationBracket" => ::std::option::Option::Some(SyntaxKind::PunctuationBracket), + "Keyword" => ::std::option::Option::Some(SyntaxKind::Keyword), + "IdentifierOperator" => ::std::option::Option::Some(SyntaxKind::IdentifierOperator), + "Identifier" => ::std::option::Option::Some(SyntaxKind::Identifier), + "IdentifierBuiltin" => ::std::option::Option::Some(SyntaxKind::IdentifierBuiltin), + "IdentifierNull" => ::std::option::Option::Some(SyntaxKind::IdentifierNull), + "IdentifierConstant" => ::std::option::Option::Some(SyntaxKind::IdentifierConstant), + "IdentifierMutableGlobal" => ::std::option::Option::Some(SyntaxKind::IdentifierMutableGlobal), + "IdentifierParameter" => ::std::option::Option::Some(SyntaxKind::IdentifierParameter), + "IdentifierLocal" => ::std::option::Option::Some(SyntaxKind::IdentifierLocal), + "IdentifierShadowed" => ::std::option::Option::Some(SyntaxKind::IdentifierShadowed), + "IdentifierNamespace" => ::std::option::Option::Some(SyntaxKind::IdentifierNamespace), + "IdentifierFunction" => ::std::option::Option::Some(SyntaxKind::IdentifierFunction), + "IdentifierFunctionDefinition" => ::std::option::Option::Some(SyntaxKind::IdentifierFunctionDefinition), + "IdentifierMacro" => ::std::option::Option::Some(SyntaxKind::IdentifierMacro), + "IdentifierMacroDefinition" => ::std::option::Option::Some(SyntaxKind::IdentifierMacroDefinition), + "IdentifierType" => ::std::option::Option::Some(SyntaxKind::IdentifierType), + "IdentifierBuiltinType" => ::std::option::Option::Some(SyntaxKind::IdentifierBuiltinType), + "IdentifierAttribute" => ::std::option::Option::Some(SyntaxKind::IdentifierAttribute), + "RegexEscape" => ::std::option::Option::Some(SyntaxKind::RegexEscape), + "RegexRepeated" => ::std::option::Option::Some(SyntaxKind::RegexRepeated), + "RegexWildcard" => ::std::option::Option::Some(SyntaxKind::RegexWildcard), + "RegexDelimiter" => ::std::option::Option::Some(SyntaxKind::RegexDelimiter), + "RegexJoin" => ::std::option::Option::Some(SyntaxKind::RegexJoin), + "StringLiteral" => ::std::option::Option::Some(SyntaxKind::StringLiteral), + "StringLiteralEscape" => ::std::option::Option::Some(SyntaxKind::StringLiteralEscape), + "StringLiteralSpecial" => ::std::option::Option::Some(SyntaxKind::StringLiteralSpecial), + "StringLiteralKey" => ::std::option::Option::Some(SyntaxKind::StringLiteralKey), + "CharacterLiteral" => ::std::option::Option::Some(SyntaxKind::CharacterLiteral), + "NumericLiteral" => ::std::option::Option::Some(SyntaxKind::NumericLiteral), + "BooleanLiteral" => ::std::option::Option::Some(SyntaxKind::BooleanLiteral), + "Tag" => ::std::option::Option::Some(SyntaxKind::Tag), + "TagAttribute" => ::std::option::Option::Some(SyntaxKind::TagAttribute), + "TagDelimiter" => ::std::option::Option::Some(SyntaxKind::TagDelimiter), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [SyntaxKind] = &[ SyntaxKind::UnspecifiedSyntaxKind, SyntaxKind::Comment, @@ -3495,6 +3672,17 @@ impl ::protobuf::Enum for Severity { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedSeverity" => ::std::option::Option::Some(Severity::UnspecifiedSeverity), + "Error" => ::std::option::Option::Some(Severity::Error), + "Warning" => ::std::option::Option::Some(Severity::Warning), + "Information" => ::std::option::Option::Some(Severity::Information), + "Hint" => ::std::option::Option::Some(Severity::Hint), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [Severity] = &[ Severity::UnspecifiedSeverity, Severity::Error, @@ -3555,6 +3743,15 @@ impl ::protobuf::Enum for DiagnosticTag { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedDiagnosticTag" => ::std::option::Option::Some(DiagnosticTag::UnspecifiedDiagnosticTag), + "Unnecessary" => ::std::option::Option::Some(DiagnosticTag::Unnecessary), + "Deprecated" => ::std::option::Option::Some(DiagnosticTag::Deprecated), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [DiagnosticTag] = &[ DiagnosticTag::UnspecifiedDiagnosticTag, DiagnosticTag::Unnecessary, @@ -3940,6 +4137,122 @@ impl ::protobuf::Enum for Language { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UnspecifiedLanguage" => ::std::option::Option::Some(Language::UnspecifiedLanguage), + "ABAP" => ::std::option::Option::Some(Language::ABAP), + "Apex" => ::std::option::Option::Some(Language::Apex), + "APL" => ::std::option::Option::Some(Language::APL), + "Ada" => ::std::option::Option::Some(Language::Ada), + "Agda" => ::std::option::Option::Some(Language::Agda), + "AsciiDoc" => ::std::option::Option::Some(Language::AsciiDoc), + "Assembly" => ::std::option::Option::Some(Language::Assembly), + "Awk" => ::std::option::Option::Some(Language::Awk), + "Bat" => ::std::option::Option::Some(Language::Bat), + "BibTeX" => ::std::option::Option::Some(Language::BibTeX), + "C" => ::std::option::Option::Some(Language::C), + "COBOL" => ::std::option::Option::Some(Language::COBOL), + "CPP" => ::std::option::Option::Some(Language::CPP), + "CSS" => ::std::option::Option::Some(Language::CSS), + "CSharp" => ::std::option::Option::Some(Language::CSharp), + "Clojure" => ::std::option::Option::Some(Language::Clojure), + "Coffeescript" => ::std::option::Option::Some(Language::Coffeescript), + "CommonLisp" => ::std::option::Option::Some(Language::CommonLisp), + "Coq" => ::std::option::Option::Some(Language::Coq), + "CUDA" => ::std::option::Option::Some(Language::CUDA), + "Dart" => ::std::option::Option::Some(Language::Dart), + "Delphi" => ::std::option::Option::Some(Language::Delphi), + "Diff" => ::std::option::Option::Some(Language::Diff), + "Dockerfile" => ::std::option::Option::Some(Language::Dockerfile), + "Dyalog" => ::std::option::Option::Some(Language::Dyalog), + "Elixir" => ::std::option::Option::Some(Language::Elixir), + "Erlang" => ::std::option::Option::Some(Language::Erlang), + "FSharp" => ::std::option::Option::Some(Language::FSharp), + "Fish" => ::std::option::Option::Some(Language::Fish), + "Flow" => ::std::option::Option::Some(Language::Flow), + "Fortran" => ::std::option::Option::Some(Language::Fortran), + "Git_Commit" => ::std::option::Option::Some(Language::Git_Commit), + "Git_Config" => ::std::option::Option::Some(Language::Git_Config), + "Git_Rebase" => ::std::option::Option::Some(Language::Git_Rebase), + "Go" => ::std::option::Option::Some(Language::Go), + "GraphQL" => ::std::option::Option::Some(Language::GraphQL), + "Groovy" => ::std::option::Option::Some(Language::Groovy), + "HTML" => ::std::option::Option::Some(Language::HTML), + "Hack" => ::std::option::Option::Some(Language::Hack), + "Handlebars" => ::std::option::Option::Some(Language::Handlebars), + "Haskell" => ::std::option::Option::Some(Language::Haskell), + "Idris" => ::std::option::Option::Some(Language::Idris), + "Ini" => ::std::option::Option::Some(Language::Ini), + "J" => ::std::option::Option::Some(Language::J), + "JSON" => ::std::option::Option::Some(Language::JSON), + "Java" => ::std::option::Option::Some(Language::Java), + "JavaScript" => ::std::option::Option::Some(Language::JavaScript), + "JavaScriptReact" => ::std::option::Option::Some(Language::JavaScriptReact), + "Jsonnet" => ::std::option::Option::Some(Language::Jsonnet), + "Julia" => ::std::option::Option::Some(Language::Julia), + "Justfile" => ::std::option::Option::Some(Language::Justfile), + "Kotlin" => ::std::option::Option::Some(Language::Kotlin), + "LaTeX" => ::std::option::Option::Some(Language::LaTeX), + "Lean" => ::std::option::Option::Some(Language::Lean), + "Less" => ::std::option::Option::Some(Language::Less), + "Lua" => ::std::option::Option::Some(Language::Lua), + "Luau" => ::std::option::Option::Some(Language::Luau), + "Makefile" => ::std::option::Option::Some(Language::Makefile), + "Markdown" => ::std::option::Option::Some(Language::Markdown), + "Matlab" => ::std::option::Option::Some(Language::Matlab), + "Nickel" => ::std::option::Option::Some(Language::Nickel), + "Nix" => ::std::option::Option::Some(Language::Nix), + "OCaml" => ::std::option::Option::Some(Language::OCaml), + "Objective_C" => ::std::option::Option::Some(Language::Objective_C), + "Objective_CPP" => ::std::option::Option::Some(Language::Objective_CPP), + "Pascal" => ::std::option::Option::Some(Language::Pascal), + "PHP" => ::std::option::Option::Some(Language::PHP), + "PLSQL" => ::std::option::Option::Some(Language::PLSQL), + "Perl" => ::std::option::Option::Some(Language::Perl), + "PowerShell" => ::std::option::Option::Some(Language::PowerShell), + "Prolog" => ::std::option::Option::Some(Language::Prolog), + "Protobuf" => ::std::option::Option::Some(Language::Protobuf), + "Python" => ::std::option::Option::Some(Language::Python), + "R" => ::std::option::Option::Some(Language::R), + "Racket" => ::std::option::Option::Some(Language::Racket), + "Raku" => ::std::option::Option::Some(Language::Raku), + "Razor" => ::std::option::Option::Some(Language::Razor), + "Repro" => ::std::option::Option::Some(Language::Repro), + "ReST" => ::std::option::Option::Some(Language::ReST), + "Ruby" => ::std::option::Option::Some(Language::Ruby), + "Rust" => ::std::option::Option::Some(Language::Rust), + "SAS" => ::std::option::Option::Some(Language::SAS), + "SCSS" => ::std::option::Option::Some(Language::SCSS), + "SML" => ::std::option::Option::Some(Language::SML), + "SQL" => ::std::option::Option::Some(Language::SQL), + "Sass" => ::std::option::Option::Some(Language::Sass), + "Scala" => ::std::option::Option::Some(Language::Scala), + "Scheme" => ::std::option::Option::Some(Language::Scheme), + "ShellScript" => ::std::option::Option::Some(Language::ShellScript), + "Skylark" => ::std::option::Option::Some(Language::Skylark), + "Slang" => ::std::option::Option::Some(Language::Slang), + "Solidity" => ::std::option::Option::Some(Language::Solidity), + "Svelte" => ::std::option::Option::Some(Language::Svelte), + "Swift" => ::std::option::Option::Some(Language::Swift), + "Tcl" => ::std::option::Option::Some(Language::Tcl), + "TOML" => ::std::option::Option::Some(Language::TOML), + "TeX" => ::std::option::Option::Some(Language::TeX), + "Thrift" => ::std::option::Option::Some(Language::Thrift), + "TypeScript" => ::std::option::Option::Some(Language::TypeScript), + "TypeScriptReact" => ::std::option::Option::Some(Language::TypeScriptReact), + "Verilog" => ::std::option::Option::Some(Language::Verilog), + "VHDL" => ::std::option::Option::Some(Language::VHDL), + "VisualBasic" => ::std::option::Option::Some(Language::VisualBasic), + "Vue" => ::std::option::Option::Some(Language::Vue), + "Wolfram" => ::std::option::Option::Some(Language::Wolfram), + "XML" => ::std::option::Option::Some(Language::XML), + "XSL" => ::std::option::Option::Some(Language::XSL), + "YAML" => ::std::option::Option::Some(Language::YAML), + "Zig" => ::std::option::Option::Some(Language::Zig), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [Language] = &[ Language::UnspecifiedLanguage, Language::ABAP, diff --git a/buf.gen.yaml b/buf.gen.yaml index 6943935e..4d8353c8 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -14,7 +14,7 @@ plugins: path: ./bindings/typescript/node_modules/.bin/protoc-gen-ts out: ./bindings/typescript/ - name: rust - path: ./.bin/bin/protoc-gen-rust + path: ./.bin/bin/protoc-gen-rs out: ./bindings/rust/src/generated/ - name: haskell out: ./bindings/haskell/src diff --git a/dev/proto-generate.sh b/dev/proto-generate.sh index e1694bfb..bf6ee05f 100755 --- a/dev/proto-generate.sh +++ b/dev/proto-generate.sh @@ -10,9 +10,9 @@ yarn --cwd ./bindings/typescript install --frozen-lockfile echo "--- cargo install rust-protobuf ---" PROTOC_GEN_RUST_VERSION="$(cat bindings/rust/Cargo.toml | grep 'protobuf =' | sed -E 's/.*\"=(.+)\"/\1/g')" if ! grep -q "$PROTOC_GEN_RUST_VERSION" "./.bin/PROTOC_GEN_RUST_VERSION" \ - || ! test -f "./.bin/bin/protoc-gen-rust"; then + || ! test -f "./.bin/bin/protoc-gen-rs"; then rm -rf .bin - cargo install --root .bin protobuf-codegen --version 3.2.0 + cargo install --root .bin protobuf-codegen --version 3.7.1 echo "$PROTOC_GEN_RUST_VERSION" > "./.bin/PROTOC_GEN_RUST_VERSION" fi