浏览代码

better PG template

David Catuhe 5 年之前
父节点
当前提交
e6f3a157b7
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      Playground/js/monacoCreator.js
  2. 1 1
      Playground/templates.json

+ 1 - 0
Playground/js/monacoCreator.js

@@ -309,6 +309,7 @@ class MonacoCreator {
                         continue;
 
                     template.range = undefined;
+                    template.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
                     suggestions.push(template);
                 }
             }

+ 1 - 1
Playground/templates.json

@@ -2,7 +2,7 @@
   {
     "label" : "Create a sphere",
     "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
-    "insertText" : "var sphere = BABYLON.MeshBuilder.CreateSphere(\"sphere\", {diameter: 1}, scene);",
+    "insertText" : "var sphere = BABYLON.MeshBuilder.CreateSphere(\"${1:sphere}\", {diameter: ${2:1}}, scene);",
     "language" : "javascript"
   }
 ]