Browse Source

Adds option to enable bracketPairColorization and enables typescript inlay hints in test playground.

Henning Dieterichs 3 years ago
parent
commit
563abfd711
1 changed files with 25 additions and 0 deletions
  1. 25 0
      test/index.js

+ 25 - 0
test/index.js

@@ -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, });
+		}
+	));
 }
 }