AndreOneti / qml-formatter

Formatter, definition and autocomplete for QML language
MIT License
17 stars 2 forks source link

feat: add qmlTypes contribution point #27

Open katzer opened 1 year ago

katzer commented 1 year ago

About

This PR adds the ability to register additional QML-Types for autocompletion by proving a qmlTypes contribution point.

// 3rd-party package.json

{
  "contributes": {
    "qmlTypes": [
      "./qml_types/**/*.json"
    ]
  }
}

The files containing the type defintions need to be in JSON format and comply with the IComponent interface. For example:

{
  "Abstract3DSeries":{
    "properties":{
      "baseColor":"color",
      "baseGradient":"ColorGradient",
      "colorStyle":"Theme3D.ColorStyle",
      "itemLabel":"string",
      "itemLabelFormat":"string",
      "itemLabelVisible":"bool",
      "mesh":"Abstract3DSeries.Mesh",
      "meshRotation":"quaternion",
      "meshSmooth":"bool",
      "multiHighlightColor":"color",
      "multiHighlightGradient":"ColorGradient",
      "name":"string",
      "singleHighlightColor":"color",
      "singleHighlightGradient":"ColorGradient",
      "type":"Abstract3DSeries.SeriesType",
      "userDefinedMesh":"string",
      "visible":"bool"
    },
    "signals":{},
    "methods":{},
    "inherit":"QtObject"
  }
}