rokucommunity / rokucommunity/brighterscript

require failures in bsconfig should produce a diagnostic and not crash the LSP process

Open
#1,690 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, when a require entry in bsconfig.json fails (e.g. missing module, syntax error in plugin), it throws an unhandled exception that takes down the entire LSP process. This is too destructive — a broken plugin in one project should not kill language intelligence for all open projects.

Proposed changes

  • Wrap each require call in a try/catch
  • Track the exact line/column position of the failing require entry in bsconfig.json so we can emit a proper diagnostic pointing to it
  • Emit a logger.error(...) entry when a require fails
  • Instead of crashing, signal to the LSP that this specific project failed to load (without bringing down the whole server)
  • On initial startup: collect all project activation errors and send a single consolidated error message to the LSP client (rather than one popup per project — that's too noisy)
  • On subsequent per-project reloads (e.g. bsconfig change): send an individual error for that project only

Why

One bad plugin or misconfigured require path should not break the LSP for all other projects in the workspace. Diagnostics should surface the problem precisely in bsconfig.json at the offending line.

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 how require entries from bsconfig.json are loaded during project activation and reloads, then inspect the LSP error-reporting path and logger.error usage. Done means failed requires produce a line/column diagnostic, log an error, preserve the server for other projects, consolidate startup errors, and report reload errors per project.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.