rokucommunity / rokucommunity/brighterscript

Lazy LSP project activation: activate projects on first file interaction, not all at startup

Open
#1,691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

Currently on startup, the language server activates all discovered projects immediately. For workspaces with many bsconfig.json files (e.g. monorepos, multi-channel workspaces), this means loading and compiling every project upfront, which is expensive.

Proposed approach

  1. On startup, scan for all projects and parse their bsconfig.json files (to know which files belong to each project), but do not activate them (no compilation, no full program load)
  2. Activate a project lazily the first time any file from its files array is seen flowing through the editor (open, focus, hover, go-to-def — any editor event, not just file-change events)
  3. Add a brightscript.languageServer.activationMode VS Code setting with values:
    • "eager" — current behavior: activate all projects at startup
    • "lazy" — new behavior: activate on first file touch

Open question: Should activationMode also be settable in bsconfig.json for per-project control? This would let a large shared library opt into eager loading even if the workspace default is lazy.

Tradeoffs

  • Pro: Faster startup, lower memory in large workspaces; unused projects never load
  • Con: First interaction with a new project has latency while it activates; no pre-baking benefit for large projects under lazy mode (which is why eager should remain an option)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the language server's startup project discovery and activation flow, including how bsconfig.json files are parsed and how editor events expose file interactions. Define the eager and lazy activation paths, then verify that the brightscript.languageServer.activationMode setting controls them and that projects activate on the first relevant editor event without loading unused projects.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.