Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) {
return { isIncomplete: false, items: [] };
}
const offset = document.offsetAt(position);
const lines = document
.getText()
.slice(0, offset)
.split('\n');
const currentLine = lines[position.line];
const items = snippetManager ? snippetManager.completeSnippets(scaffoldSnippetSources) : [];
// If a line starts with `<`, it's probably a starting region tag that can be wholly replaced
if (currentLine.length > 0 && currentLine.startsWith('<')) {
const replacementRange = Range.create(
document.positionAt(offset - currentLine.length),
document.positionAt(offset)
);
items.forEach(i => {
if (i.insertText) {
i.textEdit = {
newText: i.insertText,
range: replacementRange
};
}
});
}
return {
isIncomplete: false,
items