|
19 | 19 | */ |
20 | 20 |
|
21 | 21 | import { QuickInputList } from 'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputList' |
22 | | -import { parse } from 'cypher-editor-support' |
| 22 | +import { parse, QueryOrCommand } from 'cypher-editor-support' |
23 | 23 | import { debounce } from 'lodash-es' |
24 | 24 | import { |
25 | 25 | editor, |
@@ -406,9 +406,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>( |
406 | 406 | debouncedUpdateCode() |
407 | 407 | } |
408 | 408 |
|
409 | | - const addWarnings = ( |
410 | | - statements: { start: { line: number }; getText: () => string }[] |
411 | | - ) => { |
| 409 | + const addWarnings = (statements: QueryOrCommand[]) => { |
412 | 410 | if (!statements.length) return |
413 | 411 |
|
414 | 412 | const model = editorRef.current?.getModel() as editor.ITextModel |
@@ -463,9 +461,11 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>( |
463 | 461 | return { |
464 | 462 | startLineNumber: statementLineNumber + line, |
465 | 463 | // The 8 subtracted from the column on the first line is the length of 'EXPLAIN ' |
466 | | - startColumn: line === 1 ? column - 8 : column, |
467 | | - endLineNumber: statementLineNumber + line, |
468 | | - endColumn: 1000, |
| 464 | + startColumn: |
| 465 | + statement.start.column + |
| 466 | + (line === 1 ? column - 8 : column), |
| 467 | + endLineNumber: statement.stop.line, |
| 468 | + endColumn: statement.stop.column + 2, |
469 | 469 | message: title + '\n\n' + description, |
470 | 470 | severity: MarkerSeverity.Warning |
471 | 471 | } |
|
0 commit comments