@@ -1,12 +1,11 @@
11use crate::{regex::Regex, Change, Rope, RopeSlice, Transaction};
22pub use helix_syntax::{get_language, get_language_name, Lang};
33
4−#[cfg(feature = "debug")]
5−use std::fmt;
64use std::{
75 borrow::Cow,
86 cell::RefCell,
97 collections::{HashMap, HashSet},
8+ fmt,
109 path::{Path, PathBuf},
1110 sync::Arc,
1211};
@@ -14,15 +13,13 @@ use std::{
1413use once_cell::sync::{Lazy, OnceCell};
1514use serde::{Deserialize, Serialize};
1615
17−#[cfg_attr(feature = "debug", derive(Debug))]
18−#[derive(Serialize, Deserialize)]
16+#[derive(Debug, Serialize, Deserialize)]
1917pub struct Configuration {
2018 pub language: Vec<LanguageConfiguration>,
2119}
2220
2321// largely based on tree-sitter/cli/src/loader.rs
24−#[cfg_attr(feature = "debug", derive(Debug))]
25−#[derive(Serialize, Deserialize)]
22+#[derive(Debug, Serialize, Deserialize)]
2623#[serde(rename_all = "kebab-case")]
2724pub struct LanguageConfiguration {
2825 #[serde(rename = "name")]
@@ -50,8 +47,7 @@ pub struct LanguageConfiguration {
5047 pub(crate) indent_query: OnceCell<Option<IndentQuery>>,
5148}
5249
53−#[cfg_attr(feature = "debug", derive(Debug))]
54−#[derive(Serialize, Deserialize)]
50+#[derive(Debug, Serialize, Deserialize)]
5551#[serde(rename_all = "kebab-case")]
5652pub struct LanguageServerConfiguration {
5753 pub command: String,
@@ -60,16 +56,14 @@ pub struct LanguageServerConfiguration {
6056 pub args: Vec<String>,
6157}
6258
63−#[cfg_attr(feature = "debug", derive(Debug))]
64−#[derive(Serialize, Deserialize)]
59+#[derive(Debug, Serialize, Deserialize)]
6560#[serde(rename_all = "kebab-case")]
6661pub struct IndentationConfiguration {
6762 pub tab_width: usize,
6863 pub unit: String,
6964}
7065
71−#[cfg_attr(feature = "debug", derive(Debug))]
72−#[derive(Serialize, Deserialize)]
66+#[derive(Debug, Serialize, Deserialize)]
7367#[serde(rename_all = "kebab-case")]
7468pub struct IndentQuery {
7569 #[serde(default)]
@@ -196,7 +190,7 @@ impl LanguageConfiguration {
196190
197191pub static LOADER: OnceCell<Loader> = OnceCell::new();
198192
199−#[cfg_attr(feature = "debug", derive(Debug))]
193+#[derive(Debug)]
200194pub struct Loader {
201195 // highlight_names ?
202196 language_configs: Vec<Arc<LanguageConfiguration>>,
@@ -264,10 +258,9 @@ pub struct TsParser {
264258 cursors: Vec<QueryCursor>,
265259}
266260
267−#[cfg(feature = "debug")]
268261impl fmt::Debug for TsParser {
269262 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
270− f.debug_struct("TsParser").finish_non_exhaustive()
263+ f.debug_struct("TsParser").finish()
271264 }
272265}
273266
@@ -279,7 +272,7 @@ thread_local! {
279272 })
280273}
281274
282−#[cfg_attr(feature = "debug", derive(Debug))]
275+#[derive(Debug)]
283276pub struct Syntax {
284277 config: Arc<HighlightConfiguration>,
285278
@@ -460,7 +453,7 @@ impl Syntax {
460453 // buffer_range_for_scope_at_pos
461454}
462455
463−#[cfg_attr(feature = "debug", derive(Debug))]
456+#[derive(Debug)]
464457pub struct LanguageLayer {
465458 // mode
466459 // grammar
@@ -769,7 +762,7 @@ pub enum HighlightEvent {
769762/// Contains the data neeeded to higlight code written in a particular language.
770763///
771764/// This struct is immutable and can be shared between threads.
772−#[cfg_attr(feature = "debug", derive(Debug))]
765+#[derive(Debug)]
773766pub struct HighlightConfiguration {
774767 pub language: Grammar,
775768 pub query: Query,
@@ -800,7 +793,7 @@ struct LocalScope<'a> {
800793 local_defs: Vec<LocalDef<'a>>,
801794}
802795
803−#[cfg_attr(feature = "debug", derive(Debug))]
796+#[derive(Debug)]
804797struct HighlightIter<'a, 'tree: 'a, F>
805798where
806799 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
@@ -826,10 +819,9 @@ struct HighlightIterLayer<'a, 'tree: 'a> {
826819 depth: usize,
827820}
828821
829−#[cfg(feature = "debug")]
830822impl<'a, 'tree: 'a> fmt::Debug for HighlightIterLayer<'a, 'tree> {
831823 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
832− f.debug_struct("HighlightIterLayer").finish_non_exhaustive()
824+ f.debug_struct("HighlightIterLayer").finish()
833825 }
834826}
835827