Browse Source

Format sample code

Alexandru Dima 5 years ago
parent
commit
65473735f8

+ 20 - 17
test/playground.generated/extending-language-services-codelens-provider-example.html

@@ -41,35 +41,38 @@ var editor = monaco.editor.create(document.getElementById("container"), {
     language: "json"
 });
 
-var commandId = editor.addCommand(0, function() {
+var commandId = editor.addCommand(0, function () {
     // services available in `ctx`
     alert('my command is executing!');
 
 }, '');
 
 monaco.languages.registerCodeLensProvider('json', {
-    provideCodeLenses: function(model, token) {
-        return [
-            {
-                range: {
-                    startLineNumber: 1,
-                    startColumn: 1,
-                    endLineNumber: 2,
-                    endColumn: 1
-                },
-                id: "First Line",
-                command: {
-                    id: commandId,
-                    title: "First Line"
+    provideCodeLenses: function (model, token) {
+        return {
+            lenses: [
+                {
+                    range: {
+                        startLineNumber: 1,
+                        startColumn: 1,
+                        endLineNumber: 2,
+                        endColumn: 1
+                    },
+                    id: "First Line",
+                    command: {
+                        id: commandId,
+                        title: "First Line"
+                    }
                 }
-            }
-        ];
+            ]
+        };
     },
-    resolveCodeLens: function(model, codeLens, token) {
+    resolveCodeLens: function (model, codeLens, token) {
         return codeLens;
     }
 });
 
+
 /*----------------------------------------SAMPLE JS END*/
 });
 </script>

+ 19 - 17
website/playground/new-samples/extending-language-services/codelens-provider-example/sample.js

@@ -3,31 +3,33 @@ var editor = monaco.editor.create(document.getElementById("container"), {
     language: "json"
 });
 
-var commandId = editor.addCommand(0, function() {
+var commandId = editor.addCommand(0, function () {
     // services available in `ctx`
     alert('my command is executing!');
 
 }, '');
 
 monaco.languages.registerCodeLensProvider('json', {
-    provideCodeLenses: function(model, token) {
-        return {lenses: [
-            {
-                range: {
-                    startLineNumber: 1,
-                    startColumn: 1,
-                    endLineNumber: 2,
-                    endColumn: 1
-                },
-                id: "First Line",
-                command: {
-                    id: commandId,
-                    title: "First Line"
+    provideCodeLenses: function (model, token) {
+        return {
+            lenses: [
+                {
+                    range: {
+                        startLineNumber: 1,
+                        startColumn: 1,
+                        endLineNumber: 2,
+                        endColumn: 1
+                    },
+                    id: "First Line",
+                    command: {
+                        id: commandId,
+                        title: "First Line"
+                    }
                 }
-            }
-        ]};
+            ]
+        };
     },
-    resolveCodeLens: function(model, codeLens, token) {
+    resolveCodeLens: function (model, codeLens, token) {
         return codeLens;
     }
 });