File tree 3 files changed +9
-13
lines changed
3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { getAllPossibleQueries } from '../../../src/lib';
6
6
import inject from './lib/inject' ;
7
7
import { setup } from '../window/testing-library' ;
8
8
import onDocReady from './lib/onDocReady' ;
9
- import cssPath from '../../../src/lib/cssPath' ;
10
9
11
10
function init ( ) {
12
11
inject ( '../window/testing-library.js' ) ;
@@ -25,15 +24,12 @@ function init() {
25
24
26
25
const suggestion = Object . values ( queries ) . find ( Boolean ) ;
27
26
28
- Bridge . sendMessage (
29
- 'SELECT_NODE' ,
30
- {
31
- suggestion,
32
- queries,
33
- cssPath : cssPath ( node , true ) . toString ( ) ,
34
- } ,
35
- 'devtools' ,
36
- ) ;
27
+ const result = parser . parse ( {
28
+ rootNode : document . body ,
29
+ query : suggestion ?. snippet || '' ,
30
+ } ) ;
31
+
32
+ Bridge . sendMessage ( 'SELECT_NODE' , result , 'devtools' ) ;
37
33
}
38
34
39
35
Bridge . onMessage ( 'PARSE_QUERY' , function ( { data } ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function Panel() {
10
10
11
11
useEffect ( ( ) => {
12
12
Bridge . onMessage ( 'SELECT_NODE' , ( { data } ) => {
13
- setResult ( { elements : [ data ] } ) ;
13
+ setResult ( data ) ;
14
14
} ) ;
15
15
} , [ setResult ] ) ;
16
16
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ function Panel() {
12
12
13
13
useEffect ( ( ) => {
14
14
Bridge . onMessage ( 'SELECT_NODE' , ( { data } ) => {
15
- setResult ( { elements : [ data ] } ) ;
16
- editor . current . setValue ( data . suggestion ?. snippet || '' ) ;
15
+ setResult ( data ) ;
16
+ editor . current . setValue ( data . query ) ;
17
17
} ) ;
18
18
} , [ setResult ] ) ;
19
19
You can’t perform that action at this time.
0 commit comments