From d878b7821c5ba437ac150f435bc48847fa132686 Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Sun, 16 Apr 2023 20:06:46 +0200 Subject: [PATCH] Fix error notifications appearing for missing Python config file (#379) --- CHANGELOG.md | 3 +++ src/flags.ts | 6 +++--- src/sshFileSystem.ts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2287384..cefe82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - Added a flag `OPENSSH-SHA1` (enabled by default) to pass this `convertSha1` flag when using `publickey` or `agent` auths - Part of this change required creating a custom ssh2 `authHandler` (based on the built-in version) to pass the option if desired - Changed the `lastVersion` extension version tracking to a new `versionHistory` system to better track bug origins +- Fix error notifications appearing for missing Python config file (#379) + - The `FS_NOTIFY_ERRORS` flag was supposed to default to `'write'` for VS Code 1.56+ but defaulted to `true` (i.e. `'all'`) instead + - Added `/pyproject.toml` to the ignore list (added as a `configBasedExtensionTips` in `product.json` in VS Code 1.77) ## v1.26.0 (2023-03-25) diff --git a/src/flags.ts b/src/flags.ts index 941fa6a..e2d08c9 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -38,13 +38,13 @@ import { catchingPromise } from './utils'; - A comma-separated list of method names to enable logging for in the FileSystemRouter - The presence of `all` is equal to `stat,readDirectory,createDirectory,readFile,writeFile,delete,rename` - The router logs handles `ssh://`, and will even log operations to non-existing configurations/connections - FS_NOTIFY_ERRORS (string) (default='') + FS_NOTIFY_ERRORS (string) - A comma-separated list of operations to display notifications for should they error - Mind that `FileNotFound` errors for ignored paths are always ignored, except with `DEBUG_FS=showignored` - The presence of `all` will show notification for every operation - The presence of `write` is equal to `createDirectory,writeFile,delete,rename` - Besides those provided by `write`, there's also `readDirectory`, `readFile` and `stat` - - Automatically set to `write` for VS Code 1.56 and later (see issue #282) + - Automatically set to `write` for VS Code 1.56 and later (see issue #282), otherwise '' SHELL_CONFIG (string) - Forces the use of a specific shell configuration. Check shellConfig.ts for possible values - By default, when this flag is absent (or an empty or not a string), the extension will try to detect the correct type to use @@ -104,7 +104,7 @@ function calculateFlags(): Record { // Starting with 1.56, FileSystemProvider errors aren't shown to the user and just silently fail // https://github.com/SchoofsKelvin/vscode-sshfs/issues/282 if (semver.gte(vscode.version, '1.56.0')) { - applyList(['+FS_NOTIFY_ERRORS'], 'Fix for issue #282'); + applyList(['FS_NOTIFY_ERRORS=write'], 'Fix for issue #282'); } applyList(config.globalValue, 'Global Settings'); applyList(config.workspaceValue, 'Workspace Settings'); diff --git a/src/sshFileSystem.ts b/src/sshFileSystem.ts index e2461c5..39b283f 100644 --- a/src/sshFileSystem.ts +++ b/src/sshFileSystem.ts @@ -23,6 +23,7 @@ const IGNORE_NOT_FOUND: string[] = [ '/app/src/main/AndroidManifest.xml', '/build.gradle', '/.devcontainer/devcontainer.json', + '/pyproject.toml', ]; function shouldIgnoreNotFound(target: string) { if (IGNORE_NOT_FOUND.some(entry => entry === target || entry.endsWith('/') && target.startsWith(entry))) return true;