fimbullinter / wotan

Pluggable TypeScript and JavaScript linter
Apache License 2.0
281 stars 23 forks source link

Add caching to LanguageService pugin #761

Closed ajafff closed 3 years ago

ajafff commented 3 years ago

Checklist

Overview of change

Uses the ProgramState machinery to determine whether a file needs to be linted again. This reduces the response time by orders of magnitude (e.g. 250ms -> 20ms).

No warm start. Doesn't read/write cache on disk. This avoids frequent IO and does not invalidate the cache due to changed module resolutions from useSourceOfProjectReferenceRedirect.

Introduces a new abstraction ContentId. In CLI scenario this service simply hashes the file content. In LS it uses the version information to keep track of changes.

Contains changes to handle module resolution to files not included in the Program. Contains changes to make case sensitivity in cache more reliable.