mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 08:10:11 +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-typescript/monaco.d.ts" />
|
||||
define(['require', './samples'], function(require, SAMPLES) {
|
||||
|
||||
var domutils = require('vs/base/browser/dom');
|
||||
|
||||
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'), {
|
||||
model: model,
|
||||
glyphMargin: true,
|
||||
|
|
@ -295,6 +306,20 @@ function createOptions(editor) {
|
|||
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