mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Add client install support for code-exploration
build.
This commit is contained in:
parent
e2e6b709e6
commit
7cf2c0d46f
1 changed files with 14 additions and 6 deletions
|
@ -16,6 +16,7 @@ pub struct InstallCmd {
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub enum ClientOpt {
|
pub enum ClientOpt {
|
||||||
VsCode,
|
VsCode,
|
||||||
|
VsCodeExploration,
|
||||||
VsCodeInsiders,
|
VsCodeInsiders,
|
||||||
VsCodium,
|
VsCodium,
|
||||||
VsCodeOss,
|
VsCodeOss,
|
||||||
|
@ -26,10 +27,11 @@ impl ClientOpt {
|
||||||
pub const fn as_cmds(&self) -> &'static [&'static str] {
|
pub const fn as_cmds(&self) -> &'static [&'static str] {
|
||||||
match self {
|
match self {
|
||||||
ClientOpt::VsCode => &["code"],
|
ClientOpt::VsCode => &["code"],
|
||||||
|
ClientOpt::VsCodeExploration => &["code-exploration"],
|
||||||
ClientOpt::VsCodeInsiders => &["code-insiders"],
|
ClientOpt::VsCodeInsiders => &["code-insiders"],
|
||||||
ClientOpt::VsCodium => &["codium"],
|
ClientOpt::VsCodium => &["codium"],
|
||||||
ClientOpt::VsCodeOss => &["code-oss"],
|
ClientOpt::VsCodeOss => &["code-oss"],
|
||||||
ClientOpt::Any => &["code", "code-insiders", "codium", "code-oss"],
|
ClientOpt::Any => &["code", "code-exploration", "code-insiders", "codium", "code-oss"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +46,13 @@ impl std::str::FromStr for ClientOpt {
|
||||||
type Err = anyhow::Error;
|
type Err = anyhow::Error;
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
[ClientOpt::VsCode, ClientOpt::VsCodeInsiders, ClientOpt::VsCodium, ClientOpt::VsCodeOss]
|
[
|
||||||
|
ClientOpt::VsCode,
|
||||||
|
ClientOpt::VsCodeExploration,
|
||||||
|
ClientOpt::VsCodeInsiders,
|
||||||
|
ClientOpt::VsCodium,
|
||||||
|
ClientOpt::VsCodeOss,
|
||||||
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.copied()
|
.copied()
|
||||||
.find(|c| [s] == c.as_cmds())
|
.find(|c| [s] == c.as_cmds())
|
||||||
|
|
Loading…
Reference in a new issue