Skip to content

Add enableDiscovery language server option#1520

Merged
TwitchBronBron merged 4 commits intomasterfrom
feature/optional-discovery
Jun 25, 2025
Merged

Add enableDiscovery language server option#1520
TwitchBronBron merged 4 commits intomasterfrom
feature/optional-discovery

Conversation

@elsassph
Copy link
Contributor

@elsassph elsassph commented Jun 18, 2025

Problem with automatic discovery

The language server aggressively tries to discover Roku projects by default.

This is fine for Roku-only developers, and developers working in small to medium repositories.

This is causing issues for developers working on large codebases, like monorepos, and developers working on a lot of non-Roku projects, where the extension goes in the way. For instance in our monorepo, the language server goes out of memory while validating the projects, repeatedly as VS attempts to restart the server.

Adding a setting allowing to disable automatic discovery

This PR adds an enableDiscovery lsp option, which defaults to true but can be disabled.

Uncovered issues

While adding the option, it turned out some refactoring had been done incorrectly; for instance enableThreading was never enabled due to incorrect workspace config preparation using unsafe casting.

Fixing the workspace config caused some unit tests to fail (some rather mysteriously).

While fixing the unit tests, I found that we have some questionable logic: why not ensure a name token is available in BrsValidator?

@elsassph elsassph force-pushed the feature/optional-discovery branch 2 times, most recently from 9eb12da to 2116fc7 Compare June 18, 2025 09:07
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks great....except it doesn't look like the enableDiscovery option is actually used anywhere?

@elsassph
Copy link
Contributor Author

oh dear, now with code using the enableDiscovery flag 😄

@TwitchBronBron TwitchBronBron merged commit 186608c into master Jun 25, 2025
7 checks passed
@TwitchBronBron TwitchBronBron deleted the feature/optional-discovery branch June 25, 2025 11:36
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.

2 participants