microsoft / microsoft/typespec

LSP Compilation Optimization

Open
#7,376 1 comment 0 reactions 0 assignees View on GitHub
compiler:core ide
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

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

```ts
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.