Skip to content

Commit 2f103ff

Browse files
fix(amazonq): Remove the 'Cancel' button on LSP download (#7184)
Just remove the 'Cancel' button for now when downloading the language server. We do not want to deal with the edge case of a user cancelling part way and then their Q features don't work since it depends on the language server. <img width="402" alt="Screenshot 2025-04-28 at 12 18 54 PM" src="https://github.com/user-attachments/assets/96d53b34-b12a-4d96-a761-c4600f12486a" /> --- TODO: Figure out a better solution for allowing users to cancel the LS download, but then making it easy to download again if they eventually want it. We will also need to design it so they are aware that cancelling will prevent Q features from working. This will require an update to the spec. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: nkomonen-amazon <[email protected]>
1 parent dfd9406 commit 2f103ff

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/core/src/shared/lsp/lspResolver.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import { TargetContent, logger, LspResult, LspVersion, Manifest } from './types'
1313
import { createHash } from '../crypto'
1414
import { lspSetupStage, StageResolver, tryStageResolvers } from './utils/setupStage'
1515
import { HttpResourceFetcher } from '../resourcefetcher/httpResourceFetcher'
16-
import { showMessageWithCancel } from '../../shared/utilities/messages'
16+
import { showProgressWithTimeout } from '../../shared/utilities/messages'
1717
import { Timeout } from '../utilities/timeoutUtils'
1818
import { oneMinute } from '../datetime'
19+
import vscode from 'vscode'
1920

2021
// max timeout for downloading remote LSP assets. Some asserts are large (100+ MB) so this needs to be large for slow connections.
2122
// Since the user can cancel this one we can let it run very long.
@@ -106,7 +107,15 @@ export class LanguageServerResolver {
106107
*/
107108
private async showDownloadProgress() {
108109
const timeout = new Timeout(remoteDownloadTimeout)
109-
await showMessageWithCancel(`Downloading '${this.lsName}' language server`, timeout)
110+
void showProgressWithTimeout(
111+
{
112+
title: `Downloading '${this.lsName}' language server`,
113+
location: vscode.ProgressLocation.Notification,
114+
cancellable: false,
115+
},
116+
timeout,
117+
0
118+
)
110119
return timeout
111120
}
112121

packages/core/src/shared/utilities/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export function showOutputMessage(message: string, outputChannel: vscode.OutputC
236236
*
237237
* @see showMessageWithCancel for an example usage
238238
*/
239-
async function showProgressWithTimeout(
239+
export async function showProgressWithTimeout(
240240
options: vscode.ProgressOptions,
241241
timeout: Timeout,
242242
showAfterMs: number

0 commit comments

Comments
 (0)