903: Work around for issue in vscode reporting a failure in request r=matklad a=vipentti

vscode would report "A request has failed" when it got "Content modified"
message and this would cause a pop-up to appear. This works around the issue by
returning an "empty" response that vscode can ignore.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
This commit is contained in:
bors[bot] 2019-02-27 11:09:47 +00:00
commit c8e78809e5

View File

@ -416,11 +416,20 @@ impl<'a> PoolDispatcher<'a> {
}
Err(e) => {
if is_canceled(&e) {
RawResponse::err(
// FIXME: When https://github.com/Microsoft/vscode-languageserver-node/issues/457
// gets fixed, we can return the proper response.
// This works around the issue where "content modified" error would continuously
// show an message pop-up in VsCode
// RawResponse::err(
// id,
// ErrorCode::ContentModified as i32,
// "content modified".to_string(),
// )
RawResponse {
id,
ErrorCode::ContentModified as i32,
"content modified".to_string(),
)
result: Some(serde_json::to_value(&()).unwrap()),
error: None,
}
} else {
RawResponse::err(
id,