mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
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:
@@ -219,7 +219,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
})();
|
||||
|
||||
const authentication: typeof vscode.authentication = {
|
||||
getSession(providerId: string, scopes: string[], options?: vscode.AuthenticationGetSessionOptions) {
|
||||
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
|
||||
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
||||
},
|
||||
get onDidChangeSessions(): Event<vscode.AuthenticationSessionsChangeEvent> {
|
||||
@@ -998,10 +998,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
stopDebugging(session?: vscode.DebugSession) {
|
||||
return extHostDebugService.stopDebugging(session);
|
||||
},
|
||||
addBreakpoints(breakpoints: vscode.Breakpoint[]) {
|
||||
addBreakpoints(breakpoints: readonly vscode.Breakpoint[]) {
|
||||
return extHostDebugService.addBreakpoints(breakpoints);
|
||||
},
|
||||
removeBreakpoints(breakpoints: vscode.Breakpoint[]) {
|
||||
removeBreakpoints(breakpoints: readonly vscode.Breakpoint[]) {
|
||||
return extHostDebugService.removeBreakpoints(breakpoints);
|
||||
},
|
||||
asDebugSourceUri(source: vscode.DebugProtocolSource, session?: vscode.DebugSession): vscode.Uri {
|
||||
|
||||
Reference in New Issue
Block a user