functionSignatures.json for built-in functions

I would like to define code suggestions/completions for built-in Matlab functions. This document,
describes how to do so for user-defined function using a functionSignatures.json file. Applying this to builtins, however, would seem to require tampering with MathWorks-supplied files and folders. In particular, I would have to create a resource folders, or modify existing resource folders, in the MathWorks-controlled folders where the functions reside.
I would like to avoid this, if possible. Is there any way to make a functionSignatures.json apply to a function in an arbitrary location?

Answers (1)

I don't believe it's possible to create a functionSignatures.json file that applies to a function in an arbitrary location. Suppose you created one that had tab completion for a function that's overloaded as a method by multiple classes. Would you want that functionSignatures.json file to apply to any of those overloaded methods that are not covered by a functionSignatures.json file in their class folder?
If there are specific MathWorks built-in functions or functions included as part of MATLAB that do not have suggestion/completion data, I recommend you contact Technical Support and ask them to file an enhancement request to the development team(s) that own the functions.
IIRC I think you were asking in a different thread about completion for the methods function before. That could get very complicated as methods can accept either a class name or a class instance and at least a few classes overload that method for the latter scenario.
which -all methods
built-in (/MATLAB/toolbox/matlab/datatypes/methods) /MATLAB/toolbox/matlab/serial/@serial/methods.m % serial method /MATLAB/toolbox/imaq/imaq/@imaqdevice/methods.m % imaqdevice method /MATLAB/toolbox/imaq/imaq/@imaqchild/methods.m % imaqchild method /MATLAB/toolbox/instrument/instrument/@icgroup/methods.m % icgroup method /MATLAB/toolbox/instrument/instrument/@iviconfigurationstore/methods.m % iviconfigurationstore method /MATLAB/toolbox/instrument/instrument/@LegacyIcdevice/methods.m % LegacyIcdevice method /MATLAB/toolbox/shared/instrument/@icinterface/methods.m % icinterface method

1 Comment

Would you want that functionSignatures.json file to apply to any of those overloaded methods that are not covered by a functionSignatures.json file in their class folder?
By "arbitrary location", what I meant was, a location chosen by me in the .json entry. Something like this,
"/MATLAB/toolbox/matlab/datatypes/methods": {
"inputs": [
{
"name": "fun",
"kind": "required",
"type": "matlabpath=*.m"
}
]
}

Sign in to comment.

Categories

Find more on Software Development in Help Center and File Exchange

Products

Release

R2024b

Asked:

about 14 hours ago

Edited:

about 13 hours ago

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!