Skip to content

Commit baa0cfb

Browse files
committed
(GH-459) Remove legacy debug adapter code
Now that the puppetAdapterExecutableCommand has been removed, all of the code required to implement the command is no longer required. This commit removes this code and any upstream dependencies. This commit also removes the Debug Adapter and dependant code as the new API makes this redundant. All of the ruby detection can now use the same file whereas previously it had to be split up due to different node environments.
1 parent 944e233 commit baa0cfb

File tree

6 files changed

+0
-416
lines changed

6 files changed

+0
-416
lines changed

src/debugAdapter.ts

Lines changed: 0 additions & 248 deletions
This file was deleted.

src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { PuppetResourceFeature } from './feature/PuppetResourceFeature';
1616
import { ProtocolType, ConnectionType, IConnectionConfiguration } from './interfaces';
1717
import { ILogger } from './logging';
1818
import { OutputChannelLogger } from './logging/outputchannel';
19-
import { PuppetCommandStrings } from './messages';
2019
import { PuppetStatusBar } from './PuppetStatusBar';
2120
import { ISettings, legacySettings, settingsFromWorkspace } from './settings';
2221
import { Reporter, reporter } from './telemetry/telemetry';

src/feature/DebugConfigurationFeature.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import * as path from 'path';
55

66
import { IFeature } from "../feature";
77
import { ILogger } from "../logging";
8-
import { IConnectionConfiguration } from '../interfaces';
9-
import { ConnectionConfiguration } from "../configuration";
10-
import { RubyHelper } from "../rubyHelper";
11-
12-
const PuppetAdapterExecutableCommandId = 'extension.puppetAdapterExecutableCommand';
138

149
export class DebugConfigurationProvider implements vscode.DebugConfigurationProvider {
1510
private debugType: string;
@@ -37,35 +32,6 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
3732
return debugConfiguration;
3833
}
3934

40-
public puppetAdapterExecutableCommand(context: vscode.ExtensionContext) {
41-
const config: IConnectionConfiguration = new ConnectionConfiguration();
42-
const rubyConfig = RubyHelper.getRubyEnvFromConfiguration('', config, this.logger);
43-
44-
const debugAdapterPath = path.join(this.context.extensionPath, 'out', 'debugAdapter.js');
45-
const debugServerPath = path.join(__dirname,'..','..','vendor', 'languageserver', 'puppet-debugserver');
46-
let args = [];
47-
48-
args.push(debugAdapterPath);
49-
// Add path the ruby executable
50-
args.push(`\"RUBY=${rubyConfig.command}\"`);
51-
// Add path to the Debug Server file
52-
args.push(`\"RUBYFILE=${debugServerPath}\"`);
53-
// // Add additional environment variables
54-
const currentEnv = process.env;
55-
for (const key in rubyConfig.options.env) {
56-
const value = rubyConfig.options.env[key];
57-
if (!currentEnv[key] || (currentEnv[key] !== value)) {
58-
args.push(`\"ENV=${key}=${value}\"`);
59-
}
60-
}
61-
// TODO: Add additional command line args e.g. --debuglogfie
62-
63-
return {
64-
command: 'node',
65-
args: args
66-
};
67-
}
68-
6935
private createLaunchConfigFromContext(folder: vscode.WorkspaceFolder | undefined): vscode.DebugConfiguration {
7036
let config = {
7137
type: this.debugType,
@@ -89,8 +55,6 @@ export class DebugConfigurationFeature implements IFeature {
8955
this.provider = new DebugConfigurationProvider(this.debugType, logger, context);
9056
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider(this.debugType, this.provider));
9157
logger.debug("Registered DebugConfigurationProvider");
92-
context.subscriptions.push(vscode.commands.registerCommand(PuppetAdapterExecutableCommandId, () => this.provider.puppetAdapterExecutableCommand(context)));
93-
logger.debug("Registered " + PuppetAdapterExecutableCommandId + " command");
9458
}
9559

9660
public dispose(): any { return undefined; }

src/handlers/stdio.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as vscode from 'vscode';
2-
import * as path from 'path';
32

43
import { ServerOptions, Executable } from 'vscode-languageclient';
54
import { ConnectionHandler } from '../handler';

src/interfaces.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
'use strict';
22

3-
// Only add simple interfaces here. No import's allowed
4-
5-
// Only add simple interfaces here. No import's allowed
6-
// Only add simple interfaces here. No import's allowed
7-
// Only add simple interfaces here. No import's allowed
8-
// Only add simple interfaces here. No import's allowed
9-
// Only add simple interfaces here. No import's allowed
10-
// Only add simple interfaces here. No import's allowed
113
// Only add simple interfaces here. No import's allowed
124
export enum ConnectionStatus {
135
NotStarted,
@@ -36,10 +28,6 @@ export enum ProtocolType {
3628
export interface IConnectionConfiguration {
3729
type: ConnectionType;
3830
protocol: ProtocolType;
39-
host: string;
40-
port: number;
41-
timeout: number;
42-
debugFilePath: string;
4331
puppetBaseDir: string;
4432
puppetDir: string;
4533
languageServerPath: string;
@@ -48,9 +36,7 @@ export interface IConnectionConfiguration {
4836
environmentPath: string;
4937
sslCertFile: string;
5038
sslCertDir: string;
51-
languageServerCommandLine: Array<string>;
5239

53-
puppetInstallType:PuppetInstallType;
5440
pdkBinDir:string;
5541
pdkRubyLib:string;
5642
pdkRubyVerDir:string;

0 commit comments

Comments
 (0)