Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private highlightOccurrences(range: EditorRange) {
const pos = new monaco.Position(range.startLineNumber, range.startColumn);
return createCancelablePromise((token: any) =>
getOccurrencesAtPosition(this.editor.getModel(), pos, token).then(
(data: languages.DocumentHighlight[]) => {
if (data) {
if (this.isVisible) {
const decorations = data.map(h => ({
range: h.range,
options: ContentHoverWidget.DECORATION_OPTIONS,
}));
this.highlightDecorations = this.editor.deltaDecorations(
this.highlightDecorations,
decorations
);
}
} else {
this.highlightDecorations = this.editor.deltaDecorations(this.highlightDecorations, [
private highlightOccurrences(range: EditorRange) {
const pos = new monaco.Position(range.startLineNumber, range.startColumn);
return createCancelablePromise((token: any) =>
getOccurrencesAtPosition(this.editor.getModel(), pos, token).then(
(data: languages.DocumentHighlight[]) => {
if (data) {
if (this.isVisible) {
const decorations = data.map(h => ({
range: h.range,
options: ContentHoverWidget.DECORATION_OPTIONS,
}));
this.highlightDecorations = this.editor.deltaDecorations(
this.highlightDecorations,
decorations
);
}
} else {
this.highlightDecorations = this.editor.deltaDecorations(this.highlightDecorations, [