addons/vscode/extension/config.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import os from 'node:os';
b69ab319import * as vscode from 'vscode';
b69ab3110
b69ab3111export const PERSISTED_STORAGE_KEY_PREFIX = 'isl-persisted:';
b69ab3112
b69ab3113/**
b69ab3114 * Determine which command to use for `sl`, based on vscode configuration.
b69ab3115 * Changes to this setting require restarting, so it's ok to cache this value
b69ab3116 * or use it in the construction of a different object.
b69ab3117 */
b69ab3118export function getCLICommand(): string {
b69ab3119 // prettier-disable
b69ab3120 return (
b69ab3121 vscode.workspace.getConfiguration('sapling').get('commandPath') ||
b69ab3122 (os.platform() === 'win32' ? 'sl.exe' : 'sl')
b69ab3123 );
b69ab3124}
b69ab3125
b69ab3126/** Whether the user has configured for files, diffs, and comparisons to open in ViewColumn.Beside instead of ViewColumn.Active. */
b69ab3127export function shouldOpenBeside(): boolean {
b69ab3128 return vscode.workspace.getConfiguration('sapling').get<boolean>('isl.openBeside') === true;
b69ab3129}