@@ -165,10 +165,10 @@ function closeAllDiffs() {
165165function refreshDiff ( query : SearchQuery ) {
166166 try {
167167 // Clear cache if pattern/rewrite changed
168- if ( query . inputValue !== lastPattern || query . rewrite !== lastRewrite ) {
168+ if ( query . pattern !== lastPattern || query . rewrite !== lastRewrite ) {
169169 previewContents . clear ( )
170170 }
171- if ( query . inputValue !== lastPattern ) {
171+ if ( query . pattern !== lastPattern ) {
172172 closeAllDiffs ( )
173173 return
174174 }
@@ -179,7 +179,7 @@ function refreshDiff(query: SearchQuery) {
179179 closeAllDiffs ( )
180180 } finally {
181181 // use finally to ensure updated
182- lastPattern = query . inputValue
182+ lastPattern = query . pattern
183183 lastRewrite = query . rewrite
184184 }
185185}
@@ -199,28 +199,32 @@ async function onReplaceAll(payload: ChildToParent['replaceAll']) {
199199 if ( confirmed !== 'Replace' ) {
200200 return
201201 }
202- const { id, inputValue , rewrite } = payload
202+ const { id, pattern , rewrite, selector , strictness } = payload
203203 for ( const change of payload . changes ) {
204204 // TODO: chunk change
205205 await onCommitChange ( {
206206 id,
207- inputValue ,
207+ pattern ,
208208 rewrite,
209+ selector,
210+ strictness,
209211 ...change ,
210212 } )
211213 }
212214}
213215
214216async function onCommitChange ( payload : ChildToParent [ 'commitChange' ] ) {
215- const { filePath, inputValue , rewrite } = payload
217+ const { filePath, pattern , rewrite, strictness , selector } = payload
216218 const fileUri = workspaceUriFromFilePath ( filePath )
217219 if ( ! fileUri ) {
218220 return
219221 }
220222 await doChange ( fileUri , payload )
221223 await refreshSearchResult ( payload . id , fileUri , {
222- inputValue ,
224+ pattern ,
223225 rewrite,
226+ strictness,
227+ selector,
224228 includeFile : filePath ,
225229 } )
226230}
@@ -244,7 +248,7 @@ async function refreshSearchResult(
244248 query : SearchQuery ,
245249) {
246250 const command = buildCommand ( {
247- pattern : query . inputValue ,
251+ pattern : query . pattern ,
248252 rewrite : query . rewrite ,
249253 includeFiles : [ query . includeFile ] ,
250254 } )
0 commit comments