-
Notifications
You must be signed in to change notification settings - Fork 13k
Convert most of core.ts to accept ReadonlyArray #17092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ namespace ts { | |
* LS host can optionally implement these methods to support completions for module specifiers. | ||
* Without these methods, only completions for ambient modules will be provided. | ||
*/ | ||
readDirectory?(path: string, extensions?: string[], exclude?: string[], include?: string[], depth?: number): string[]; | ||
readDirectory?(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ok to change this? Does this count as a breaking change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically, but code should never have modified the extensions array anyway. |
||
readFile?(path: string, encoding?: string): string; | ||
fileExists?(path: string): boolean; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need an explicit type argument now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are problems with inferring type arguments -- when you get
Foo[]
and expectReadonlyArray<T>
, we have trouble inferring thatT = Foo
.