Skip to content

Commit e6ee505

Browse files
feat: add empty result help message
1 parent fa5451c commit e6ee505

File tree

1 file changed

+24
-2
lines changed
  • src/webview/SearchSidebar/SearchProviderMessage

1 file changed

+24
-2
lines changed

src/webview/SearchSidebar/SearchProviderMessage/index.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Empty({ query }: { query: SearchQuery }) {
2929
No results found for <code style={codeStyle}>{pattern}</code>
3030
{includeFile ? ` in '${includeFile}'` : null}.
3131
<br />
32-
If this is not expected, you can try:
32+
If this is unexpected, you can try:
3333
<ul style={ulStyle}>
3434
<li>
3535
Ensure the query follows the{' '}
@@ -40,7 +40,7 @@ function Empty({ query }: { query: SearchQuery }) {
4040
<li>
4141
Check if the file types are{' '}
4242
<VSCodeLink href="https://ast-grep.github.io/reference/languages.html">
43-
Supported
43+
supported
4444
</VSCodeLink>
4545
</li>
4646
<li>
@@ -49,6 +49,28 @@ function Empty({ query }: { query: SearchQuery }) {
4949
See doc
5050
</VSCodeLink>
5151
</li>
52+
{query.strictness !== 'smart' ? (
53+
<li>
54+
Adjust pattern{' '}
55+
<VSCodeLink href="https://ast-grep.github.io/reference/cli/run.html#no-ignore-file-type">
56+
strictness
57+
</VSCodeLink>
58+
.
59+
</li>
60+
) : null}
61+
{query.selector ? (
62+
<li>
63+
Ensure pattern{' '}
64+
<VSCodeLink href="https://ast-grep.github.io/guide/rule-config/atomic-rule.html#pattern">
65+
selector
66+
</VSCodeLink>{' '}
67+
is valid. Debug in
68+
<VSCodeLink href="https://ast-grep.github.io/playground.html">
69+
Playground
70+
</VSCodeLink>
71+
.
72+
</li>
73+
) : null}
5274
</ul>
5375
</div>
5476
)

0 commit comments

Comments
 (0)