Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T05:00:12.718Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

language_tools.rs

58 lines · 1.5 KB · rust
1mod highlights_tree_view;
2mod key_context_view;
3pub mod lsp_button;
4pub mod lsp_log_view;
5mod syntax_tree_view;
6
7#[cfg(test)]
8mod lsp_log_view_tests;
9
10use gpui::{App, AppContext, Entity};
11
12pub use highlights_tree_view::{HighlightsTreeToolbarItemView, HighlightsTreeView};
13pub use lsp_log_view::LspLogView;
14pub use syntax_tree_view::{SyntaxTreeToolbarItemView, SyntaxTreeView};
15use ui::{Context, Window};
16use workspace::{Item, ItemHandle, SplitDirection, Workspace};
17
18pub fn init(cx: &mut App) {
19    highlights_tree_view::init(cx);
20    lsp_log_view::init(false, cx);
21    syntax_tree_view::init(cx);
22    key_context_view::init(cx);
23}
24
25fn get_or_create_tool<T>(
26    workspace: &mut Workspace,
27    destination: SplitDirection,
28    window: &mut Window,
29    cx: &mut Context<Workspace>,
30    new_tool: impl FnOnce(&mut Window, &mut Context<T>) -> T,
31) -> Entity<T>
32where
33    T: Item,
34{
35    if let Some(item) = workspace.item_of_type::<T>(cx) {
36        return item;
37    }
38
39    let new_tool = cx.new(|cx| new_tool(window, cx));
40    match workspace.find_pane_in_direction(destination, cx) {
41        Some(right_pane) => {
42            workspace.add_item(
43                right_pane,
44                new_tool.boxed_clone(),
45                None,
46                true,
47                true,
48                window,
49                cx,
50            );
51        }
52        None => {
53            workspace.split_item(destination, new_tool.boxed_clone(), window, cx);
54        }
55    }
56    new_tool
57}
58
Served at tenant.openagents/omega Member data and write actions are omitted.