Skip to content

Commit 6f2ee22

Browse files
alanzmeta-codesync[bot]
authored andcommitted
buck2: Improve pop-up when the buck project is malformed
Summary: When ELP is loading a buck project it does queries using buck. Sometimes these fail, because the current state of the buck configuration files is invalid. In that case, we show a pop-up suggesting that the user examine the buck dashboard, and provide a URL for this. It is not always clear to the user that this is related to a malformed buck project, rather than a bug in ELP. This diff tries to make it clearer. Note that we unfortunately do not have the ability to use any kind of formatting in the displayed message. Reviewed By: TD5 Differential Revision: D86510447 fbshipit-source-id: 57a93f829d37a8a4d7c8be88d6cf68adcf41c859
1 parent 4227771 commit 6f2ee22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/elp/src/server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,9 +1803,13 @@ impl Server {
18031803
}
18041804
for (err, uri) in errors {
18051805
if let Some(uri) = uri {
1806+
// It is not possible to put line breaks or other formatting in the message
1807+
let error_message = format!(
1808+
"Look at `Details` in the buck UI for more information, there is likely an invalid BUCK file: {err}"
1809+
);
18061810
let params = lsp_types::ShowMessageRequestParams {
18071811
typ: lsp_types::MessageType::ERROR,
1808-
message: err,
1812+
message: error_message,
18091813
actions: Some(vec![MessageActionItem {
18101814
title: "Open Buck UI".to_string(),
18111815
properties: HashMap::from_iter(vec![(

0 commit comments

Comments
 (0)