mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Format sample code
This commit is contained in:
parent
c620a60f78
commit
65473735f8
2 changed files with 39 additions and 34 deletions
|
|
@ -41,15 +41,16 @@ 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 [
|
||||
provideCodeLenses: function (model, token) {
|
||||
return {
|
||||
lenses: [
|
||||
{
|
||||
range: {
|
||||
startLineNumber: 1,
|
||||
|
|
@ -63,13 +64,15 @@ monaco.languages.registerCodeLensProvider('json', {
|
|||
title: "First Line"
|
||||
}
|
||||
}
|
||||
];
|
||||
]
|
||||
};
|
||||
},
|
||||
resolveCodeLens: function(model, codeLens, token) {
|
||||
resolveCodeLens: function (model, codeLens, token) {
|
||||
return codeLens;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------SAMPLE JS END*/
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,16 @@ 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: [
|
||||
provideCodeLenses: function (model, token) {
|
||||
return {
|
||||
lenses: [
|
||||
{
|
||||
range: {
|
||||
startLineNumber: 1,
|
||||
|
|
@ -25,9 +26,10 @@ monaco.languages.registerCodeLensProvider('json', {
|
|||
title: "First Line"
|
||||
}
|
||||
}
|
||||
]};
|
||||
]
|
||||
};
|
||||
},
|
||||
resolveCodeLens: function(model, codeLens, token) {
|
||||
resolveCodeLens: function (model, codeLens, token) {
|
||||
return codeLens;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue