Skip to content

Commit 4d10ac7

Browse files
committed
Remove limit semantic search results configuration option
- remove configuring limitSemanticSearchResults
1 parent b73ccaa commit 4d10ac7

12 files changed

Lines changed: 1 addition & 196 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,10 +968,6 @@
968968
"type": "number",
969969
"scope": "resource"
970970
},
971-
"codeWebChat.limitSemanticSearchResults": {
972-
"type": "number",
973-
"scope": "resource"
974-
},
975971
"codeWebChat.checkpointLifespan": {
976972
"type": "number",
977973
"scope": "resource"

‎apps/editor/src/constants/values.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ export const DEFAULT_CONTEXT_SIZE_WARNING_THRESHOLD = 60000
33
export const MAX_FILE_TOKENS_FOR_COMMIT_MESSAGE = 20000
44
export const MAX_PROMPT_CHARS_IN_COMMIT_MESSAGE = 1000
55
export const GIT_LOG_SINCE_DURATION = '6 months ago'
6-
export const LIMIT_SEMANTIC_SEARCH_RESULTS = 10

‎apps/editor/src/views/settings/backend/message-handlers/handle-get-limit-semantic-search-results.ts‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/handle-update-limit-semantic-search-results.ts‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export * from './handle-get-ai-studio-user-id'
2929
export * from './handle-update-ai-studio-user-id'
3030
export * from './handle-get-context-size-warning-threshold'
3131
export * from './handle-update-context-size-warning-threshold'
32-
export * from './handle-get-limit-semantic-search-results'
33-
export * from './handle-update-limit-semantic-search-results'
3432
export * from './handle-get-are-automatic-checkpoints-disabled'
3533
export * from './handle-update-are-automatic-checkpoints-disabled'
3634
export * from './handle-get-checkpoint-lifespan'

‎apps/editor/src/views/settings/backend/settings-view-provider.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
handle_get_attach_ascii_tree_of_context,
1616
handle_get_include_prompts_in_commit_messages,
1717
handle_get_context_size_warning_threshold,
18-
handle_get_limit_semantic_search_results,
1918
handle_get_edit_files_system_instructions,
2019
handle_get_gemini_user_id,
2120
handle_get_ai_studio_user_id,
@@ -38,7 +37,6 @@ import {
3837
handle_update_edit_files_system_instructions,
3938
handle_update_gemini_user_id,
4039
handle_update_context_size_warning_threshold,
41-
handle_update_limit_semantic_search_results,
4240
handle_update_ai_studio_user_id,
4341
handle_update_send_with_shift_enter,
4442
handle_update_reuse_last_tab,
@@ -224,10 +222,6 @@ export class SettingsViewProvider {
224222
await handle_get_context_size_warning_threshold(this)
225223
} else if (message.command == 'UPDATE_CONTEXT_SIZE_WARNING_THRESHOLD') {
226224
await handle_update_context_size_warning_threshold(message)
227-
} else if (message.command == 'GET_LIMIT_SEMANTIC_SEARCH_RESULTS') {
228-
await handle_get_limit_semantic_search_results(this)
229-
} else if (message.command == 'UPDATE_LIMIT_SEMANTIC_SEARCH_RESULTS') {
230-
await handle_update_limit_semantic_search_results(message)
231225
} else if (
232226
message.command == 'GET_CLEAR_CHECKS_IN_WORKSPACE_BEHAVIOR'
233227
) {
@@ -328,7 +322,6 @@ export class SettingsViewProvider {
328322
void handle_get_edit_files_system_instructions(this)
329323
void handle_get_intelligent_file_search_instructions(this)
330324
void handle_get_context_size_warning_threshold(this)
331-
void handle_get_limit_semantic_search_results(this)
332325
void handle_get_commit_message_instructions(this)
333326
void handle_get_attach_ascii_tree_of_context(this)
334327
void handle_get_include_prompts_in_commit_messages(this)

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ type Props = {
113113
attach_ascii_tree_of_context: 'ask' | 'always' | 'never'
114114
select_all_prompts_in_commit_messages_by_default: boolean
115115
context_size_warning_threshold: number
116-
limit_semantic_search_results: number
117116
gemini_user_id: number | null
118117
ai_studio_user_id: number | null
119118
send_with_shift_enter: boolean
@@ -137,7 +136,6 @@ type Props = {
137136
on_context_size_warning_threshold_change: (
138137
threshold: number | undefined
139138
) => void
140-
on_limit_semantic_search_results_change: (limit: number | undefined) => void
141139
on_synchronize_edit_format_between_modes_change: (enabled: boolean) => void
142140
on_commit_instructions_change: (instructions: string) => void
143141
on_attach_ascii_tree_of_context_change: (
@@ -404,10 +402,6 @@ export const Home: React.FC<Props> = (props) => {
404402
on_context_size_warning_threshold_change={
405403
props.on_context_size_warning_threshold_change
406404
}
407-
limit_semantic_search_results={props.limit_semantic_search_results}
408-
on_limit_semantic_search_results_change={
409-
props.on_limit_semantic_search_results_change
410-
}
411405
synchronize_edit_format_between_modes={
412406
props.synchronize_edit_format_between_modes
413407
}

‎apps/editor/src/views/settings/frontend/Home/sections/GeneralSection.tsx‎

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { TextButton as UiTextButton } from '@ui/components/editor/common/TextBut
99
import { Textarea as UiTextarea } from '@ui/components/editor/common/Textarea'
1010
import {
1111
CHECKPOINT_DEFAULT_LIFESPAN,
12-
DEFAULT_CONTEXT_SIZE_WARNING_THRESHOLD,
13-
LIMIT_SEMANTIC_SEARCH_RESULTS
12+
DEFAULT_CONTEXT_SIZE_WARNING_THRESHOLD
1413
} from '@/constants/values'
1514
import { use_translation } from '../../i18n/use-translation'
1615
import { NavItem } from '../Home'
@@ -21,7 +20,6 @@ type ClearChecksBehavior = 'ignore-open-editors' | 'uncheck-all'
2120

2221
type Props = {
2322
context_size_warning_threshold: number
24-
limit_semantic_search_results: number
2523
are_automatic_checkpoints_disabled: boolean
2624
synchronize_edit_format_between_modes: boolean
2725
send_with_shift_enter: boolean
@@ -36,7 +34,6 @@ type Props = {
3634
on_context_size_warning_threshold_change: (
3735
threshold: number | undefined
3836
) => void
39-
on_limit_semantic_search_results_change: (limit: number | undefined) => void
4037
on_clear_checks_in_workspace_behavior_change: (
4138
value: ClearChecksBehavior
4239
) => void
@@ -79,18 +76,12 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
7976
const { t } = use_translation()
8077
const [context_size_warning_threshold, set_context_size_warning_threshold] =
8178
useState<number>()
82-
const [limit_semantic_search_results, set_limit_semantic_search_results] =
83-
useState<number>()
8479
const [checkpoint_lifespan, set_checkpoint_lifespan] = useState<number>()
8580

8681
useEffect(() => {
8782
set_context_size_warning_threshold(props.context_size_warning_threshold)
8883
}, [props.context_size_warning_threshold])
8984

90-
useEffect(() => {
91-
set_limit_semantic_search_results(props.limit_semantic_search_results)
92-
}, [props.limit_semantic_search_results])
93-
9485
useEffect(() => {
9586
set_checkpoint_lifespan(props.checkpoint_lifespan)
9687
}, [props.checkpoint_lifespan])
@@ -111,17 +102,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
111102
}
112103
}
113104

114-
const handle_limit_semantic_search_results_blur = () => {
115-
if (limit_semantic_search_results && limit_semantic_search_results > 0) {
116-
props.on_limit_semantic_search_results_change(
117-
limit_semantic_search_results
118-
)
119-
} else {
120-
props.on_limit_semantic_search_results_change(undefined)
121-
set_limit_semantic_search_results(LIMIT_SEMANTIC_SEARCH_RESULTS)
122-
}
123-
}
124-
125105
const handle_checkpoint_lifespan_blur = () => {
126106
if (checkpoint_lifespan && checkpoint_lifespan > 0) {
127107
props.on_checkpoint_lifespan_change(checkpoint_lifespan)
@@ -254,38 +234,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
254234
}
255235
/>
256236
</UiItem>
257-
<UiItem
258-
title={t('general.limit-semantic-search-results.title')}
259-
description={
260-
<>
261-
{t('general.limit-semantic-search-results.description')}{' '}
262-
<a
263-
href="#"
264-
onClick={(e) => {
265-
e.preventDefault()
266-
props.on_open_external_url(
267-
'https://github.com/MinishLab/semble#cli'
268-
)
269-
}}
270-
>
271-
{t('general.limit-semantic-search-results.learn-more')}
272-
</a>
273-
</>
274-
}
275-
slot_right={
276-
<UiInput
277-
type="number"
278-
value={limit_semantic_search_results?.toString() ?? ''}
279-
on_change={(val) =>
280-
set_limit_semantic_search_results(
281-
val == '' ? undefined : parseInt(val, 10)
282-
)
283-
}
284-
on_blur={handle_limit_semantic_search_results_blur}
285-
max_width={100}
286-
/>
287-
}
288-
/>
289237
</UiGroup>
290238
</div>
291239

‎apps/editor/src/views/settings/frontend/Settings.tsx‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const Settings = () => {
9494
settings_hook.select_all_prompts_in_commit_messages_by_default !==
9595
undefined &&
9696
settings_hook.context_size_warning_threshold !== undefined &&
97-
settings_hook.limit_semantic_search_results !== undefined &&
9897
settings_hook.are_automatic_checkpoints_disabled !== undefined &&
9998
settings_hook.checkpoint_lifespan !== undefined &&
10099
settings_hook.gemini_user_id !== undefined &&
@@ -145,9 +144,6 @@ export const Settings = () => {
145144
context_size_warning_threshold={
146145
settings_hook.context_size_warning_threshold!
147146
}
148-
limit_semantic_search_results={
149-
settings_hook.limit_semantic_search_results!
150-
}
151147
synchronize_edit_format_between_modes={
152148
settings_hook.synchronize_edit_format_between_modes!
153149
}
@@ -190,9 +186,6 @@ export const Settings = () => {
190186
on_context_size_warning_threshold_change={
191187
settings_hook.handle_context_size_warning_threshold_change
192188
}
193-
on_limit_semantic_search_results_change={
194-
settings_hook.handle_limit_semantic_search_results_change
195-
}
196189
on_commit_instructions_change={
197190
settings_hook.handle_commit_instructions_change
198191
}

‎apps/editor/src/views/settings/frontend/hooks/use-settings.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ export const use_settings = (vscode: any) => {
4040
] = useState<string | undefined>(undefined)
4141
const [context_size_warning_threshold, set_context_size_warning_threshold] =
4242
useState<number>()
43-
const [limit_semantic_search_results, set_limit_semantic_search_results] =
44-
useState<number>()
4543
const [
4644
are_automatic_checkpoints_disabled,
4745
set_are_automatic_checkpoints_disabled
@@ -96,7 +94,6 @@ export const use_settings = (vscode: any) => {
9694
command: 'GET_SYNCHRONIZE_EDIT_FORMAT_BETWEEN_MODES'
9795
})
9896
post_message(vscode, { command: 'GET_CONTEXT_SIZE_WARNING_THRESHOLD' })
99-
post_message(vscode, { command: 'GET_LIMIT_SEMANTIC_SEARCH_RESULTS' })
10097
post_message(vscode, { command: 'GET_ARE_AUTOMATIC_CHECKPOINTS_DISABLED' })
10198
post_message(vscode, { command: 'GET_CHECKPOINT_LIFESPAN' })
10299
post_message(vscode, { command: 'GET_GEMINI_USER_ID' })
@@ -136,8 +133,6 @@ export const use_settings = (vscode: any) => {
136133
set_select_all_prompts_in_commit_messages_by_default(message.enabled)
137134
} else if (message.command == 'CONTEXT_SIZE_WARNING_THRESHOLD') {
138135
set_context_size_warning_threshold(message.threshold)
139-
} else if (message.command == 'LIMIT_SEMANTIC_SEARCH_RESULTS') {
140-
set_limit_semantic_search_results(message.limit)
141136
} else if (message.command == 'ARE_AUTOMATIC_CHECKPOINTS_DISABLED') {
142137
set_are_automatic_checkpoints_disabled(message.disabled)
143138
} else if (message.command == 'CHECKPOINT_LIFESPAN') {
@@ -335,14 +330,6 @@ export const use_settings = (vscode: any) => {
335330
threshold: threshold ?? null
336331
})
337332

338-
const handle_limit_semantic_search_results_change = (
339-
limit: number | undefined
340-
) =>
341-
post_message(vscode, {
342-
command: 'UPDATE_LIMIT_SEMANTIC_SEARCH_RESULTS',
343-
limit: limit ?? null
344-
})
345-
346333
const handle_automatic_checkpoints_toggle = (disabled: boolean) => {
347334
set_are_automatic_checkpoints_disabled(disabled)
348335
post_message(vscode, {
@@ -481,7 +468,6 @@ export const use_settings = (vscode: any) => {
481468
edit_files_system_instructions,
482469
intelligent_file_search_instructions,
483470
context_size_warning_threshold,
484-
limit_semantic_search_results,
485471
are_automatic_checkpoints_disabled,
486472
checkpoint_lifespan,
487473
gemini_user_id,
@@ -513,7 +499,6 @@ export const use_settings = (vscode: any) => {
513499
handle_open_ignore_patterns_settings,
514500
handle_open_allow_patterns_settings,
515501
handle_context_size_warning_threshold_change,
516-
handle_limit_semantic_search_results_change,
517502
handle_automatic_checkpoints_toggle,
518503
handle_checkpoint_lifespan_change,
519504
handle_gemini_user_id_change,

0 commit comments

Comments
 (0)