Skip to content

Commit

Permalink
Merge pull request #9 from nberth/optional-prelaunchtask
Browse files Browse the repository at this point in the history
Make the preLaunchTask optional in launch configuration
  • Loading branch information
nberth authored Jul 26, 2024
2 parents 3e61d84 + d203ea1 commit a2e56ef
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ const MAX_COLUMN_INDEX = 300;
const COBOL_RESERVED_WORDS = ["perform", "move", "to", "set", "add", "subtract", "call", "inquire", "modify", "invoke", "if", "not", "end-if", "until", "varying", "evaluate", "true", "when", "false", "go", "thru", "zeros", "spaces", "zero", "space", "inspect", "tallying", "exit", "paragraph", "method", "cycle", "from", "by", "and", "or", "of", "length", "function", "program", "synchronized", "end-synchronized", "string", "end-string", "on", "reference", "value", "returning", "giving", "replacing", "goback", "all", "open", "i-o", "input", "output", "close", "compute", "unstring", "using", "delete", "start", "read", "write", "rewrite", "with", "lock", "else", "upper-case", "lower-case", "display", "accept", "at", "clear-screen", "initialize", "line", "col", "key", "is", "self", "null", "stop", "run", "upon", "environment-name", "environment-value"]

export function activate(context: vscode.ExtensionContext) {
const provider = new GdbConfigurationProvider();
const factory = new GdbAdapterDescriptorFactory(new CoverageStatus(), new GDBDebugSession());
context.subscriptions.push(
vscode.debug.registerDebugConfigurationProvider('gdb', new GdbConfigurationProvider()),
vscode.debug.registerDebugAdapterDescriptorFactory('gdb', new GdbAdapterDescriptorFactory(new CoverageStatus(), new GDBDebugSession())),
vscode.debug.registerDebugConfigurationProvider('gdb', provider),
vscode.debug.registerDebugAdapterDescriptorFactory('gdb', factory, vscode.DebugConfigurationProviderTriggerKind.Dynamic),
vscode.languages.registerEvaluatableExpressionProvider('GnuCOBOL', new GnuCOBOLEvalExpressionFactory()),
vscode.languages.registerEvaluatableExpressionProvider('GnuCOBOL31', new GnuCOBOLEvalExpressionFactory()),
vscode.languages.registerEvaluatableExpressionProvider('GnuCOBOL3.1', new GnuCOBOLEvalExpressionFactory()),
vscode.languages.registerEvaluatableExpressionProvider('GnuCOBOL32', new GnuCOBOLEvalExpressionFactory()),
vscode.languages.registerEvaluatableExpressionProvider('GnuCOBOL3.2', new GnuCOBOLEvalExpressionFactory()),
vscode.languages.registerEvaluatableExpressionProvider('COBOL', new GnuCOBOLEvalExpressionFactory()),
factory,
);
}

Expand All @@ -38,9 +41,12 @@ class GdbConfigurationProvider implements vscode.DebugConfigurationProvider {
if (config.request === undefined) {
config.request = "launch";
}
if (config.preLaunchTask === undefined) {
config.preLaunchTask = "SuperBOL: build (debug)";
}
if (config.preLaunchTask === undefined) {
config.preLaunchTask = "SuperBOL: build (debug)";
} else if (config.preLaunchTask === "none" ||
config.preLaunchTask === "") {
delete config.preLaunchTask;
}
if (config.target === undefined) {
config.target = "${file}";
}
Expand Down

0 comments on commit a2e56ef

Please sign in to comment.