Skip to content

LSP Compilation Optimization #7376

Open
@timotheeguerin

Description

@timotheeguerin

Right now the Lsp will compile everything like tsp compile . --dryRun on every keystroke with a debounce time.

Problem is libraries can introduce bad performing validator, linting rule or emitters which then bring the IDE experience to a crawl.

We should design a system which does an incremental compilation and goes to further stage with larger increment.

  1. Parser + Checker (High importance should be run as often as possible)
  2. Validators
  3. Linters
  4. Emitters

Each stage could be run with larger debounce time. Allowing the checker and most syntax and core error to show up fast and the syntax highlighting and other IDE features(go to definition) to not get affected.

Could imagine things like that

const orchestractor = createOrchestractor();
orchestractor.check();
orchestractor.validate();
orchestractor.lint();
orchestractor.runAllEmitters();
orchestractor.runNextEmitter();

This would also let the lsp detect slow running emitters and adjust accordingly how often to run each one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:coreIssues for @typespec/compilerideIssues for VS, VSCode, Monaco, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions