refactor: Restructure file search settings
This commit restructures the file search settings. The previously individual settings for file search method, regex search backend, match search backend, and ripgrep path have been grouped into a new filesSearchSettings object.
This commit is contained in:
@@ -201,6 +201,18 @@ export const triggerSchema = z.object({
|
||||
}
|
||||
});
|
||||
|
||||
const FilesSearchSettingsSchema = z.object({
|
||||
method: z.enum(['match', 'regex', 'semantic', 'auto']).catch('auto'),
|
||||
regexBackend: z.enum(['coreplugin', 'ripgrep']).catch('ripgrep'),
|
||||
matchBackend: z.enum(['omnisearch', 'coreplugin']).catch('coreplugin'),
|
||||
ripgrepPath: z.string().catch(''),
|
||||
}).catch({
|
||||
method: 'auto',
|
||||
regexBackend: 'ripgrep',
|
||||
matchBackend: 'coreplugin',
|
||||
ripgrepPath: '',
|
||||
});
|
||||
|
||||
export const InfioSettingsSchema = z.object({
|
||||
// Version
|
||||
version: z.literal(SETTINGS_SCHEMA_VERSION).catch(SETTINGS_SCHEMA_VERSION),
|
||||
@@ -260,10 +272,7 @@ export const InfioSettingsSchema = z.object({
|
||||
jinaApiKey: z.string().catch(''),
|
||||
|
||||
// Files Search
|
||||
filesSearchMethod: z.enum(['match', 'regex', 'semantic', 'auto']).catch('auto'),
|
||||
regexSearchBackend: z.enum(['coreplugin', 'ripgrep']).catch('ripgrep'),
|
||||
matchSearchBackend: z.enum(['omnisearch', 'coreplugin']).catch('coreplugin'),
|
||||
ripgrepPath: z.string().catch(''),
|
||||
filesSearchSettings: FilesSearchSettingsSchema,
|
||||
|
||||
/// [compatible]
|
||||
// activeModels [compatible]
|
||||
@@ -365,6 +374,7 @@ export const InfioSettingsSchema = z.object({
|
||||
})
|
||||
|
||||
export type InfioSettings = z.infer<typeof InfioSettingsSchema>
|
||||
export type FilesSearchSettings = z.infer<typeof FilesSearchSettingsSchema>
|
||||
|
||||
type Migration = {
|
||||
fromVersion: number
|
||||
|
||||
Reference in New Issue
Block a user