Debian Codegraph @

helix-view/src/events.rs

raw symbols SCIP
1 use helix_core::{ChangeSet, Rope};
2 use helix_event::events;
3 use helix_lsp::LanguageServerId;
4
5 use crate::{editor::Config, Document, DocumentId, Editor, ViewId};
6
7 events! {
8 DocumentDidOpen<'a> {
9 editor: &'a mut Editor,
10 doc: DocumentId
11 }
12 DocumentDidChange<'a> {
13 doc: &'a mut Document,
14 view: ViewId,
15 old_text: &'a Rope,
16 changes: &'a ChangeSet,
17 ghost_transaction: bool
18 }
19 DocumentDidClose<'a> {
20 editor: &'a mut Editor,
21 doc: Document
22 }
23 SelectionDidChange<'a> { doc: &'a mut Document, view: ViewId }
24 DiagnosticsDidChange<'a> { editor: &'a mut Editor, doc: DocumentId }
25 // called **after** a document loses focus (but not when its closed)
26 DocumentFocusLost<'a> { editor: &'a mut Editor, doc: DocumentId }
27
28 LanguageServerInitialized<'a> {
29 editor: &'a mut Editor,
30 server_id: LanguageServerId
31 }
32 LanguageServerExited<'a> {
33 editor: &'a mut Editor,
34 server_id: LanguageServerId
35 }
36
37 // NOTE: this event is simple for now and is expected to change as the config system evolves.
38 // Ideally it would say what changed.
39 ConfigDidChange<'a> {
40 editor: &'a mut Editor,
41 old: &'a Config,
42 new: &'a Config
43 }
44 }