src/vs/platform/credentials/common/credentialsMainService.ts/BaseCredentialsMainService/deletePassword
class BaseCredentialsMainService:	async deletePassword(service: string, account: string): Promise<boolean> {
		this.logService.trace('Deleting password using keytar:', service, account);
		let keytar: KeytarModule;
		try {
			keytar = await this.withKeytar();
		} catch (e) {
			this.surfaceKeytarLoadError?.(e);
			throw e;
		}

		const password = await keytar.getPassword(service, account);
		if (!password) {
			this.logService.trace('Did not get a password to delete from keytar for account:', account);
			return false;
		}

		let content: string | undefined;
		let hasNextChunk: boolean | undefined;
		try {
			const possibleChunk = JSON.parse(password);
			content = possibleChunk.content;
			hasNextChunk = possibleChunk.hasNextChunk;
		} catch {
			// When the password is saved the entire JSON payload is encrypted then stored, thus the result from getPassword might not be valid JSON
			// https://github.com/microsoft/vscode/blob/c22cb87311b5eb1a3bf5600d18733f7485355dc0/src/vs/workbench/api/browser/mainThreadSecretState.ts#L83
			// However in the chunked case we JSONify each chunk after encryption so for the chunked case we do expect valid JSON here
			// https://github.com/microsoft/vscode/blob/708cb0c507d656b760f9d08115b8ebaf8964fd73/src/vs/platform/credentials/common/credentialsMainService.ts#L128
			// Empty catch here just as in getPassword because we expect to handle both JSON cases and non JSON cases here it's not an error case to fail to parse
			// https://github.com/microsoft/vscode/blob/708cb0c507d656b760f9d08115b8ebaf8964fd73/src/vs/platform/credentials/common/credentialsMainService.ts#L76
		}

		let index = 0;
		if (content && hasNextChunk) {
			try {
				// need to delete additional chunks
				index++;
				while (hasNextChunk) {
					const accountWithIndex = `${account}-${index}`;
					const nextChunk = await keytar.getPassword(service, accountWithIndex);
					await keytar.deletePassword(service, accountWithIndex);

					const result: ChunkedPassword = JSON.parse(nextChunk!);
					hasNextChunk = result.hasNextChunk;
					index++;
				}
			} catch (e) {
				this.logService.error(e);
			}
		}

		// Delete the first account to determine deletion success
		if (await keytar.deletePassword(service, account)) {
			this._onDidChangePassword.fire({ service, account });
			this.logService.trace(`Deleted${index ? ` ${index}-chunked` : ''} password from keytar for account:`, account);
			return true;
		}

		this.logService.trace(`Keytar failed to delete${index ? ` ${index}-chunked` : ''} password for account:`, account);
		return false;
	}