-
Notifications
You must be signed in to change notification settings - Fork 67
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
serviceconnector: Change nonNullValue
to nonNullProp
#1582
Conversation
import * as vscode from 'vscode'; | ||
import { ICreateLinkerContext } from './ICreateLinkerContext'; | ||
|
||
export class LinkerNameStep extends AzureWizardPromptStep<ICreateLinkerContext>{ | ||
public async prompt(context: ICreateLinkerContext): Promise<void> { | ||
context.linkerName = await context.ui.showInputBox({ | ||
prompt: vscode.l10n.t('Enter a name for the connection'), | ||
value: nonNullValue(context.targetServiceType?.name) + '_' + randomUtils.getRandomHexString(5), | ||
value: nonNullProp(nonNullProp(context, 'targetServiceType'), 'name') + '_' + randomUtils.getRandomHexString(5), |
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.
I think you can use nonNullPropAndValue here as well, but this fine as well.
return linkers.map(linker => createServiceConnectorItem(this.subscription, this.item, linker)); | ||
}); | ||
|
||
return nonNullValue(result); | ||
return nonNullValue(result, 'getChildren'); |
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.
I don't understand this change here.
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.
I added 'getChildren' as a propertyNameOrMessage
since I still wanted to have some context as to what value is nonNull. I couldn't change this to nonNullProp since result isn't a property. Not sure if this is actually what this optional parameter does since it doesn't give a description.
Changing so error messages are more detailed.