Skip to content

Commit

Permalink
Revert "Merge pull request #106 from marek1840/run-code-via-debug-ada…
Browse files Browse the repository at this point in the history
…pter"

This reverts commit 9f74b48, reversing
changes made to 7a80af4.
  • Loading branch information
tgodzik committed Oct 6, 2019
1 parent be8d6bb commit 1e5bca8
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 125 deletions.
11 changes: 1 addition & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,7 @@
"when": "metals:enabled"
}
]
},
"debuggers": [
{
"type": "scala",
"label": "Scala Debugger",
"languages": [
"scala"
]
}
]
}
},
"main": "./out/extension",
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions src/MetalsFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import {
} from "vscode-languageclient";

export interface TreeViewProvider {}
export interface DebuggingProvider {}

export class MetalsFeatures implements StaticFeature {
treeViewProvider?: TreeViewProvider;
debuggingProvider?: DebuggingProvider;

fillInitializeParams(params: InitializeParams): void {
if (!params.capabilities.experimental) {
params.capabilities.experimental = {};
Expand All @@ -21,7 +18,6 @@ export class MetalsFeatures implements StaticFeature {
initialize(capabilities: ServerCapabilities): void {
if (capabilities.experimental) {
this.treeViewProvider = capabilities.experimental.treeViewProvider;
this.debuggingProvider = capabilities.experimental.debuggingProvider;
}
}
}
3 changes: 1 addition & 2 deletions src/client-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
export const ClientCommands = {
toggleLogs: "metals-logs-toggle",
focusDiagnostics: "metals-diagnostics-focus",
runDoctor: "metals-doctor-run",
startDebugSession: "metals-debug-session-start"
runDoctor: "metals-doctor-run"
};
44 changes: 0 additions & 44 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {
ExtensionContext,
window,
commands,
CodeLens,
CodeLensProvider,
EventEmitter,
StatusBarAlignment,
ProgressLocation,
IndentAction,
Expand All @@ -22,7 +19,6 @@ import {
Uri,
Range,
Selection,
TextDocument as VscodeTextDocument,
TextEditorRevealType,
TextEditor
} from "vscode";
Expand Down Expand Up @@ -57,7 +53,6 @@ import { getJavaOptions } from "./getJavaOptions";
import { startTreeView } from "./treeview";
import { MetalsFeatures } from "./MetalsFeatures";
import { MetalsTreeViewReveal, MetalsTreeViews } from "./tree-view-protocol";
import * as scalaDebugger from "./scalaDebugger";

const outputChannel = window.createOutputChannel("Metals");
const openSettingsAction = "Open settings";
Expand Down Expand Up @@ -334,40 +329,12 @@ function launchMetals(
client.outputChannel.show(true);
channelOpen = true;
}
},
startDebugSession: args => {
if (!features.debuggingProvider) return;

scalaDebugger.start(args).then(wasStarted => {
if (!wasStarted) {
window.showErrorMessage("Debug session not started");
}
});
}
};
Object.entries(clientCommands).forEach(([name, command]) =>
registerCommand(name, command)
);

// should be the compilation of a currently opened file
// but some race conditions may apply
let compilationDoneEmitter = new EventEmitter<void>();

let codeLensRefresher: CodeLensProvider = {
onDidChangeCodeLenses: compilationDoneEmitter.event,
provideCodeLenses: (
document: VscodeTextDocument,
token: CancellationToken
) => undefined,
resolveCodeLens: (codeLens: CodeLens, token: CancellationToken) =>
undefined
};

languages.registerCodeLensProvider(
{ scheme: "file", language: "scala" },
codeLensRefresher
);

// Handle the metals/executeClientCommand extension notification.
client.onNotification(ExecuteClientCommand.type, params => {
const isRun = params.command === "metals-doctor-run";
Expand Down Expand Up @@ -401,9 +368,6 @@ function launchMetals(
});
}
break;
case "metals-model-refresh":
compilationDoneEmitter.fire();
break;
default:
outputChannel.appendLine(`unknown command: ${params.command}`);
}
Expand Down Expand Up @@ -576,14 +540,6 @@ function launchMetals(
treeViews = startTreeView(client, outputChannel, context, viewIds);
context.subscriptions.concat(treeViews.disposables);
}
if (features.debuggingProvider) {
scalaDebugger
.initialize(outputChannel)
.forEach(disposable => context.subscriptions.push(disposable));
registerCommand(scalaDebugger.startSessionCommand, scalaDebugger.start);
} else {
outputChannel.appendLine("Debugging Scala sources is not supported");
}
});
}

Expand Down
65 changes: 0 additions & 65 deletions src/scalaDebugger.ts

This file was deleted.

0 comments on commit 1e5bca8

Please sign in to comment.