Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mollywires
Copy link

Symlinked extension and hook directories weren't being discovered. readdir with withFileTypes returns Dirent objects where isDirectory() is false for symlinks, even when the target is a directory — so they get silently skipped.

Added isSymbolicLink() checks in three places:

  • src/plugins/discovery.ts — plugin/extension discovery
  • src/hooks/workspace.ts — hook discovery
  • src/security/audit-extra.ts — extension security audit

Other isDirectory() calls in src/ either use fs.statSync (follows symlinks already) or operate on internal state dirs that wouldn't be symlinked. Dangling or non-directory symlinks are handled gracefully by existing null checks downstream (readPackageManifest returns null on any failure).

Related: #2961

  • AI-assisted
  • Tested locally with symlinked extensions

readdir entries report isDirectory()=false for symlinks, causing
plugin discovery, hook discovery, and security audits to skip
symlinked directories. Adding isSymbolicLink() checks lets
symlinked packages be found correctly.

Affected files:
- src/plugins/discovery.ts (plugin/extension discovery)
- src/hooks/workspace.ts (hook discovery)
- src/security/audit-extra.ts (extension security audit)

Useful when extensions or hooks are managed outside the workspace
and symlinked in (e.g. from a shared development directory).
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