Mountain/RPC/EchoAction/ResolveMethodPriority.rs
1
2//! Map a Cocoon→Mountain wire method name to an Echo priority lane.
3//!
4//! | Wire method | Lane | Reason |
5//! | --------------------------------------- | ------ | ----------------------------------- |
6//! | `FileSystem.ReadFile` / `WriteFile` | High | extension UI waits on it |
7//! | `ShowInformationMessage` / `ShowError…` | High | user-visible |
8//! | `ExecuteContributedCommand` | High | user action |
9//! | `RegisterCommand` + Register* providers | Normal | activation path |
10//! | `Configuration.Inspect` | Normal | common, not critical |
11//! | `FindFiles` / `FindTextInFiles` | Low | long-running |
12//! | `GitExec` | Low | spawns subprocess |
13//! | everything else | Normal | safe default |
14
15use Echo::Task::Priority::Priority as EchoPriority;
16
17pub fn Fn(Method:&str) -> EchoPriority {
18 match Method {
19 "FileSystem.ReadFile"
20 | "FileSystem.WriteFile"
21 | "FileSystem.Stat"
22 | "ShowInformationMessage"
23 | "ShowWarningMessage"
24 | "ShowErrorMessage"
25 | "ExecuteContributedCommand"
26 | "ShowTextDocument" => EchoPriority::High,
27
28 "FindFiles" | "FindTextInFiles" | "GitExec" | "WatchFile" => EchoPriority::Low,
29
30 _ => EchoPriority::Normal,
31 }
32}