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