mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Merge remote-tracking branch 'origin/master' into PAPERPANKS-master
This commit is contained in:
commit
290dd05367
19 changed files with 6177 additions and 1266 deletions
|
|
@ -154,7 +154,7 @@
|
|||
<img src="https://opensource.microsoft.com/img/microsoft.png" alt="Microsoft" style="max-height:23px;margin-bottom:12px;">
|
||||
</a>
|
||||
<br/>
|
||||
<small>© 2017 Microsoft</small>
|
||||
<small>© 2018 Microsoft</small>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
|
|
|
|||
|
|
@ -4291,7 +4291,7 @@ return {
|
|||
<footer class="container">
|
||||
<hr>
|
||||
<p class="text-center">
|
||||
<small>© 2017 Microsoft</small>
|
||||
<small>© 2018 Microsoft</small>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
<footer class="container">
|
||||
<hr>
|
||||
<p class="text-center">
|
||||
<small>© 2017 Microsoft</small>
|
||||
<small>© 2018 Microsoft</small>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,7 +6,7 @@ var editor = monaco.editor.create(document.getElementById("container"), {
|
|||
value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line",
|
||||
language: "javascript",
|
||||
|
||||
lineNumbers: false,
|
||||
lineNumbers: "off",
|
||||
roundedSelection: false,
|
||||
scrollBeyondLastLine: false,
|
||||
readOnly: false,
|
||||
|
|
@ -14,6 +14,6 @@ var editor = monaco.editor.create(document.getElementById("container"), {
|
|||
});
|
||||
setTimeout(function() {
|
||||
editor.updateOptions({
|
||||
lineNumbers: true
|
||||
lineNumbers: "on"
|
||||
});
|
||||
}, 2000);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ monaco.languages.registerCompletionItemProvider('json', {
|
|||
provideCompletionItems: function(model, position) {
|
||||
// find out if we are completing a property in the 'dependencies' object.
|
||||
var textUntilPosition = model.getValueInRange({startLineNumber: 1, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column});
|
||||
var match = textUntilPosition.match(/"dependencies"\s*:\s*{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*("[^"]*)?$/); if (match) {
|
||||
var match = textUntilPosition.match(/"dependencies"\s*:\s*{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*("[^"]*)?$/);
|
||||
if (match) {
|
||||
return createDependencyProposals();
|
||||
}
|
||||
return [];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
// Configures two JSON schemas, with references.
|
||||
|
||||
var id = "foo.json";
|
||||
|
||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
validate: true,
|
||||
schemas: [{
|
||||
uri: "http://myserver/foo-schema.json",
|
||||
fileMatch: [id],
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
|
|
@ -16,6 +20,7 @@ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|||
}
|
||||
},{
|
||||
uri: "http://myserver/bar-schema.json",
|
||||
fileMatch: [id],
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
|
|
@ -30,11 +35,13 @@ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|||
|
||||
var jsonCode = [
|
||||
'{',
|
||||
' "$schema": "http://myserver/foo-schema.json"',
|
||||
' "p1": "v3",',
|
||||
' "p2": false',
|
||||
"}"
|
||||
].join('\n');
|
||||
|
||||
var model = monaco.editor.createModel(jsonCode, "json", id);
|
||||
|
||||
monaco.editor.create(document.getElementById("container"), {
|
||||
value: jsonCode,
|
||||
language: "json"
|
||||
});
|
||||
model: model
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue