From 9a37d7e89fcf7666d17670316a2421632430d724 Mon Sep 17 00:00:00 2001 From: VaibhavOrbit Date: Fri, 20 Feb 2026 15:52:51 +0000 Subject: [PATCH] Fix CSS linter highlight range in CodeMirror v6 --- client/modules/IDE/components/Editor/stateUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/modules/IDE/components/Editor/stateUtils.js b/client/modules/IDE/components/Editor/stateUtils.js index fd45cce098..3be955423e 100644 --- a/client/modules/IDE/components/Editor/stateUtils.js +++ b/client/modules/IDE/components/Editor/stateUtils.js @@ -121,10 +121,12 @@ function makeCssLinter(callback) { } = message; const cmLine = view.state.doc.line(messageLine); - // TODO: Can we to do the to/from smarter? + const start = cmLine.from + messageCharacter - 1; + const end = cmLine.to; + diagnostics.push({ - from: cmLine.from + messageCharacter - 1, - to: cmLine.from + messageCharacter, + from: start, + to: end, severity: messageType, message: messageText });