Skip to content
Snippets Groups Projects
Unverified Commit cf39634e authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Update how we handle autocomplete and format for zero-arity functions in ExpressionEditor (#26563)

* Update suggestionText function

* Suggest with closing parens if zero-arity

* Format zero-arity functions with ()
parent 3880651f
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ function formatFunction([fn, ...args], options) {
const formattedName = getExpressionName(fn);
const formattedArgs = args.map(arg => format(arg, options));
return args.length === 0
? formattedName
? formattedName + "()"
: `${formattedName}(${formattedArgs.join(", ")})`;
}
......
......@@ -16,11 +16,7 @@ import {
formatSegmentName,
} from "./index";
const suggestionText = func => {
const { displayName, args } = func;
const suffix = args.length > 0 ? "(" : " ";
return displayName + suffix;
};
const suggestionText = func => func.displayName + "(";
export function suggest({
source,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment