Skip to content

fix: distinguish 'no patterns' from 'no files matched' in reloadConfig - #4

Merged
Lefix2 merged 1 commit into
mainfrom
fix/reload-config-error-messages
Apr 30, 2026
Merged

fix: distinguish 'no patterns' from 'no files matched' in reloadConfig#4
Lefix2 merged 1 commit into
mainfrom
fix/reload-config-error-messages

Conversation

@Lefix2

@Lefix2 Lefix2 commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Problem

Both cases showed the same misleading message No patterns configured. Create .vscode/codeclimate-visualiser.json… even when the config file was correctly set up but the glob pattern matched no files.

Fix

Extract getRawPatterns() helper and check it before running the glob search, so each failure mode gets a distinct message:

Situation Message
No patterns in config or settings No patterns configured. Create .vscode/codeclimate-visualiser.json…
Patterns set, no files matched No files matched the configured patterns. Check your glob patterns and verify the files exist.
Files matched but all failed to load Patterns matched files but none could be loaded. Check the Output channel for details.

Test plan

  • No config file, no settings → still shows original "No patterns configured" message
  • Config has reportPatterns with a glob that matches nothing → shows "No files matched" message
  • Config has reportPatterns with a valid glob → loads correctly

🤖 Generated with Claude Code

Both cases returned entries.length === 0 and showed the same misleading
'No patterns configured' message even when patterns were set but the
glob matched nothing.

Now checks getRawPatterns() before running the glob so each case gets
its own message:
- No patterns → 'No patterns configured. Create …'
- Patterns set, nothing matched → 'No files matched the configured patterns. Check your glob patterns…'
- Files matched but failed to load → 'Patterns matched files but none could be loaded. Check the Output channel…'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lefix2
Lefix2 merged commit 4310bab into main Apr 30, 2026
1 check passed
@Lefix2
Lefix2 deleted the fix/reload-config-error-messages branch June 17, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant