Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: "text",
class: "cquery--namespace"
}
}
else if(data.symbols[i].kind==SymbolKind.Macro)
{
options = {
type: "text",
class: "cquery--macro"
}
}
for(let j = 0;j
createHintMarker(editor, range) {
// Create marker model
const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range), BOOT_DATA_MARKER_TYPE);
// Marker around the text in the editor
editor.decorateMarker(marker, {
type: 'highlight',
class: 'boot-hint'
});
// Marker in the diagnostic gutter
let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
if (!gutter) {
gutter = editor.addGutter({
name: BOOT_HINT_GUTTER_NAME,
visible: false,
});
}
const iconElement = document.createElement('span');
private createHintMarker(editor: TextEditor, range: Range) {
// Create marker model
const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range));
// Marker around the text in the editor
editor.decorateMarker(marker, DECORATION_OPTIONS);
// Marker in the diagnostic gutter
// let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
// if (!gutter) {
// gutter = editor.addGutter({
// name: BOOT_HINT_GUTTER_NAME,
// visible: false,
// });
// }
// const iconElement = document.createElement('span');
// iconElement.setAttribute('class', 'gutter-boot-hint');
// gutter.decorateMarker(marker, {item: iconElement});
}
codeLenses.forEach((codeLens) => {
if (!codeLens.command) {
// To support this, one would have to send a resolve request and show some sort of placeholder
// beforehand, as we wouldn't know what title to show yet.
throw new Error('Code lenses with unresolved commands are currently not supported');
}
const range = Convert.lsRangeToAtomRange(codeLens.range);
const paddingSpacesNeeded = range.start.column - charactersTaken;
// Having one marker per line (see above) means that we need to do padding ourselves when multiple code
// lenses are present. This can happen in cases where multiple properties are on one line, and more than one
// of them is an override. ot great, but it gets the job done.
const paddingSpanElement = document.createElement('span');
paddingSpanElement.innerHTML = ' '.repeat(paddingSpacesNeeded);
const anchorElement = document.createElement('a');
anchorElement.innerHTML = codeLens.command.title;
anchorElement.classList.add('badge');
anchorElement.classList.add('badge-small');
anchorElement.href = '#';
anchorElement.addEventListener('click', () => {
executeCommandHandler({
command: codeLens.command.command,