@@ -25,7 +25,6 @@ import {
2525import type { CoreStart } from '@kbn/core/public' ;
2626
2727import { ESQLCallbacks , ESQLRealField , validateQuery } from '@kbn/esql-validation-autocomplete' ;
28- import { getAstAndSyntaxErrors } from '@kbn/esql-ast' ;
2928import type { StartDependencies } from './plugin' ;
3029import { CodeSnippet } from './code_snippet' ;
3130
@@ -77,16 +76,13 @@ export const App = (props: { core: CoreStart; plugins: StartDependencies }) => {
7776 if ( currentQuery === '' ) {
7877 return ;
7978 }
80- validateQuery (
81- currentQuery ,
82- getAstAndSyntaxErrors ,
83- { ignoreOnMissingCallbacks : ignoreErrors } ,
84- callbacks
85- ) . then ( ( { errors : validationErrors , warnings : validationWarnings } ) => {
86- // syntax errors come with a slight different format than other validation errors
87- setErrors ( validationErrors . map ( ( e ) => ( 'severity' in e ? e . message : e . text ) ) ) ;
88- setWarnings ( validationWarnings . map ( ( e ) => e . text ) ) ;
89- } ) ;
79+ validateQuery ( currentQuery , { ignoreOnMissingCallbacks : ignoreErrors } , callbacks ) . then (
80+ ( { errors : validationErrors , warnings : validationWarnings } ) => {
81+ // syntax errors come with a slight different format than other validation errors
82+ setErrors ( validationErrors . map ( ( e ) => ( 'severity' in e ? e . message : e . text ) ) ) ;
83+ setWarnings ( validationWarnings . map ( ( e ) => e . text ) ) ;
84+ }
85+ ) ;
9086 } , [ currentQuery , ignoreErrors , callbacks ] ) ;
9187
9288 const checkboxes = [
@@ -106,7 +102,7 @@ export const App = (props: { core: CoreStart; plugins: StartDependencies }) => {
106102
107103 return (
108104 < EuiPage >
109- < EuiPageBody style = { { maxWidth : 800 , margin : '0 auto' } } >
105+ < EuiPageBody css = { { maxWidth : 800 , margin : '0 auto' } } >
110106 < EuiPageHeader paddingSize = "s" bottomBorder = { true } pageTitle = "ES|QL validation example" />
111107 < EuiPageSection paddingSize = "s" >
112108 < p > This app shows how to use the ES|QL validation API with all its options</ p >
0 commit comments