Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtask lsp: optionally source app.toml from HUBRIS_APP #1771

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions build/xtask/src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,17 @@ fn inner(file: &PathBuf, clients: &[LspClient]) -> Result<LspConfig> {
}
}

let preferred_apps = [
"app/gimlet/rev-c.toml",
"app/sidecar/rev-b.toml",
"app/psc/rev-b.toml",
];
let preferred_apps = if let Ok(toml) = std::env::var("HUBRIS_APP") {
vec![toml]
} else {
vec![
"app/gimlet/rev-c.toml".to_string(),
"app/sidecar/rev-b.toml".to_string(),
"app/psc/rev-b.toml".to_string(),
]
};
for app_name in preferred_apps {
let file = root.join(app_name);
let file = root.join(&app_name);
let app_cfg = PackageConfig::new(&file, false, false)
.context(format!("could not open {file:?}"))?;

Expand All @@ -365,7 +369,7 @@ fn inner(file: &PathBuf, clients: &[LspClient]) -> Result<LspConfig> {
check_task(
&package_name,
task_name,
app_name,
&app_name,
&app_cfg,
&packages,
)
Expand Down
Loading