diff --git a/CHANGELOG.md b/CHANGELOG.md index ba680795..5ed2219f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ - use more subtle styling when a reaction involves the local radicle identity (italic text vs border & background) - show "you" instead of local identity's alias - on hover show the truncated DId next to each identity -- **settings:** add config to toggle excluding temporary files created by the extension, e.g. those used to produce the diff of a patch's changed files, from the list of recently opened files. This is enabled by default. This currently works only partly, but should automatically be fully working when [the underlying VS Code bug](https://github.com/microsoft/vscode/issues/157395#issuecomment-2080293320) is fixed. ([#94](https://github.com/cytechmobile/radicle-vscode-extension/issues/94)) - **patch-list:** show diff for copied and moved files of a patch too when available ([#100](https://github.com/cytechmobile/radicle-vscode-extension/issues/100)) - **patch-list:** show path to containing directory for each changed file of a patch ([#100](https://github.com/cytechmobile/radicle-vscode-extension/issues/100)) - **patch-list:** feat(patch-list): increase count of fetched patches per status to 500 ([#100](https://github.com/cytechmobile/radicle-vscode-extension/issues/100)) diff --git a/package.json b/package.json index 9e9c3483..3b1dc47a 100644 --- a/package.json +++ b/package.json @@ -443,16 +443,6 @@ } ], "configuration": [ - { - "properties": { - "radicle.hideTempFiles": { - "scope": "application", - "type": "boolean", - "default": "true", - "description": "Exclude temporary files generated by the extension (e.g. old/new versions of files changed in patches) from being listed among the recently opened or in search." - } - } - }, { "title": "Advanced", "properties": { diff --git a/src/constants.ts b/src/constants.ts deleted file mode 100644 index 552a29ec..00000000 --- a/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { sep } from 'node:path' -import { tmpdir } from 'node:os' - -export const extTempDir = `${tmpdir()}${sep}radicle` diff --git a/src/helpers/config.ts b/src/helpers/config.ts index 75e9d936..a07df37a 100644 --- a/src/helpers/config.ts +++ b/src/helpers/config.ts @@ -13,7 +13,6 @@ export interface ExtensionConfig { 'radicle.advanced.pathToRadBinary': string 'radicle.advanced.pathToNodeHome': string 'radicle.advanced.httpApiEndpoint': string - 'radicle.hideTempFiles': boolean } /** @@ -33,10 +32,7 @@ export function getConfig( case 'radicle.advanced.httpApiEndpoint': // if the config has the value of the empty string (default) then return `undefined` // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call return config.get(configKey)?.trim() || undefined - case 'radicle.hideTempFiles': - return config.get(configKey) default: return assertUnreachable(configKey) } @@ -56,8 +52,6 @@ export function setConfig( case 'radicle.advanced.pathToNodeHome': case 'radicle.advanced.httpApiEndpoint': return config.update(configKey, value, ConfigurationTarget.Global) - case 'radicle.hideTempFiles': - return config.update(configKey, value, ConfigurationTarget.Global) default: return assertUnreachable(configKey) } diff --git a/src/helpers/configWatcher.ts b/src/helpers/configWatcher.ts index 4d227904..bba7f18d 100644 --- a/src/helpers/configWatcher.ts +++ b/src/helpers/configWatcher.ts @@ -1,6 +1,5 @@ import { workspace } from 'vscode' import { - validateHideTempFilesConfigAlignment, validateHttpdConnection, validateRadCliInstallation, validateRadicleIdentityAuthentication, @@ -52,11 +51,6 @@ const configWatchers = [ usePatchStore().resetAllPatches() }, }, - { - configKey: 'radicle.hideTempFiles', - onConfigChange: validateHideTempFilesConfigAlignment, - onBeforeWatcherRegistration: validateHideTempFilesConfigAlignment, - }, ] satisfies OnConfigChangeParam[] /** @@ -65,7 +59,6 @@ const configWatchers = [ */ export function registerAllConfigWatchers(): void { configWatchers.forEach((cw) => { - cw.onBeforeWatcherRegistration?.() onConfigChange(cw.configKey, cw.onConfigChange) }) } diff --git a/src/ux/settings.ts b/src/ux/settings.ts index ddf13dfa..eb76ffa0 100644 --- a/src/ux/settings.ts +++ b/src/ux/settings.ts @@ -1,8 +1,5 @@ -import { sep } from 'node:path' -import { ConfigurationTarget, commands, workspace } from 'vscode' -import { extTempDir } from '../constants' -import { getConfig } from '../helpers' -import { log } from '../utils' +import { commands, workspace } from 'vscode' +import type { getConfig } from '../helpers' /** * Opens the Settings UI with the options filtered to show only the specified config @@ -19,48 +16,3 @@ export function openSettingsFocusedAtConfig(config: Parameters config, ) } - -/** - * Checks extension config for user's desired behaviour and ensure's the - * native vscode config is set to match. - */ -export function validateHideTempFilesConfigAlignment() { - const excludeGlob = `${extTempDir}${sep}**` - - const shouldExclude = getConfig('radicle.hideTempFiles') - - const searchExcludeConfigKey = 'search.exclude' - const searchExcludeConfig = workspace.getConfiguration().get(searchExcludeConfigKey) - - if (!searchExcludeConfig) { - log( - `Didn't find any configuration for key "${searchExcludeConfigKey}". Bailing validation of config alignment.`, - 'warn', - ) - - return - } - - const isAlreadyConfigedToExclude = Boolean( - Object.entries(searchExcludeConfig).find( - ([key, value]) => key === excludeGlob && value === true, - ), - ) - - if (shouldExclude && !isAlreadyConfigedToExclude) { - const newSearchExcludeConfig = { ...searchExcludeConfig, [excludeGlob]: true } - workspace - .getConfiguration() - .update(searchExcludeConfigKey, newSearchExcludeConfig, ConfigurationTarget.Global) - } else if (!shouldExclude && isAlreadyConfigedToExclude) { - // @ts-expect-error Type '{}' has no matching index signature for type 'string'. - const { [excludeGlob]: _, ...searchExcludeConfigWithoutExcludeGlob } = searchExcludeConfig - workspace - .getConfiguration() - .update( - searchExcludeConfigKey, - searchExcludeConfigWithoutExcludeGlob, - ConfigurationTarget.Global, - ) - } -}