mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
feat(search): support wildcard patterns across search fields (#1571)
* feat(search): add wildcard matching to search fields * fix(search): harden wildcard matching and file globs * fix(search): align file matching with shared wildcard semantics * fix(search): bound file wildcard search in runner * fix(search): normalize outline queries through shared matcher * fix(web): remove duplicate markdown test context field
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { logger } from '@/ui/logger'
|
||||
import { RPC_METHODS } from '@hapi/protocol/rpcMethods'
|
||||
import type { RpcHandlerManager } from '@/api/rpc/RpcHandlerManager'
|
||||
import { run as runRipgrep } from '@/modules/ripgrep/index'
|
||||
import { run as runRipgrep, runFileSearch, type FileSearchOptions } from '@/modules/ripgrep/index'
|
||||
import { validatePath } from '../pathSecurity'
|
||||
import { getErrorMessage, rpcError } from '../rpcResponses'
|
||||
|
||||
interface RipgrepRequest {
|
||||
args: string[]
|
||||
cwd?: string
|
||||
fileSearch?: FileSearchOptions
|
||||
}
|
||||
|
||||
interface RipgrepResponse {
|
||||
@@ -30,7 +31,9 @@ export function registerRipgrepHandlers(rpcHandlerManager: RpcHandlerManager, wo
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await runRipgrep(data.args, { cwd: data.cwd })
|
||||
const result = data.fileSearch
|
||||
? await runFileSearch(data.args, { ...data.fileSearch, cwd: data.cwd })
|
||||
: await runRipgrep(data.args, { cwd: data.cwd })
|
||||
return {
|
||||
success: true,
|
||||
exitCode: result.exitCode,
|
||||
|
||||
Reference in New Issue
Block a user