-
Notifications
You must be signed in to change notification settings - Fork 100
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
[minor] Enable parse @requiresStreamAddress and @requiresStreamParameterAddresses for custom functions #900
base: master
Are you sure you want to change the base?
[minor] Enable parse @requiresStreamAddress and @requiresStreamParameterAddresses for custom functions #900
Conversation
…om/sunyao-ms/Office-Addin-Scripts into user/yao/enableParseStreamAddress
@sunyao-ms please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
extra.errors.push(logError(errorString, functionPosition)); | ||
} | ||
|
||
if (!isStreamingFunction && !isCancelableFunction && !isInvocationFunction) { |
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.
If the function is not streaming, I think it should fail and we don't have this kind of check?
if (optionsItem.requiresStreamAddress || optionsItem.requiresStreamParameterAddresses) { | ||
let errorParam = optionsItem.requiresStreamAddress ? "@requiresStreamAddress" : "@requiresStreamParameterAddresses"; | ||
|
||
if (!optionsItem.stream) { |
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.
Just curious, what's the difference between optionsItem.stream
and isStreamingFunction
?
/** | ||
* Test the requiresStreamAddress tag | ||
* @param x {string} string | ||
* @param handler {CustomFunctions.StreamingInvocation<string>} my handler |
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.
This is not a general handler but an object. We may rename it as invocation
.
And same issue for other functions.js
and functions.ts
files.
Change Description:
This PR containing the following change:
Enable parse @requiresStreamAddress and @requiresStreamParameterAddresses for custom functions
Add unit test
Do these changes impact command syntax of any of the packages? (e.g., add/remove command, add/remove a command parameter, or update required parameters)
No
Do these changes impact documentation? (e.g., a tutorial on https://learn.microsoft.com/office/dev/add-ins/overview/office-add-ins)
Yes, we will introduce new tag for custom functions, so the doc on https://learn.microsoft.com/en-us/javascript/api/custom-functions-runtime/customfunctions.streaminginvocation?view=excel-js-preview should be updated with how to use the new tags.
Validation/testing performed: