(
fromOption: string,
toOption: string,
workspaceConfig: WorkspaceConfiguration
)
| 233 | } |
| 234 | |
| 235 | async function MoveOptionsValue( |
| 236 | fromOption: string, |
| 237 | toOption: string, |
| 238 | workspaceConfig: WorkspaceConfiguration |
| 239 | ): Promise<void> { |
| 240 | const inspectionValue = workspaceConfig.inspect<any>(fromOption); |
| 241 | if (inspectionValue !== undefined) { |
| 242 | const { key: _, defaultValue: __, globalValue, workspaceValue, workspaceFolderValue } = inspectionValue; |
| 243 | if (globalValue !== undefined) { |
| 244 | await workspaceConfig.update(toOption, globalValue, ConfigurationTarget.Global); |
| 245 | await workspaceConfig.update(fromOption, undefined, ConfigurationTarget.Global); |
| 246 | } |
| 247 | |
| 248 | if (workspaceValue !== undefined) { |
| 249 | await workspaceConfig.update(toOption, workspaceValue, ConfigurationTarget.Workspace); |
| 250 | await workspaceConfig.update(fromOption, undefined, ConfigurationTarget.Workspace); |
| 251 | } |
| 252 | |
| 253 | if (workspaceFolderValue !== undefined) { |
| 254 | await workspaceConfig.update(toOption, workspaceFolderValue, ConfigurationTarget.WorkspaceFolder); |
| 255 | await workspaceConfig.update(fromOption, undefined, ConfigurationTarget.WorkspaceFolder); |
| 256 | } |
| 257 | } |
| 258 | } |
no test coverage detected