mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Adds option to enable bracketPairColorization and enables typescript inlay hints in test playground.
This commit is contained in:
parent
6f93540f34
commit
563abfd711
1 changed files with 25 additions and 0 deletions
|
|
@ -1,10 +1,21 @@
|
||||||
/// <reference path="../node_modules/monaco-editor-core/monaco.d.ts" />
|
/// <reference path="../node_modules/monaco-editor-core/monaco.d.ts" />
|
||||||
|
/// <reference path="../node_modules/monaco-typescript/monaco.d.ts" />
|
||||||
define(['require', './samples'], function(require, SAMPLES) {
|
define(['require', './samples'], function(require, SAMPLES) {
|
||||||
|
|
||||||
var domutils = require('vs/base/browser/dom');
|
var domutils = require('vs/base/browser/dom');
|
||||||
|
|
||||||
var model = monaco.editor.createModel('', 'plaintext');
|
var model = monaco.editor.createModel('', 'plaintext');
|
||||||
|
|
||||||
|
monaco.languages.typescript.typescriptDefaults.setInlayHintsOptions({
|
||||||
|
includeInlayParameterNameHints: 'all',
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName: true,
|
||||||
|
includeInlayFunctionParameterTypeHints: true,
|
||||||
|
includeInlayVariableTypeHints: true,
|
||||||
|
includeInlayPropertyDeclarationTypeHints: true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints: true,
|
||||||
|
includeInlayEnumMemberValueHints: true
|
||||||
|
});
|
||||||
|
|
||||||
var editor = monaco.editor.create(document.getElementById('container'), {
|
var editor = monaco.editor.create(document.getElementById('container'), {
|
||||||
model: model,
|
model: model,
|
||||||
glyphMargin: true,
|
glyphMargin: true,
|
||||||
|
|
@ -295,6 +306,20 @@ function createOptions(editor) {
|
||||||
editor.updateOptions({ folding: folding });
|
editor.updateOptions({ folding: folding });
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
var bracketPairColorizationEnabled = false;
|
||||||
|
options.appendChild(createOptionToggle(
|
||||||
|
editor,
|
||||||
|
'bracketPairColorizationEnabled',
|
||||||
|
function() {
|
||||||
|
return (bracketPairColorizationEnabled === false ? false : true);
|
||||||
|
},
|
||||||
|
function(editor, newValue) {
|
||||||
|
bracketPairColorizationEnabled = newValue;
|
||||||
|
editor.updateOptions({ "bracketPairColorization.enabled": bracketPairColorizationEnabled, });
|
||||||
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue