mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
## Problem The diagnostic collection object is set up so that it does not mutate the arrays of diagnostics you pass to it. It also does not expect or allow mutation of diagnostics that it returns. However it it currently typed using normal arrays. This means that if an extension (such as JS/TS) wishes to use readonly diagnostics intnernally, it cannot do so without casting. ## Proposed Fix Use `ReadonlyArray` in diagnostic collection. This should be a safe change for the `set` type methods. The changes to `get` and `forEach` have the risk of breaking the typing of some extensions, but `get` already returned a frozen array of diagnostic so trying to mutate the array itself would have resulted in runtime error.
Language Features for TypeScript and JavaScript files
Notice: This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
Features
See TypeScript in Visual Studio Code and JavaScript in Visual Studio Code to learn about the features of this extension.