|
18 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | */ |
20 | 20 |
|
21 | | -import { parse } from 'cypher-editor-support' |
| 21 | +import { parse, QueryOrCommand } from 'cypher-editor-support' |
22 | 22 | import { debounce } from 'lodash-es' |
23 | 23 | import { |
24 | 24 | editor, |
@@ -387,9 +387,7 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>( |
387 | 387 | debouncedUpdateCode() |
388 | 388 | } |
389 | 389 |
|
390 | | - const addWarnings = ( |
391 | | - statements: { start: { line: number }; getText: () => string }[] |
392 | | - ) => { |
| 390 | + const addWarnings = (statements: QueryOrCommand[]) => { |
393 | 391 | if (!statements.length) return |
394 | 392 |
|
395 | 393 | const model = editorRef.current?.getModel() as editor.ITextModel |
@@ -444,9 +442,11 @@ const Monaco = forwardRef<MonacoHandles, MonacoProps>( |
444 | 442 | return { |
445 | 443 | startLineNumber: statementLineNumber + line, |
446 | 444 | // The 8 subtracted from the column on the first line is the length of 'EXPLAIN ' |
447 | | - startColumn: line === 1 ? column - 8 : column, |
448 | | - endLineNumber: statementLineNumber + line, |
449 | | - endColumn: 1000, |
| 445 | + startColumn: |
| 446 | + statement.start.column + |
| 447 | + (line === 1 ? column - 8 : column), |
| 448 | + endLineNumber: statement.stop.line, |
| 449 | + endColumn: statement.stop.column + 2, |
450 | 450 | message: title + '\n\n' + description, |
451 | 451 | severity: MarkerSeverity.Warning |
452 | 452 | } |
|
0 commit comments