1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! # dscode-core
//!
//! Core types, text buffer, and configuration for the DSCode IDE.
//!
//! This crate provides the fundamental building blocks used across all DSCode
//! components:
//!
//! - [`TextBuffer`] — Rope-based text storage for efficient editing operations
//! - [`AppDirectories`] — Platform-aware directory resolution for extensions, storage, and logs
//! - [`CoreError`] — Unified error type for core operations
//!
//! # Example
//!
//! ```rust
//! use dscode_core::TextBuffer;
//!
//! let buffer = TextBuffer::new("Hello, world!");
//! assert_eq!(buffer.len_chars(), 13);
//! assert_eq!(buffer.get_text(), "Hello, world!");
//! ```
// mod syntax; // Placeholder for tree-sitter integration
/// Re-export of [`AppDirectories`] — platform-aware directory resolution.
///
/// See [`AppDirectories::resolve`] for the full resolution logic including
/// environment variable overrides and user configuration files.
pub use AppDirectories;
/// Re-export of [`CoreError`] — the unified error type for dscode-core.
///
/// All fallible operations in this crate return `Result<T, CoreError>`.
pub use CoreError;
/// Re-export of [`TextBuffer`] — a rope-based text buffer for efficient editing.
///
/// Use [`TextBuffer::new`] to create a buffer from a string slice.
pub use TextBuffer;