Apply name

This commit is contained in:
Andrew Pareles 2025-02-13 22:59:59 -08:00
parent d9e4679b65
commit 343ee5eb94
3 changed files with 9 additions and 7 deletions

View file

@ -1238,7 +1238,7 @@ class InlineDiffsService extends Disposable implements IInlineDiffsService {
// TODO turn this into a service and provide it
streamRequestIdRef.current = this._llmMessageService.sendLLMMessage({
messagesType: 'chatMessages',
useProviderFor: 'FastApply',
useProviderFor: 'Apply',
logging: { loggingName: `generateSearchAndReplace` },
messages,
onText: ({ fullText }) => {
@ -1478,7 +1478,7 @@ class InlineDiffsService extends Disposable implements IInlineDiffsService {
streamRequestIdRef.current = this._llmMessageService.sendLLMMessage({
messagesType: 'chatMessages',
useProviderFor: opts.from === 'ClickApply' ? 'FastApply' : 'Ctrl+K',
useProviderFor: opts.from === 'ClickApply' ? 'Apply' : 'Ctrl+K',
logging: { loggingName: `startApplying - ${from}` },
messages,
onText: ({ newText: newText_ }) => {

View file

@ -131,7 +131,7 @@ const _updatedValidatedState = (state: Omit<VoidSettingsState, '_modelOptions'>)
const defaultState = () => {
const d: VoidSettingsState = {
settingsOfProvider: deepClone(defaultSettingsOfProvider),
modelSelectionOfFeature: { 'Ctrl+L': null, 'Ctrl+K': null, 'Autocomplete': null, 'FastApply': null },
modelSelectionOfFeature: { 'Ctrl+L': null, 'Ctrl+K': null, 'Autocomplete': null, 'Apply': null },
globalSettings: deepClone(defaultGlobalSettings),
_modelOptions: [], // computed later
}
@ -189,7 +189,7 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService {
const newModelSelectionOfFeature = {
// A HACK BECAUSE WE ADDED FastApply
...{ 'FastApply': null },
...{ 'Apply': null },
...readS.modelSelectionOfFeature,
}

View file

@ -436,18 +436,20 @@ export const modelSelectionsEqual = (m1: ModelSelection, m2: ModelSelection) =>
}
// this is a state
export const featureNames = ['Ctrl+L', 'Ctrl+K', 'Autocomplete', 'FastApply'] as const
export const featureNames = ['Ctrl+L', 'Ctrl+K', 'Autocomplete', 'Apply'] as const
export type ModelSelectionOfFeature = Record<(typeof featureNames)[number], ModelSelection | null>
export type FeatureName = keyof ModelSelectionOfFeature
export const displayInfoOfFeatureName = (featureName: FeatureName) => {
// editor:
if (featureName === 'Autocomplete')
return 'Autocomplete'
else if (featureName === 'Ctrl+K')
return 'Quick-Edit'
return 'Quick Edit'
// sidebar:
else if (featureName === 'Ctrl+L')
return 'Chat'
else if (featureName === 'FastApply')
else if (featureName === 'Apply')
return 'Apply'
else
throw new Error(`Feature Name ${featureName} not allowed`)