Skip to content

Commit 8557b99

Browse files
committed
fix(web-console): correct error highlighting if the error position at the end
1 parent b88fc47 commit 8557b99

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • packages/web-console/src/scenes/Editor/Monaco

packages/web-console/src/scenes/Editor/Monaco/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,17 @@ export const getErrorRange = (
267267
request: Request,
268268
errorPosition: number,
269269
): IRange | null => {
270+
const isErrorAtEnd = errorPosition === request.query.length
271+
if (isErrorAtEnd) {
272+
const lastPosition = request.query.trimEnd().length
273+
const position = toTextPosition(request, lastPosition)
274+
return {
275+
startColumn: position.column,
276+
endColumn: position.column,
277+
startLineNumber: position.lineNumber,
278+
endLineNumber: position.lineNumber,
279+
}
280+
}
270281
const position = toTextPosition(request, errorPosition)
271282
const model = editor.getModel()
272283
if (model) {

0 commit comments

Comments
 (0)