Skip to content

Avoid notifying of failures for workspace builds. #4032

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

Merged
merged 1 commit into from
May 8, 2025
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
32 changes: 14 additions & 18 deletions src/standardLanguageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,22 +493,22 @@ export class StandardLanguageClient {

return window.withProgress({ location: ProgressLocation.Window }, async p => {
p.report({ message: 'Rebuilding projects...' });
return new Promise(async (resolve, reject) => {
const start = new Date().getTime();
const start = new Date().getTime();

let res: CompileWorkspaceStatus;
try {
res = token ? await this.languageClient.sendRequest(BuildProjectRequest.type, params, token) :
await this.languageClient.sendRequest(BuildProjectRequest.type, params);
} catch (error) {
if (error && error.code === -32800) { // Check if the request is cancelled.
res = CompileWorkspaceStatus.cancelled;
}
reject(error);
let res: CompileWorkspaceStatus;
try {
res = token ? await this.languageClient.sendRequest(BuildProjectRequest.type, params, token) :
await this.languageClient.sendRequest(BuildProjectRequest.type, params);
} catch (error) {
if (error && error.code === -32800) { // Check if the request is cancelled.
res = CompileWorkspaceStatus.cancelled;
}
throw error;
}

const elapsed = new Date().getTime() - start;
const humanVisibleDelay = elapsed < 1000 ? 1000 : 0;
const elapsed = new Date().getTime() - start;
const humanVisibleDelay = elapsed < 1000 ? 1000 : 0;
return new Promise(async (resolve, reject) => {
setTimeout(() => { // set a timeout so user would still see the message when build time is short
resolve(res);
}, humanVisibleDelay);
Expand Down Expand Up @@ -540,11 +540,7 @@ export class StandardLanguageClient {
const humanVisibleDelay = elapsed < 1000 ? 1000 : 0;
return new Promise((resolve, reject) => {
setTimeout(() => { // set a timeout so user would still see the message when build time is short
if (res === CompileWorkspaceStatus.succeed) {
resolve(res);
} else {
reject(res);
}
resolve(res);
}, humanVisibleDelay);
});
});
Expand Down