How do I create custom signatures for non-static class methods?
Show older comments
Hi all,
I'm having trouble getting MATLAB to display the custom signatures for some of my non-static class methods.
For example, if I have a class:
classdef SomeClass
methods(Access = public)
function obj = SomeClass(a,b,c)
% ...
end
function this = foo(this,x,y,z)
% ...
end
end
end
a functionSignatures.json file:
{
"_schemaVersion": "1.0.0",
"SomeClass.SomeClass":
{
"inputs":
[
{
"mutuallyExclusiveGroup":
[
[
{"name":"A", "kind":"required", "type":"logical"}
],
[
{"name":"X", "kind":"required", "type":"numeric"},
{"name":"Y", "kind":"required", "type":"numeric"},
{"name":"Z", "kind":"required", "type":"numeric"}
]
]
}
]
},
"SomeClass.foo":
{
"inputs":
[
{
"mutuallyExclusiveGroup":
[
[
{"name":"A", "kind":"required", "type":"logical"}
],
[
{"name":"X", "kind":"required", "type":"numeric"},
{"name":"Y", "kind":"required", "type":"numeric"},
{"name":"Z", "kind":"required", "type":"numeric"}
]
]
}
]
}
}
and a script file:
clar,clc,validateFunctionSignaturesJSON("./functionSignatures.json");
obj = SomeClass(...);
obj.foo(...);
Line 1 completes with no messages. Line 2 gives me an autocomplete popup with 2 signatures. Line 3 shows no autocomplete popup. Any idea what I'm doing wrong?
1 Comment
Your post does not appear to be a copy-paste of the code you actually ran, which means it would be hazardous for us to assess it. In particular, there is no Matlab function called validateFunctionSignatures (although there is a function called validateFunctionSignaturesJSON). So, Line 1 should not have completed at all.
Accepted Answer
More Answers (0)
Categories
Find more on Toolbox Distribution 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!