Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected asCompletionItem(document: TextDocument, position: Position, prefixLength: number, item: DebugProtocol.CompletionItem): CompletionItem {
const { label, text, type, length } = item;
const newText = text || label;
const start = document.positionAt(document.offsetAt(position) - (length || prefixLength));
const replaceRange = Range.create(start, position);
const textEdit = TextEdit.replace(replaceRange, newText);
return {
label,
textEdit,
kind: this.completionKinds.get(type)
};
}
protected fireDidDoubleClickToSourceLine(line: number): void {
if (!this.resource) {
return;
}
this.onDidDoubleClickEmitter.fire({
uri: this.resource.uri.toString(),
range: Range.create({ line, character: 0 }, { line, character: 0 })
});
}
const revealRangeInEditor = (editor: TextEditor) => {
const { start, end } = params.range;
const startPosition = Position.create(start.line - 1, start.character - 1);
const endPosition = Position.create(end.line - 1, end.character - 1);
const range = Range.create(startPosition, endPosition);
editor.revealRange(range);
editor.selection = range;
};
const activeEditorWidget = this.editorManager.currentEditor;