Skip to content
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
27 changes: 27 additions & 0 deletions src/debugging/coreclr/dockerNetCoreDebugConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as fse from 'fs-extra';
import * as path from 'path';
import { CancellationToken, commands, DebugConfiguration, DebugConfigurationProvider, MessageItem, ProviderResult, window, WorkspaceFolder } from 'vscode';
import { callWithTelemetryAndErrorHandling } from 'vscode-azureextensionui';
import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { OSProvider } from '../../utils/LocalOSProvider';
import { PlatformOS } from '../../utils/platform';
Expand Down Expand Up @@ -64,6 +65,8 @@ interface DockerDebugConfiguration extends DebugConfiguration {
export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurationProvider {
private static readonly defaultLabels: { [key: string]: string } = { 'com.microsoft.created-by': 'visual-studio-code' };

private deprecationWarningShown: boolean = false;

public constructor(
private readonly debugSessionManager: DebugSessionManager,
private readonly dockerManager: DockerManager,
Expand Down Expand Up @@ -108,6 +111,8 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
return null;
}

this.deprecationWarning();

const { appFolder, resolvedAppFolder } = await this.inferAppFolder(folder, debugConfiguration);

const { resolvedAppProject } = await this.inferAppProject(folder, debugConfiguration, resolvedAppFolder);
Expand Down Expand Up @@ -401,6 +406,28 @@ export class DockerNetCoreDebugConfigurationProvider implements DebugConfigurati
}
};
}

private deprecationWarning(): void {
if (this.deprecationWarningShown) {
return;
}
this.deprecationWarningShown = true;

const deprecationMessage = localize('vscode-docker.debug.coreclr.deprecationWarning', 'The `docker-coreclr` debug type has been deprecated. Do you want to upgrade your launch configuration?');
const upgrade: MessageItem = {
title: localize('vscode-docker.debug.coreclr.upgrade', 'Upgrade'),
};

// Don't wait
// eslint-disable-next-line @typescript-eslint/no-floating-promises
ext.ui.showWarningMessage(deprecationMessage).then(response => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide screenshots

if (response === upgrade) {
// Don't wait
// eslint-disable-next-line @typescript-eslint/no-floating-promises
commands.executeCommand('vscode-docker.debugging.initializeForDebugging');
}
});
}
}

export default DockerNetCoreDebugConfigurationProvider;