Jelajahi Sumber

better PG template

David Catuhe 5 tahun lalu
induk
melakukan
e6f3a157b7
2 mengubah file dengan 2 tambahan dan 1 penghapusan
  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;
                         continue;
 
 
                     template.range = undefined;
                     template.range = undefined;
+                    template.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
                     suggestions.push(template);
                     suggestions.push(template);
                 }
                 }
             }
             }

+ 1 - 1
Playground/templates.json

@@ -2,7 +2,7 @@
   {
   {
     "label" : "Create a sphere",
     "label" : "Create a sphere",
     "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
     "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"
     "language" : "javascript"
   }
   }
 ]
 ]