Mark array params in vscode.d.ts readonly (#124599)

I recently ran into an issue where I was trying to call showQuickPick with a readonly array. This is currently not allowed, even though `showQuickPick` never mutates the input

This change marks a few places in `vscode.d.ts` where we take arrays as parameters as `readonly []`. It also caught a potential bug with`getSession` modifying the input array
This commit is contained in:
Matt Bierner
2021-05-25 18:18:47 -07:00
committed by GitHub
parent 7d50ce2061
commit 24a23a8ea0
5 changed files with 23 additions and 23 deletions

View File

@@ -167,7 +167,7 @@ export interface MainThreadAuthenticationShape extends IDisposable {
$unregisterAuthenticationProvider(id: string): void;
$ensureProvider(id: string): Promise<void>;
$sendDidChangeSessions(providerId: string, event: modes.AuthenticationSessionsChangeEvent): void;
$getSession(providerId: string, scopes: string[], extensionId: string, extensionName: string, options: { createIfNone?: boolean, clearSessionPreference?: boolean }): Promise<modes.AuthenticationSession | undefined>;
$getSession(providerId: string, scopes: readonly string[], extensionId: string, extensionName: string, options: { createIfNone?: boolean, clearSessionPreference?: boolean }): Promise<modes.AuthenticationSession | undefined>;
$removeSession(providerId: string, sessionId: string): Promise<void>;
}