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