Add projectDiscoveryExclude setting and files.watcherExclude support#1535
Add projectDiscoveryExclude setting and files.watcherExclude support#1535TwitchBronBron merged 12 commits intomasterfrom
Conversation
Co-authored-by: TwitchBronBron <[email protected]>
projectDiscoveryExclude list and other watcher LSP settings
TwitchBronBron
left a comment
There was a problem hiding this comment.
Looks pretty good. Can you add a few more tests that ensure handling when files.watcherExclude and projectDiscoverExclude are undefined, that it doesn't crash when getting the list?
Also, can you add some documentation around this new behavior in the docs somewhere?
Co-authored-by: TwitchBronBron <[email protected]>
I've added comprehensive tests for undefined/null handling to ensure no crashes when getting the lists, and also added documentation for the new language server features. Tests added:
Documentation added:
Bug fix:
All tests are passing and the implementation is robust against undefined values. Changes committed in e11d97a. |
TwitchBronBron
left a comment
There was a problem hiding this comment.
There don't appear to be any tests ensuring that getWorkspaceExcludeGlobs properly handles languageServerConfig?.languageServer?.projectDiscoveryExclude. Please make sure that setting is tested the same as the other exclude patterns.
…fix extractExcludes to handle arrays Co-authored-by: TwitchBronBron <[email protected]>
Added the missing test for |
src/LanguageServer.ts
Outdated
| languageServer: { | ||
| enableThreading: boolean; | ||
| enableProjectDiscovery: boolean; | ||
| projectDiscoveryExclude?: string[]; |
There was a problem hiding this comment.
This is incorrect. It should follow the same structure as files.exclude and watch.exclude. An object with keys as string globs, and booleans as enabled/disabled. Please revert most of what you did in the last commit and adjust to this object structure. be sure to fix the documentation, these interfaces, and restore the old extractExcludes function to how it was.
There was a problem hiding this comment.
Reverted projectDiscoveryExclude to use object structure (Record<string, boolean>) instead of array format. Updated the interface definition, restored the original extractExcludes function, updated documentation examples, and ensured all tests pass. Changes committed in 2328860.
Co-authored-by: TwitchBronBron <[email protected]>
…e dupes in patterns when not needed
This PR adds support for two new language server exclusion features:
1.
projectDiscoveryExcludeSettingA new BrighterScript language server setting that allows users to exclude files from project discovery using glob patterns, similar to
files.exclude. This setting is configured underbrightscript.languageServer.projectDiscoveryExcludein VS Code settings.Example usage:
{ "brightscript.languageServer.projectDiscoveryExclude": [ "**/test/**", "**/node_modules/**", "**/.build/**" ] }2.
files.watcherExcludeSupportThe language server now respects VS Code's existing
files.watcherExcludesetting alongside the existingfiles.excludesupport. This provides better integration with VS Code's file watching exclusion patterns.Example usage:
{ "files.watcherExclude": { "**/tmp/**": true, "**/cache/**": true } }Implementation Details
BrightScriptClientConfigurationinterface to include the newprojectDiscoveryExcludesettinggetWorkspaceExcludeGlobs()method to processfiles.watcherExcludepatternsPathFilterersystemBoth features work seamlessly with existing exclusion mechanisms like
files.exclude,search.exclude, and.gitignorepatterns.Fixes #1527.
💡 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.