Skip to content

Add max depth configuration for Roku project discovery#1533

Merged
TwitchBronBron merged 4 commits intomasterfrom
copilot/fix-1528
Jul 17, 2025
Merged

Add max depth configuration for Roku project discovery#1533
TwitchBronBron merged 4 commits intomasterfrom
copilot/fix-1528

Conversation

Copy link
Contributor

Copilot AI commented Jul 17, 2025

This PR adds a configurable maximum depth limit when searching for Roku projects to prevent infinite loops and improve performance in deeply nested directory structures.

Changes Made

  • Added maxDepth configuration: New optional setting in brightscript.languageServer.maxDepth with a default value of 15
  • Updated project discovery: Modified discoverProjectsForWorkspace method to respect the depth limit when searching for:
    • bsconfig.json files
    • manifest files (for Roku projects)
  • Enhanced type definitions: Updated BrightScriptClientConfiguration and WorkspaceConfig interfaces to include the new maxDepth property

Testing

Added comprehensive unit tests covering:

  • maxDepth of 1 (finds only root level files)
  • maxDepth of 5 (finds files up to 4 levels deep)
  • maxDepth of 20 (finds all files within reasonable depth)
  • Default behavior (uses maxDepth of 15)
  • Both bsconfig.json and manifest file discovery scenarios

Usage

The maxDepth can be configured in VSCode settings:

{
  "brightscript.languageServer.maxDepth": 10
}

If not specified, the default value of 15 will be used, which should handle most reasonable project structures while preventing performance issues with excessively deep directory trees.

Fixes #1528.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add max depth for searching for roku projects Add max depth configuration for Roku project discovery Jul 17, 2025
Copilot AI requested a review from TwitchBronBron July 17, 2025 18:43
…unction, fix depth tests

Co-authored-by: TwitchBronBron <[email protected]>
@TwitchBronBron TwitchBronBron marked this pull request as ready for review July 17, 2025 19:41
@TwitchBronBron TwitchBronBron enabled auto-merge (squash) July 17, 2025 20:37
@TwitchBronBron TwitchBronBron disabled auto-merge July 17, 2025 20:37
@TwitchBronBron TwitchBronBron merged commit 4ce9501 into master Jul 17, 2025
7 checks passed
@TwitchBronBron TwitchBronBron deleted the copilot/fix-1528 branch July 17, 2025 20:37
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.

Add max depth for searching for roku projects

2 participants