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?

 采纳的回答

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 个评论

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"
}
]
}

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by