Skip to content

Commit

Permalink
Remove old updateCaptures code
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Nov 7, 2024
1 parent 7b7dbc1 commit 52e9cb0
Showing 1 changed file with 4 additions and 49 deletions.
53 changes: 4 additions & 49 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ class EffektRunCodeLensProvider implements vscode.CodeLensProvider {
}
}

let outputChannel = vscode.window.createOutputChannel("Effekt DEBUG");

let debugOutputChannel = vscode.window.createOutputChannel("Effekt DEBUG");
function log(message: string) {
outputChannel.appendLine(message);
debugOutputChannel.appendLine(message);
}
class EffektCapturesProvider implements vscode.InlayHintsProvider {
public async provideInlayHints(document: vscode.TextDocument, range: vscode.Range): Promise<vscode.InlayHint[]> {
Expand All @@ -101,9 +100,10 @@ class EffektCapturesProvider implements vscode.InlayHintsProvider {
for (const response of result) {
log("processing a single response: " + JSON.stringify(response))
if (response.location.uri.toString() === document.uri.toString()) {
log("... URI correct!")
log("... URI correct => creating a hint!")
const position = response.location.range.start;
const hint = new vscode.InlayHint(position, response.captureText, vscode.InlayHintKind.Type);
hint.tooltip = undefined; // NOTE: We could add a tooltip here if we wanted one.
hint.paddingRight = true;
hint.paddingLeft = false;
hints.push(hint);
Expand Down Expand Up @@ -248,47 +248,6 @@ export async function activate(context: vscode.ExtensionContext) {
timeout = setTimeout(updateHoles, 50);
}

/*function updateCaptures() {
if (!editor) { return; }
if (!config.get<boolean>("showCaptures")) { return; }
client.sendRequest(ExecuteCommandRequest.type, { command: "inferredCaptures", arguments: [{
uri: editor.document.uri.toString()
}]}).then(
(result : [{ location: vscode.Location, captureText: string }]) => {
if (!editor) { return; }
let captureAnnotations: vscode.DecorationOptions[] = []
if (result == null) return;
result.forEach(response => {
if (!editor) { return; }
const loc = response.location
if (loc.uri != editor.document.uri) return;
captureAnnotations.push({
range: loc.range,
renderOptions: {
before: {
contentText: response.captureText,
backgroundColor: "rgba(170,210,255,0.3)",
color: "rgba(50,50,50,0.5)",
fontStyle: "italic",
margin: "0 0.5em 0 0.5em"
}
}
})
})
if (!editor) { return; }
return editor.setDecorations(captureDecoration, captureAnnotations)
}
);
}*/

const holeRegex = /<>|<{|}>/g

/**
Expand Down Expand Up @@ -327,10 +286,6 @@ export async function activate(context: vscode.ExtensionContext) {
}
}, null, context.subscriptions);

//vscode.workspace.onDidSaveTextDocument(ev => {
// setTimeout(updateCaptures, 50)
//})

scheduleDecorations();

context.subscriptions.push(client.start());
Expand Down

0 comments on commit 52e9cb0

Please sign in to comment.