diff --git a/enums/src/go.rs b/enums/src/go.rs index ea1192937..544c801f7 100644 --- a/enums/src/go.rs +++ b/enums/src/go.rs @@ -6,7 +6,7 @@ use std::path::Path; use crate::common::*; use crate::languages::*; -#[derive(Template)] +#[derive(Debug, Template)] #[template(path = "go.go", escape = "none")] struct GoTemplate { c_name: String, diff --git a/enums/src/json.rs b/enums/src/json.rs index bfff966ba..c50b20914 100644 --- a/enums/src/json.rs +++ b/enums/src/json.rs @@ -6,7 +6,7 @@ use std::path::Path; use crate::common::*; use crate::languages::*; -#[derive(Template)] +#[derive(Debug, Template)] #[template(path = "json.json", escape = "none")] struct JsonTemplate { names: Vec<(String, bool, String)>, diff --git a/enums/src/rust.rs b/enums/src/rust.rs index 6ee862b59..6640bde6e 100644 --- a/enums/src/rust.rs +++ b/enums/src/rust.rs @@ -9,7 +9,7 @@ use crate::languages::*; const MACROS_DEFINITION_DIR: &str = "data"; -#[derive(Template)] +#[derive(Debug, Template)] #[template(path = "rust.rs", escape = "none")] struct RustTemplate { c_name: String, @@ -36,7 +36,7 @@ pub fn generate_rust(output: &Path, file_template: &str) -> std::io::Result<()> Ok(()) } -#[derive(Template)] +#[derive(Debug, Template)] #[template(path = "c_macros.rs", escape = "none")] struct CMacrosTemplate { u_name: String, diff --git a/rust-code-analysis-web/src/web/comment.rs b/rust-code-analysis-web/src/web/comment.rs index 7620555e7..7b3fa7c8f 100644 --- a/rust-code-analysis-web/src/web/comment.rs +++ b/rust-code-analysis-web/src/web/comment.rs @@ -32,12 +32,14 @@ pub struct WebCommentInfo { } /// Server request configuration. +#[derive(Debug)] pub struct WebCommentCfg { /// Request identifier. pub id: String, } /// Unit structure to implement the `Callback` trait. +#[derive(Debug)] pub struct WebCommentCallback; impl Callback for WebCommentCallback { diff --git a/rust-code-analysis-web/src/web/function.rs b/rust-code-analysis-web/src/web/function.rs index 62670e8b4..bfc270fbb 100644 --- a/rust-code-analysis-web/src/web/function.rs +++ b/rust-code-analysis-web/src/web/function.rs @@ -31,6 +31,7 @@ pub struct WebFunctionInfo { } /// Server request configuration. +#[derive(Debug)] pub struct WebFunctionCfg { /// Request identifier. pub id: String, diff --git a/rust-code-analysis-web/src/web/metrics.rs b/rust-code-analysis-web/src/web/metrics.rs index 49b2d59a8..e252423ad 100644 --- a/rust-code-analysis-web/src/web/metrics.rs +++ b/rust-code-analysis-web/src/web/metrics.rs @@ -44,6 +44,7 @@ pub struct WebMetricsInfo { } /// Server request configuration. +#[derive(Debug)] pub struct WebMetricsCfg { /// Request identifier. pub id: String, diff --git a/src/ast.rs b/src/ast.rs index 1a5cd8e50..795564597 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -128,6 +128,7 @@ pub struct AstCallback { } /// Configuration options for retrieving the nodes of an `AST`. +#[derive(Debug)] pub struct AstCfg { /// The id associated to a request for an `AST` pub id: String, diff --git a/src/comment_rm.rs b/src/comment_rm.rs index ce3344e16..4d96a5aef 100644 --- a/src/comment_rm.rs +++ b/src/comment_rm.rs @@ -62,6 +62,7 @@ fn remove_from_code(code: &[u8], mut spans: Vec<(usize, usize, usize)>) -> Vec = dyn Fn(&Path, &Config) + Send + Sync; fn null_proc_dir_paths(_: &mut HashMap>, _: &Path, _: &Config) {} fn null_proc_path(_: &Path, _: &Config) {} +#[derive(Debug)] struct JobItem { path: PathBuf, cfg: Arc, @@ -141,6 +142,7 @@ pub enum ConcurrentErrors { } /// Data related to files. +#[derive(Debug)] pub struct FilesData { /// Kind of files included in a search. pub include: GlobSet, diff --git a/src/count.rs b/src/count.rs index 1bf6906cd..739c9a536 100644 --- a/src/count.rs +++ b/src/count.rs @@ -38,6 +38,7 @@ pub fn count(parser: &T, filters: &[String]) -> (usize, usize) { /// Configuration options for counting different /// types of nodes in a code. +#[derive(Debug)] pub struct CountCfg { /// Types of nodes to count pub filters: Vec, diff --git a/src/find.rs b/src/find.rs index cfcd9ce40..f441fe533 100644 --- a/src/find.rs +++ b/src/find.rs @@ -38,6 +38,7 @@ pub fn find<'a, T: ParserTrait>(parser: &'a T, filters: &[String]) -> Option, path: PathBuf) -> std::io::Result<() /// Configuration options for detecting the span of /// each function in a code. +#[derive(Debug)] pub struct FunctionCfg { /// Path to the file containing the code pub path: PathBuf, diff --git a/src/node.rs b/src/node.rs index 994a774f6..1142dc77b 100644 --- a/src/node.rs +++ b/src/node.rs @@ -5,7 +5,7 @@ use tree_sitter::{Parser, TreeCursor}; use crate::checker::Checker; use crate::traits::{LanguageInfo, Search}; -#[derive(Clone)] +#[derive(Clone, Debug)] pub(crate) struct Tree(OtherTree); impl Tree { @@ -24,7 +24,7 @@ impl Tree { } /// An `AST` node. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct Node<'a>(OtherNode<'a>); impl<'a> Node<'a> { diff --git a/src/ops.rs b/src/ops.rs index e591b2c7a..1c9aaec3c 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -223,6 +223,7 @@ pub fn operands_and_operators<'a, T: ParserTrait>(parser: &'a T, path: &'a Path) /// Configuration options for retrieving /// all the operands and operators in a code. +#[derive(Debug)] pub struct OpsCfg { /// Path to the file containing the code. pub path: PathBuf, diff --git a/src/output/dump.rs b/src/output/dump.rs index 75953eff9..546b0326a 100644 --- a/src/output/dump.rs +++ b/src/output/dump.rs @@ -158,6 +158,7 @@ fn dump_tree_helper( } /// Configuration options for dumping the `AST` of a code. +#[derive(Debug)] pub struct DumpCfg { /// The first line of code to dump /// diff --git a/src/parser.rs b/src/parser.rs index 41192e1f5..0aa789855 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -25,6 +25,7 @@ use crate::node::{Node, Tree}; use crate::preproc::{get_macros, PreprocResults}; use crate::traits::*; +#[derive(Debug)] pub struct Parser< T: LanguageInfo + Alterator diff --git a/src/spaces.rs b/src/spaces.rs index 11a495aef..84b4e9a42 100644 --- a/src/spaces.rs +++ b/src/spaces.rs @@ -358,6 +358,7 @@ pub fn metrics<'a, T: ParserTrait>(parser: &'a T, path: &'a Path) -> Option