Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public provideCodeLenses(document: vscode.TextDocument, _token: vscode.CancellationToken) {
const snapshots = new Snapshot()
return snapshots.getMetadata(document.uri.fsPath).map(snapshot => {
const { line } = snapshot.node.loc.start
const range = new vscode.Range(line - 1, 0, line - 1, 0)
let command: vscode.Command
if (snapshot.exists) {
command = {
title: 'view snapshot',
command: previewCommand,
arguments: [snapshot],
}
} else {
command = {
title: 'snapshot missing',
command: missingSnapshotCommand,
}
}