(continueConfig: T, sharedConfig: SharedConfigSchema)
| 89 | // - setSharedModelsFromSharedConfig - exists because of selectedModelsByRole |
| 90 | // Which don't exist on SerializedContinueConfig/Config types, so must be added after the fact |
| 91 | export function modifyAnyConfigWithSharedConfig< |
| 92 | T extends |
| 93 | | ContinueConfig |
| 94 | | BrowserSerializedContinueConfig |
| 95 | | Config |
| 96 | | SerializedContinueConfig, |
| 97 | >(continueConfig: T, sharedConfig: SharedConfigSchema): T { |
| 98 | const configCopy = { ...continueConfig }; |
| 99 | configCopy.tabAutocompleteOptions = { |
| 100 | ...configCopy.tabAutocompleteOptions, |
| 101 | }; |
| 102 | if (sharedConfig.useAutocompleteCache !== undefined) { |
| 103 | configCopy.tabAutocompleteOptions.useCache = |
| 104 | sharedConfig.useAutocompleteCache; |
| 105 | } |
| 106 | if (sharedConfig.useAutocompleteMultilineCompletions !== undefined) { |
| 107 | configCopy.tabAutocompleteOptions.multilineCompletions = |
| 108 | sharedConfig.useAutocompleteMultilineCompletions; |
| 109 | } |
| 110 | if (sharedConfig.disableAutocompleteInFiles !== undefined) { |
| 111 | configCopy.tabAutocompleteOptions.disableInFiles = |
| 112 | sharedConfig.disableAutocompleteInFiles; |
| 113 | } |
| 114 | if (sharedConfig.modelTimeout !== undefined) { |
| 115 | configCopy.tabAutocompleteOptions.modelTimeout = sharedConfig.modelTimeout; |
| 116 | } |
| 117 | if (sharedConfig.debounceDelay !== undefined) { |
| 118 | configCopy.tabAutocompleteOptions.debounceDelay = |
| 119 | sharedConfig.debounceDelay; |
| 120 | } |
| 121 | |
| 122 | configCopy.ui = { |
| 123 | ...configCopy.ui, |
| 124 | }; |
| 125 | |
| 126 | if (sharedConfig.codeBlockToolbarPosition !== undefined) { |
| 127 | configCopy.ui.codeBlockToolbarPosition = |
| 128 | sharedConfig.codeBlockToolbarPosition; |
| 129 | } |
| 130 | if (sharedConfig.fontSize !== undefined) { |
| 131 | configCopy.ui.fontSize = sharedConfig.fontSize; |
| 132 | } |
| 133 | if (sharedConfig.codeWrap !== undefined) { |
| 134 | configCopy.ui.codeWrap = sharedConfig.codeWrap; |
| 135 | } |
| 136 | if (sharedConfig.displayRawMarkdown !== undefined) { |
| 137 | configCopy.ui.displayRawMarkdown = sharedConfig.displayRawMarkdown; |
| 138 | } |
| 139 | if (sharedConfig.showChatScrollbar !== undefined) { |
| 140 | configCopy.ui.showChatScrollbar = sharedConfig.showChatScrollbar; |
| 141 | } |
| 142 | |
| 143 | if (sharedConfig.allowAnonymousTelemetry !== undefined) { |
| 144 | configCopy.allowAnonymousTelemetry = sharedConfig.allowAnonymousTelemetry; |
| 145 | } |
| 146 | if (sharedConfig.disableIndexing !== undefined) { |
| 147 | configCopy.disableIndexing = sharedConfig.disableIndexing; |
| 148 | } |
no outgoing calls
no test coverage detected