Custom functionSignatures.json stopped working on upgrade from R2019b to R2021b
Show older comments
I created a plot generator function in R2019a. It takes in a table and up to 4 column names to group and plot the data. I added a functionSignatures.json file next to it which was really handy to autocomplete the possible column names. When I upgraded to R2021b the autocomplete stopped working. If I re-open R2019b (still installed side-by-side with 2021b) the exact same inputs still work as they used to, but in 2021b it just shows "No suggestions found".
I searched the release notes for references to json between these two versions and didn't see anything stick out. https://www.mathworks.com/help/matlab/release-notes.html?rntext=json&startrelease=R2019b&endrelease=R2021b&groupby=release&sortby=descending&searchHighlight=json
I was able to re-create this behavior with the minimal example below:
functionSignatures.json
{
"MyPlot":
{
"inputs": [
{"name":"tbl", "kind":"required", "type":"table"},
{"name":"xvar", "kind":"positional", "type":["choices=matlab.internal.tabular.functionsignatures.keyChoices(tbl)"]},
{"name":"yvar", "kind":"positional", "type":["choices=matlab.internal.tabular.functionsignatures.keyChoices(tbl)"]},
{"name":"extra1", "kind":"positional", "type":["choices=matlab.internal.tabular.functionsignatures.keyChoices(tbl)"]},
{"name":"extra2", "kind":"positional", "type":["choices=matlab.internal.tabular.functionsignatures.keyChoices(tbl)"]}
],
"outputs": [
{"name":"out"}
]
}
}
MyPlot.m
function MyPlot(tbl, xvar, yvar, extra1, extra2)
plot(tbl.(xvar), tbl.(yvar));
end
Add those two files next to each other in some folder and go to that folder in R2019b.
Create a dummy table
t = table([1:10]', rand(10,1), 'VariableNames', {'Idx','RandNum'})
and try to use MyPlot
MyPlot(t, '
and you will see autocomplete options

Repeat this in 2021b and you will see "No completions found"

Please advise if I need to update something for this to work in 2021b. My plotter function still works, I just wish I got to use the autocomplete I'm used to having.
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!