Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load projects based on bsconfig.json presence #613

Merged
merged 9 commits into from
Jun 7, 2022

Conversation

TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Jun 2, 2022

Enhances the language server to scan the project for all bsconfig.json files. If any are found, each is treated like its own bright(er)script project. If no bsconfig file is found, then the root of the workspace is treated as a bright(er)script project instead.

This will cause problems for any projects that have a root bsconfig and a nested bsconfig. The mitigation for that issue is to rename the outer (or inner) bsconfig.json to something else, like bsconfig.root.json for example.

Notable changes:

  • renamed the word workspace to project in the language server in many places. Now the core item is a project, and 1 workspace can have many projects
  • treat the root workspace as project only if there are no bsconfig.json files nested in the workspace folder
  • don't crash language server when bsconfig.json has syntax errors
  • better handling when adding/removing bsconfig.json files (i.e. load/unload projects accordingly)
  • eliminates the need for vscode code-workspaces in most cases.

TODO:

  • unit tests for removing and adding bsconfig.json files dynamically to a workspace
  • unit test for honoring vscode files.exclude setting

@TwitchBronBron TwitchBronBron marked this pull request as ready for review June 6, 2022 17:41
src/LanguageServer.spec.ts Outdated Show resolved Hide resolved
Copy link

@livecano livecano left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@TwitchBronBron TwitchBronBron merged commit 638fde4 into master Jun 7, 2022
@TwitchBronBron TwitchBronBron deleted the bsconfig-multi-project branch June 7, 2022 18:39
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.

3 participants