Skip to content

Commit

Permalink
fix: catch errors while fetching config tasks from language server (#669
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bxantus committed Jun 29, 2022
1 parent c8d3b7d commit 3c1cb7f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions client/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,22 @@ class DenoTaskProvider implements vscode.TaskProvider {
const supportsConfigTasks = this.#extensionContext.serverCapabilities
?.experimental?.denoConfigTasks;
if (client && supportsConfigTasks) {
const configTasks = await client.sendRequest(taskReq, {});
for (const workspaceFolder of vscode.workspace.workspaceFolders ?? []) {
if (configTasks) {
for (const { name, detail } of configTasks) {
tasks.push(
buildDenoConfigTask(workspaceFolder, process, name, detail),
);
try {
const configTasks = await client.sendRequest(taskReq, {});
for (const workspaceFolder of vscode.workspace.workspaceFolders ?? []) {
if (configTasks) {
for (const { name, detail } of configTasks) {
tasks.push(
buildDenoConfigTask(workspaceFolder, process, name, detail),
);
}
}
}
} catch (err) {
vscode.window.showErrorMessage("Failed to retrieve config tasks.");
this.#extensionContext.outputChannel.appendLine(
`Error retrieving config tasks: ${err}`,
);
}
}

Expand Down

0 comments on commit 3c1cb7f

Please sign in to comment.