Explorar o código

better PG template

David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
e6f3a157b7
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  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"
   }
 ]