File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,13 @@ export function buildCommand(query: SearchQuery) {
127127 if ( query . lang ) {
128128 args . push ( '--lang' , query . lang )
129129 }
130- args . push ( ...includeFile . split ( ',' ) . filter ( Boolean ) )
130+ const validIncludeFile = includeFile . split ( ',' ) . filter ( Boolean )
131+ const hasGlobPattern = validIncludeFile . some ( i => i . includes ( '*' ) )
132+ if ( hasGlobPattern ) {
133+ args . push ( ...validIncludeFile . map ( i => `--globs=${ i } ` ) )
134+ } else {
135+ args . push ( ...validIncludeFile )
136+ }
131137 console . debug ( 'running' , query , command , args )
132138 // TODO: multi-workspaces support
133139 return spawn ( command , args , {
Original file line number Diff line number Diff line change @@ -71,6 +71,13 @@ function Empty({ query }: { query: SearchQuery }) {
7171 .
7272 </ li >
7373 ) : null }
74+ { query . includeFile . length ? (
75+ < li >
76+ If you're using glob patterns in the include file, please ensure
77+ that your version of ast-grep is above{ ' ' }
78+ < code style = { codeStyle } > v0.28.0</ code > .
79+ </ li >
80+ ) : null }
7481 < li >
7582 Adjust your gitignore files.{ ' ' }
7683 < VSCodeLink href = "https://ast-grep.github.io/reference/cli/run.html#no-ignore-file-type" >
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export default function IncludeFile({
2525 < h4 style = { titleStyle } > files to include</ h4 >
2626 < SearchInput
2727 isSingleLine = { true }
28- placeholder = "e.g. src, packages. No glob pattern "
28+ placeholder = "e.g. src, packages, src/**/*.ts "
2929 value = { includeFile }
3030 onChange = { setIncludeFile }
3131 onKeyEnterUp = { refreshResult }
You can’t perform that action at this time.
0 commit comments