Skip to content

Commit 2eafafb

Browse files
committed
update tag from @sync to @SupportSync
1 parent aee086a commit 2eafafb

File tree

5 files changed

+8
-42
lines changed

5 files changed

+8
-42
lines changed

packages/custom-functions-metadata/src/parseTree.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface IFunctionOptions {
3030
excludeFromAutoComplete?: boolean;
3131
linkedEntityLoadService?: boolean;
3232
capturesCallingObject?: boolean;
33-
sync?: boolean
33+
supportSync?: boolean;
3434
}
3535

3636
export interface IFunctionParameter {
@@ -133,7 +133,7 @@ const REQUIRESADDRESS = "requiresaddress";
133133
const REQUIRESPARAMETERADDRESSES = "requiresparameteraddresses";
134134
const STREAMING = "streaming";
135135
const VOLATILE = "volatile";
136-
const SYNC = "sync";
136+
const SUPPORT_SYNC = "supportsync";
137137

138138
const TYPE_MAPPINGS = {
139139
[ts.SyntaxKind.NumberKeyword]: "number",
@@ -465,7 +465,7 @@ export function parseTree(sourceCode: string, sourceFileName: string): IParseTre
465465
!options.excludeFromAutoComplete &&
466466
!options.linkedEntityLoadService &&
467467
!options.capturesCallingObject &&
468-
!options.sync
468+
!options.supportSync
469469
) {
470470
delete functionMetadata.options;
471471
} else {
@@ -509,8 +509,8 @@ export function parseTree(sourceCode: string, sourceFileName: string): IParseTre
509509
delete options.capturesCallingObject;
510510
}
511511

512-
if (!options.sync) {
513-
delete options.sync;
512+
if (!options.supportSync) {
513+
delete options.supportSync;
514514
}
515515
}
516516

@@ -674,7 +674,7 @@ function getOptions(
674674
excludeFromAutoComplete: isExcludedFromAutoComplete(func),
675675
linkedEntityLoadService: isLinkedEntityLoadService(func),
676676
capturesCallingObject: capturesCallingObject(func),
677-
sync: isSync(func),
677+
supportSync: supportSync(func),
678678
};
679679

680680
if (isAddressRequired(func) || isRequiresParameterAddresses(func)) {
@@ -689,14 +689,6 @@ function getOptions(
689689
}
690690
}
691691

692-
if (isSync(func)) {
693-
if (!isInvocationFunction) {
694-
const functionPosition = getPosition(func, func.parameters.end);
695-
const errorString = `Since @sync is present, the last function parameter should be of type CustomFunctions.Invocation :`;
696-
extra.errors.push(logError(errorString, functionPosition));
697-
}
698-
}
699-
700692
if (
701693
optionsItem.linkedEntityLoadService &&
702694
(optionsItem.excludeFromAutoComplete ||
@@ -1082,8 +1074,8 @@ function capturesCallingObject(node: ts.Node): boolean {
10821074
* Returns true if sync tag found in comments
10831075
* @param node jsDocs node
10841076
*/
1085-
function isSync(node: ts.Node): boolean {
1086-
return hasTag(node, SYNC);
1077+
function supportSync(node: ts.Node): boolean {
1078+
return hasTag(node, SUPPORT_SYNC);
10871079
}
10881080

10891081
function containsTag(tag: ts.JSDocTag, tagName: string): boolean {

packages/custom-functions-metadata/test/cases/error-sync-missing-invocation-parameter/expected.js.errors.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/custom-functions-metadata/test/cases/error-sync-missing-invocation-parameter/expected.ts.errors.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/custom-functions-metadata/test/cases/error-sync-missing-invocation-parameter/functions.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/custom-functions-metadata/test/cases/error-sync-missing-invocation-parameter/functions.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)