2024-03-04 06:13:22 +08:00
|
|
|
use helix_core::{ChangeSet, Rope};
|
2023-12-01 07:03:26 +08:00
|
|
|
use helix_event::events;
|
2025-03-03 01:50:24 +08:00
|
|
|
use helix_lsp::LanguageServerId;
|
2023-12-01 07:03:26 +08:00
|
|
|
|
2024-04-05 09:17:06 +08:00
|
|
|
use crate::{Document, DocumentId, Editor, ViewId};
|
2023-12-01 07:03:26 +08:00
|
|
|
|
|
|
|
events! {
|
2025-03-03 01:50:24 +08:00
|
|
|
DocumentDidOpen<'a> {
|
|
|
|
editor: &'a mut Editor,
|
|
|
|
doc: DocumentId
|
|
|
|
}
|
2024-03-04 06:13:22 +08:00
|
|
|
DocumentDidChange<'a> {
|
|
|
|
doc: &'a mut Document,
|
|
|
|
view: ViewId,
|
|
|
|
old_text: &'a Rope,
|
|
|
|
changes: &'a ChangeSet,
|
|
|
|
ghost_transaction: bool
|
|
|
|
}
|
2025-03-03 01:50:24 +08:00
|
|
|
DocumentDidClose<'a> {
|
|
|
|
editor: &'a mut Editor,
|
|
|
|
doc: Document
|
|
|
|
}
|
2023-12-01 07:03:26 +08:00
|
|
|
SelectionDidChange<'a> { doc: &'a mut Document, view: ViewId }
|
2024-04-05 09:17:06 +08:00
|
|
|
DiagnosticsDidChange<'a> { editor: &'a mut Editor, doc: DocumentId }
|
2024-03-04 06:20:30 +08:00
|
|
|
// called **after** a document loses focus (but not when its closed)
|
|
|
|
DocumentFocusLost<'a> { editor: &'a mut Editor, doc: DocumentId }
|
2025-03-03 01:50:24 +08:00
|
|
|
|
|
|
|
LanguageServerInitialized<'a> {
|
|
|
|
editor: &'a mut Editor,
|
|
|
|
server_id: LanguageServerId
|
|
|
|
}
|
|
|
|
LanguageServerExited<'a> {
|
|
|
|
editor: &'a mut Editor,
|
|
|
|
server_id: LanguageServerId
|
|
|
|
}
|
2023-12-01 07:03:26 +08:00
|
|
|
}
|