Skip to content

Commit

Permalink
Start actually removing old
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft committed Jul 24, 2020
1 parent d0c7bdb commit a706e35
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 1,796 deletions.
2 changes: 0 additions & 2 deletions extension.bundle.ts
Expand Up @@ -18,8 +18,6 @@ export { deactivateInternal } from './src/extension';
//
// The tests should import '../extension.bundle.ts'. At design-time they live in tests/ and so will pick up this file (extension.bundle.ts).
// At runtime the tests live in dist/tests and will therefore pick up the main webpack bundle at dist/extension.bundle.js.
export { configure, ConfigureApiOptions } from './src/configureWorkspace/configure';
export { splitPorts } from './src/configureWorkspace/configUtils';
export { configPrefix } from './src/constants';
export { ProcessProvider } from './src/debugging/coreclr/ChildProcessProvider';
export { DockerBuildImageOptions, DockerClient } from './src/debugging/coreclr/CliDockerClient';
Expand Down
10 changes: 0 additions & 10 deletions package.json
Expand Up @@ -32,7 +32,6 @@
},
"homepage": "https://github.com/Microsoft/vscode-docker/blob/master/README.md",
"activationEvents": [
"onCommand:vscode-docker.api.configure",
"onCommand:vscode-docker.compose.down",
"onCommand:vscode-docker.compose.restart",
"onCommand:vscode-docker.compose.up",
Expand Down Expand Up @@ -126,10 +125,6 @@
"contributes": {
"menus": {
"commandPalette": [
{
"command": "vscode-docker.api.configure",
"when": "never"
},
{
"command": "vscode-docker.containers.select",
"when": "never"
Expand Down Expand Up @@ -2171,11 +2166,6 @@
}
},
"commands": [
{
"command": "vscode-docker.api.configure",
"title": "%vscode-docker.commands.api.configure%",
"category": "%vscode-docker.commands.category.docker%"
},
{
"command": "vscode-docker.compose.down",
"title": "%vscode-docker.commands.compose.down%",
Expand Down
1 change: 0 additions & 1 deletion package.nls.json
Expand Up @@ -169,7 +169,6 @@
"vscode-docker.config.docker.showRemoteWorkspaceWarning": "Set to true to prompt to switch from \"UI\" extension mode to \"Workspace\" extension mode if an operation is not supported in UI mode.",
"vscode-docker.config.docker.scaffolding.templatePath": "The path to use for scaffolding templates.",
"vscode-docker.config.deprecated": "This setting has been deprecated and will be removed in a future release.",
"vscode-docker.commands.api.configure": "Add Docker Files to Workspace (API)...",
"vscode-docker.commands.compose.down": "Compose Down",
"vscode-docker.commands.compose.restart": "Compose Restart",
"vscode-docker.commands.compose.up": "Compose Up",
Expand Down
76 changes: 0 additions & 76 deletions src/commands/debugging/initializeForDebugging.ts

This file was deleted.

12 changes: 7 additions & 5 deletions src/commands/registerCommands.ts
Expand Up @@ -5,9 +5,10 @@

import { commands } from "vscode";
import { IActionContext, registerCommand as registerCommandAzUI } from "vscode-azureextensionui";
import { configure, configureApi } from "../configureWorkspace/configure";
import { configureCompose } from "../configureWorkspace/configureCompose";
import { ext } from "../extensionVariables";
import { scaffold } from "../scaffolding/scaffold";
import { scaffoldCompose } from "../scaffolding/scaffoldCompose";
import { scaffoldDebugConfig } from "../scaffolding/scaffoldDebugConfig";
import { deployImageToAzure } from "../utils/lazyLoad";
import { viewAzureTaskLogs } from "../utils/lazyLoad";
import { composeDown, composeRestart, composeUp } from "./compose";
Expand Down Expand Up @@ -89,12 +90,13 @@ export function registerCommand(commandId: string, callback: (context: IActionCo
}

export function registerCommands(): void {
registerWorkspaceCommand('vscode-docker.api.configure', configureApi);
registerWorkspaceCommand('vscode-docker.configure', scaffold);
registerWorkspaceCommand('vscode-docker.configureCompose', scaffoldCompose);
registerWorkspaceCommand('vscode-docker.debugging.initializeForDebugging', scaffoldDebugConfig);

registerWorkspaceCommand('vscode-docker.compose.down', composeDown);
registerWorkspaceCommand('vscode-docker.compose.restart', composeRestart);
registerWorkspaceCommand('vscode-docker.compose.up', composeUp);
registerWorkspaceCommand('vscode-docker.configure', configure);
registerWorkspaceCommand('vscode-docker.configureCompose', configureCompose);
registerCommand('vscode-docker.pruneSystem', pruneSystem);

registerWorkspaceCommand('vscode-docker.containers.attachShell', attachShellContainer);
Expand Down
5 changes: 1 addition & 4 deletions src/debugging/DebugHelper.ts
Expand Up @@ -4,8 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { CancellationToken, ConfigurationTarget, debug, DebugConfiguration, ExtensionContext, workspace, WorkspaceFolder } from 'vscode';
import { IActionContext, registerCommand } from 'vscode-azureextensionui';
import { initializeForDebugging } from '../commands/debugging/initializeForDebugging';
import { IActionContext } from 'vscode-azureextensionui';
import { localize } from '../localize';
import { DockerRunTaskDefinition } from '../tasks/DockerRunTaskProvider';
import { DockerTaskScaffoldContext, getDefaultContainerName } from '../tasks/TaskHelper';
Expand Down Expand Up @@ -62,8 +61,6 @@ export function registerDebugProvider(ctx: ExtensionContext): void {
);

registerServerReadyAction(ctx);

registerCommand('vscode-docker.debugging.initializeForDebugging', initializeForDebugging);
}

// TODO: This is stripping out a level of indentation, but the tasks one isn't
Expand Down
4 changes: 2 additions & 2 deletions src/scaffolding/scaffold.ts
Expand Up @@ -12,7 +12,7 @@ import { ChooseWorkspaceFolderStep } from './wizard/ChooseWorkspaceFolderStep';
import { ScaffoldFileStep } from './wizard/ScaffoldFileStep';
import { ScaffoldingWizardContext } from './wizard/ScaffoldingWizardContext';

export async function scaffold(wizardContext: ScaffoldingWizardContext): Promise<void> {
export async function scaffold(wizardContext: Partial<ScaffoldingWizardContext>): Promise<void> {
wizardContext.scaffoldType = 'all';

const promptSteps: AzureWizardPromptStep<ScaffoldingWizardContext>[] = [
Expand All @@ -26,7 +26,7 @@ export async function scaffold(wizardContext: ScaffoldingWizardContext): Promise
new ScaffoldFileStep('Dockerfile', 200),
];

const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext, {
const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext as ScaffoldingWizardContext, {
promptSteps: promptSteps,
executeSteps: executeSteps,
title: localize('vscode-docker.scaffold.addDockerFiles', 'Add Docker Files'),
Expand Down
4 changes: 2 additions & 2 deletions src/scaffolding/scaffoldCompose.ts
Expand Up @@ -10,7 +10,7 @@ import { ChooseWorkspaceFolderStep } from './wizard/ChooseWorkspaceFolderStep';
import { ScaffoldFileStep } from './wizard/ScaffoldFileStep';
import { ScaffoldingWizardContext } from './wizard/ScaffoldingWizardContext';

export async function scaffoldCompose(wizardContext: ScaffoldingWizardContext): Promise<void> {
export async function scaffoldCompose(wizardContext: Partial<ScaffoldingWizardContext>): Promise<void> {
wizardContext.scaffoldType = 'compose';
wizardContext.scaffoldCompose = true;

Expand All @@ -24,7 +24,7 @@ export async function scaffoldCompose(wizardContext: ScaffoldingWizardContext):
new ScaffoldFileStep('docker-compose.debug.yml', 400),
];

const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext, {
const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext as ScaffoldingWizardContext, {
promptSteps: promptSteps,
executeSteps: executeSteps,
title: localize('vscode-docker.scaffold.addDockerFiles', 'Add Docker Compose Files'),
Expand Down
4 changes: 2 additions & 2 deletions src/scaffolding/scaffoldDebugConfig.ts
Expand Up @@ -9,15 +9,15 @@ import { ChoosePlatformStep } from './wizard/ChoosePlatformStep';
import { ChooseWorkspaceFolderStep } from './wizard/ChooseWorkspaceFolderStep';
import { ScaffoldingWizardContext } from './wizard/ScaffoldingWizardContext';

export async function scaffoldDebugConfig(wizardContext: ScaffoldingWizardContext): Promise<void> {
export async function scaffoldDebugConfig(wizardContext: Partial<ScaffoldingWizardContext>): Promise<void> {
wizardContext.scaffoldType = 'debugging';

const promptSteps: AzureWizardPromptStep<ScaffoldingWizardContext>[] = [
new ChooseWorkspaceFolderStep(),
new ChoosePlatformStep(['Node.js', '.NET: ASP.NET Core', '.NET: Core Console', 'Python: Django', 'Python: Flask', 'Python: General']),
];

const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext, {
const wizard = new AzureWizard<ScaffoldingWizardContext>(wizardContext as ScaffoldingWizardContext, {
promptSteps: promptSteps,
title: localize('vscode-docker.scaffold.addDockerFiles', 'Initialize for Debugging'),
});
Expand Down
12 changes: 3 additions & 9 deletions src/scaffolding/wizard/ScaffoldFileStep.ts
Expand Up @@ -90,19 +90,13 @@ export class ScaffoldFileStep<TWizardContext extends ScaffoldingWizardContext> e
subPath = path.join('node', `${this.fileType}.template`);
break;
case '.NET: ASP.NET Core':
subPath = path.join('netCore', 'aspnet', `${this.fileType}.template`);
break;
case '.NET: Core Console':
subPath = path.join('netCore', 'console', `${this.fileType}.template`);
subPath = path.join('netCore', `${this.fileType}.template`);
break;
case 'Python: Django':
subPath = path.join('python', 'django', `${this.fileType}.template`);
break;
case 'Python: Flask':
subPath = path.join('python', 'flask', `${this.fileType}.template`);
break;
case 'Python: General':
subPath = path.join('python', 'general', `${this.fileType}.template`);
subPath = path.join('python', `${this.fileType}.template`);
break;
case 'Java':
subPath = path.join('java', `${this.fileType}.template`);
Expand Down Expand Up @@ -131,7 +125,7 @@ export class ScaffoldFileStep<TWizardContext extends ScaffoldingWizardContext> e
const fileName = path.basename(file);
let currentFile = file;

for (let i = 0; i <= maxDepth; i++) {
for (let i = 0; i < maxDepth; i++) {
if (await fse.pathExists(currentFile)) {
return currentFile;
}
Expand Down

0 comments on commit a706e35

Please sign in to comment.