File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Expand file tree Collapse file tree 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';
66import inject from './lib/inject' ;
77import { setup } from '../window/testing-library' ;
88import onDocReady from './lib/onDocReady' ;
9- import cssPath from '../../../src/lib/cssPath' ;
109
1110function init ( ) {
1211 inject ( '../window/testing-library.js' ) ;
@@ -25,15 +24,12 @@ function init() {
2524
2625 const suggestion = Object . values ( queries ) . find ( Boolean ) ;
2726
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' ) ;
3733 }
3834
3935 Bridge . onMessage ( 'PARSE_QUERY' , function ( { data } ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function Panel() {
1010
1111 useEffect ( ( ) => {
1212 Bridge . onMessage ( 'SELECT_NODE' , ( { data } ) => {
13- setResult ( { elements : [ data ] } ) ;
13+ setResult ( data ) ;
1414 } ) ;
1515 } , [ setResult ] ) ;
1616
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ function Panel() {
1212
1313 useEffect ( ( ) => {
1414 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 ) ;
1717 } ) ;
1818 } , [ setResult ] ) ;
1919
You can’t perform that action at this time.
0 commit comments