diff options
Diffstat (limited to 'support/texlab/crates/parser/src/config.rs')
-rw-r--r-- | support/texlab/crates/parser/src/config.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/support/texlab/crates/parser/src/config.rs b/support/texlab/crates/parser/src/config.rs index f81083f132..2c5380448f 100644 --- a/support/texlab/crates/parser/src/config.rs +++ b/support/texlab/crates/parser/src/config.rs @@ -3,12 +3,15 @@ use rustc_hash::FxHashSet; #[derive(Debug)] pub struct SyntaxConfig { pub follow_package_links: bool, + pub use_file_list: bool, pub math_environments: FxHashSet<String>, pub enum_environments: FxHashSet<String>, pub verbatim_environments: FxHashSet<String>, pub citation_commands: FxHashSet<String>, pub label_definition_commands: FxHashSet<String>, + pub label_definition_prefixes: Vec<(String, String)>, pub label_reference_commands: FxHashSet<String>, + pub label_reference_prefixes: Vec<(String, String)>, } impl Default for SyntaxConfig { @@ -38,19 +41,32 @@ impl Default for SyntaxConfig { .map(ToString::to_string) .collect(); + let label_definition_prefixes = DEFAULT_LABEL_DEFINITION_PREFIXES + .iter() + .map(|(x, y)| (ToString::to_string(x), ToString::to_string(y))) + .collect(); + let label_reference_commands = DEFAULT_LABEL_REFERENCE_COMMANDS .iter() .map(ToString::to_string) .collect(); + let label_reference_prefixes = DEFAULT_LABEL_REFERENCE_PREFIXES + .iter() + .map(|(x, y)| (ToString::to_string(x), ToString::to_string(y))) + .collect(); + Self { follow_package_links: false, + use_file_list: false, math_environments, enum_environments, verbatim_environments, citation_commands, label_definition_commands, + label_definition_prefixes, label_reference_commands, + label_reference_prefixes, } } } @@ -170,7 +186,9 @@ static DEFAULT_CITATION_COMMANDS: &[&str] = &[ "citeA*", ]; -static DEFAULT_LABEL_DEFINITION_COMMANDS: &[&str] = &["label"]; +static DEFAULT_LABEL_DEFINITION_COMMANDS: &[&str] = &["label", "zlabel"]; + +static DEFAULT_LABEL_DEFINITION_PREFIXES: &[(&str, &str)] = &[]; static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[ "ref", @@ -182,6 +200,10 @@ static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[ "cref*", "Cref", "Cref*", + "zcref", + "zcref*", + "zcpageref", + "zcpageref*", "namecref", "nameCref", "lcnamecref", @@ -192,3 +214,5 @@ static DEFAULT_LABEL_REFERENCE_COMMANDS: &[&str] = &[ "labelcpageref", "eqref", ]; + +static DEFAULT_LABEL_REFERENCE_PREFIXES: &[(&str, &str)] = &[]; |