Add missing Debug traits (#1088)
This commit is contained in:
Родитель
7ced6d7fe5
Коммит
9a234709c4
|
@ -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,
|
||||
|
|
|
@ -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)>,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -31,6 +31,7 @@ pub struct WebFunctionInfo {
|
|||
}
|
||||
|
||||
/// Server request configuration.
|
||||
#[derive(Debug)]
|
||||
pub struct WebFunctionCfg {
|
||||
/// Request identifier.
|
||||
pub id: String,
|
||||
|
|
|
@ -44,6 +44,7 @@ pub struct WebMetricsInfo {
|
|||
}
|
||||
|
||||
/// Server request configuration.
|
||||
#[derive(Debug)]
|
||||
pub struct WebMetricsCfg {
|
||||
/// Request identifier.
|
||||
pub id: String,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -62,6 +62,7 @@ fn remove_from_code(code: &[u8], mut spans: Vec<(usize, usize, usize)>) -> Vec<u
|
|||
}
|
||||
|
||||
/// Configuration options for removing comments from a code.
|
||||
#[derive(Debug)]
|
||||
pub struct CommentRmCfg {
|
||||
/// If `true`, the modified code is saved on a file
|
||||
pub in_place: bool,
|
||||
|
|
|
@ -18,6 +18,7 @@ type ProcPathFunction<Config> = dyn Fn(&Path, &Config) + Send + Sync;
|
|||
fn null_proc_dir_paths<Config>(_: &mut HashMap<String, Vec<PathBuf>>, _: &Path, _: &Config) {}
|
||||
fn null_proc_path<Config>(_: &Path, _: &Config) {}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct JobItem<Config> {
|
||||
path: PathBuf,
|
||||
cfg: Arc<Config>,
|
||||
|
@ -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,
|
||||
|
|
|
@ -38,6 +38,7 @@ pub fn count<T: ParserTrait>(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<String>,
|
||||
|
|
|
@ -38,6 +38,7 @@ pub fn find<'a, T: ParserTrait>(parser: &'a T, filters: &[String]) -> Option<Vec
|
|||
|
||||
/// Configuration options for finding different
|
||||
/// types of nodes in a code.
|
||||
#[derive(Debug)]
|
||||
pub struct FindCfg {
|
||||
/// Path to the file containing the code
|
||||
pub path: PathBuf,
|
||||
|
|
|
@ -113,6 +113,7 @@ fn dump_spans(mut spans: Vec<FunctionSpan>, 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,
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
///
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -358,6 +358,7 @@ pub fn metrics<'a, T: ParserTrait>(parser: &'a T, path: &'a Path) -> Option<Func
|
|||
|
||||
/// Configuration options for computing
|
||||
/// the metrics of a code.
|
||||
#[derive(Debug)]
|
||||
pub struct MetricsCfg {
|
||||
/// Path to the file containing the code
|
||||
pub path: PathBuf,
|
||||
|
|
Загрузка…
Ссылка в новой задаче