Skip to content

Commit

Permalink
Use pervious crashed TS Server version to check if user was on old TS…
Browse files Browse the repository at this point in the history
… version (#173620)

Use pervious crashed version to check if user was on old TS version

Fixes #133818
  • Loading branch information
mjbvz authored Feb 6, 2023
1 parent 056bc87 commit 25514d8
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,20 @@ export default class TypeScriptServiceClient extends Disposable implements IType
if (item === reportIssueItem) {
const minModernTsVersion = this.versionProvider.bundledVersion.apiVersion;

if (minModernTsVersion && this.apiVersion.lt(minModernTsVersion)) {
if (
minModernTsVersion &&
previousState.type === ServerState.Type.Errored &&
previousState.error instanceof TypeScriptServerError &&
previousState.error.version.apiVersion?.lt(minModernTsVersion)
) {
vscode.window.showWarningMessage(
vscode.l10n.t("Please update your TypeScript version"),
{
modal: true,
detail: vscode.l10n.t(
"The workspace is using an old version of TypeScript ({0}).\n\nBefore reporting an issue, please update the workspace to use the latest stable TypeScript release to make sure the bug has not already been fixed.",
(previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError ? previousState.error.version.apiVersion?.displayName : undefined) + ''),
"The workspace is using an old version of TypeScript ({0}).\n\nBefore reporting an issue, please update the workspace to use TypeScript {1} or newer to make sure the bug has not already been fixed.",
previousState.error.version.apiVersion.displayName,
minModernTsVersion.displayName),
});
} else {
const args = previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError
Expand Down

0 comments on commit 25514d8

Please sign in to comment.