@-folder and functionSignatures.json

11 ビュー (過去 30 日間)
Edoardo Ferocino
Edoardo Ferocino 2019 年 12 月 16 日
回答済み: Ken Atwell 2020 年 8 月 11 日
Hi everyone.
I have a classdef file in a certain @-folder. In the same folder I put the folder "resources" containing the "functionSignatures.json" file for the class object I created. Unfortunately when I try to use the autocompletion with an instance of the class object, I don't get any suggestion at all, as if Matlab doesn't find the corresponding functionSignatures.json file.
Example
@MyClass/MyClass.m
@MyClass/resources/functionSignatures.json (containing the function signatures for MyClass.m
but when i type "MyClass(' " and press "tab" I don't get any completions.
If I put the MyClass.m and functionSignature.json file in a NOT @-folder everything works fine.
Any suggestion?

採用された回答

per isakson
per isakson 2019 年 12 月 16 日
編集済み: per isakson 2019 年 12 月 16 日
The R2019b doc Customize Code Suggestions and Completions says "For MATLAB to detect the function signature information, you must place functionSignatures.json in the folder that contains the function code."
I failed to find reference to a folder named "resources". Could it differ between releases?
Interpreting the documentation is sometimes tricky, because the text describes only the basic case.
I made the following two clips from my R2018a installation.
Proposal: try with functionSignature.json in the same folder as the folder @MyClass.
  1 件のコメント
Edoardo Ferocino
Edoardo Ferocino 2019 年 12 月 17 日
Thanks per isakson, this solved the issue!
FYI, the "resources" folder is something I assumed necessary having a look at built-in functions signatures. For example, the functionSignature.json file for the "figure" function is under matlabroot\toolbox\matlab\graphics\resources. But maybe is for a different reason.
Thanks

サインインしてコメントする。

その他の回答 (1 件)

Ken Atwell
Ken Atwell 2020 年 8 月 11 日
The documentation was improved for the R2020a release to clarify the location for class method JSON definitions; see the first few paragraphs of:
You would want to place your functionSignatures.json file in the parent folder of @MyClass

カテゴリ

Help Center および File ExchangeJSON Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by