@@ -54,7 +54,7 @@ fn indent_trimmed(s: &str, prefix: &str) -> String {
5454}
5555
5656/// The documentation provided by a user for a specific module, object, function, etc.
57- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Trace ) ]
57+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Trace , Default ) ]
5858pub struct DocString {
5959 /// The first line of a doc string. This has whitespace trimmed from it.
6060 pub summary : String ,
@@ -355,7 +355,7 @@ impl DocString {
355355}
356356
357357/// Line / column for where in a file a symbol is.
358- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
358+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
359359pub struct Pos {
360360 /// Line number, zero based.
361361 pub line : usize ,
@@ -364,7 +364,7 @@ pub struct Pos {
364364}
365365
366366/// The file a symbol resides in, and if available its location within that file.
367- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
367+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
368368pub struct Location {
369369 /// `path` is a string that can be passed into `load()` statements.
370370 pub path : String ,
@@ -373,7 +373,7 @@ pub struct Location {
373373}
374374
375375/// The main identifier for a symbol.
376- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
376+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
377377pub struct Identifier {
378378 /// The name of the symbol (e.g. the function name, a name or path for a module, etc).
379379 pub name : String ,
@@ -382,14 +382,14 @@ pub struct Identifier {
382382}
383383
384384/// The type of a given parameter, field, etc.
385- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
385+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
386386pub struct Type {
387387 /// The type string that one would find in a starlark expression.
388388 pub raw_type : String ,
389389}
390390
391391/// Documents a full module.
392- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
392+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
393393pub struct Module {
394394 /// In general, this should be the first statement of a loaded file, if that statement is
395395 /// a string literal.
@@ -406,7 +406,7 @@ impl Module {
406406}
407407
408408/// Documents a single function.
409- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
409+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
410410pub struct Function {
411411 /// Documentation for the function. If parsed, this should generally be the first statement
412412 /// of a function's body if that statement is a string literal. Any sections like "Args:",
@@ -669,7 +669,7 @@ impl Param {
669669}
670670
671671/// Details about the return value of a function.
672- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
672+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
673673pub struct Return {
674674 /// Extra semantic details around the returned value's meaning.
675675 pub docs : Option < DocString > ,
@@ -684,7 +684,7 @@ impl Return {
684684}
685685
686686/// A single property of an object. These are explicitly not functions (see [`Member`]).
687- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
687+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
688688pub struct Property {
689689 pub docs : Option < DocString > ,
690690 #[ serde( rename = "type" ) ]
@@ -724,7 +724,7 @@ pub enum Member {
724724}
725725
726726/// An object with named functions/properties.
727- #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
727+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
728728pub struct Object {
729729 pub docs : Option < DocString > ,
730730 /// Name and details of each member of this object.
0 commit comments