| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import os from 'node:os'; |
| 9 | import * as vscode from 'vscode'; |
| 10 | |
| 11 | export const PERSISTED_STORAGE_KEY_PREFIX = 'isl-persisted:'; |
| 12 | |
| 13 | /** |
| 14 | * Determine which command to use for `sl`, based on vscode configuration. |
| 15 | * Changes to this setting require restarting, so it's ok to cache this value |
| 16 | * or use it in the construction of a different object. |
| 17 | */ |
| 18 | export function getCLICommand(): string { |
| 19 | // prettier-disable |
| 20 | return ( |
| 21 | vscode.workspace.getConfiguration('sapling').get('commandPath') || |
| 22 | (os.platform() === 'win32' ? 'sl.exe' : 'sl') |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | /** Whether the user has configured for files, diffs, and comparisons to open in ViewColumn.Beside instead of ViewColumn.Active. */ |
| 27 | export function shouldOpenBeside(): boolean { |
| 28 | return vscode.workspace.getConfiguration('sapling').get<boolean>('isl.openBeside') === true; |
| 29 | } |
| 30 | |