lsp_core/feature/
hover.rs1use bevy_ecs::{
2 component::Component,
3 schedule::{IntoSystemConfigs, Schedule, ScheduleLabel},
4 world::World,
5};
6
7pub use crate::{
8 systems::{hover_class, hover_property, hover_types, infer_types},
9 util::{token::get_current_token, triple::get_current_triple},
10};
11
12#[derive(Component, Debug, Default)]
14pub struct HoverRequest(pub Vec<String>, pub Option<lsp_types::Range>);
15
16#[derive(ScheduleLabel, Clone, Eq, PartialEq, Debug, Hash)]
18pub struct Label;
19
20pub fn setup_schedule(world: &mut World) {
21 let mut hover = Schedule::new(Label);
22 hover.add_systems((
23 infer_types,
24 get_current_token,
25 get_current_triple.after(get_current_token),
26 hover_types
27 .before(hover_class)
28 .before(hover_property)
29 .after(get_current_token)
30 .after(infer_types),
31 hover_class.after(get_current_token),
32 hover_property.after(get_current_token),
33 ));
34 world.add_schedule(hover);
35}