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