代码之家  ›  专栏  ›  技术社区  ›  Dev-iL

类方法的自定义代码完成?

  •  3
  • Dev-iL  · 技术社区  · 6 年前

    在MATLAB中,可以定义代码建议和完成,如标题为 Customize Code Suggestions and Completions

    其中给出的片段,例如。

    {
      "_schemaVersion": "1.0.0",
      "anotherFunc":
      {
         "inputs":
         [
            {"name":"input1",  "kind":"required", "type":["numeric"]},
            {"name":"input2",  "kind":"required", "type":["numeric"]}
         ]
      }
    }
    

    functionSignatures.json

    myMethod 它驻留在一个名为 myClass . 创建如上所述的JSON "myMethod" "anotherFunc" 似乎没有效果。

    类方法

    1 回复  |  直到 6 年前
        1
  •  2
  •   Dev-iL    6 年前

    经过一些尝试和错误之后,预测/完成逻辑似乎希望看到如下语法:

    "myClass.myMethod"
    

    换言之,这应该起作用:

    {
      "_schemaVersion": "1.0.0",
      "myClass.myMethod":
      {
         "inputs":
         [
            ...
         ]
      }
    }