adds support for typescript inlay hints. Inlay hints can be enabled like this:
monaco.languages.typescript.typescriptDefaults.setInlayHintsOptions({
includeInlayParameterNameHints: 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName: true,
includeInlayFunctionParameterTypeHints: true,
includeInlayVariableTypeHints: true,
includeInlayPropertyDeclarationTypeHints: true,
includeInlayFunctionLikeReturnTypeHints: true,
includeInlayEnumMemberValueHints: true
});
bracketPairColorization.enabled when creating a new editor:
ts
var editor = monaco.editor.create(document.getElementById('container'), {
model: model,
language: 'javascript',
"bracketPairColorization.enabled": true,
});
registerCodeActionProvider now accepts metadata to specify provided code action kinds (e.g. quickfix, refactor or source).
Contributions to monaco-editor:
Contributions to monaco-html:
Contributions to monaco-languages:
Contributions to monaco-typescript:
inlineClassName to style injected textfoldingImportsByDefaultseedSearchStringFromSelection from boolean to 'never' | 'always' 'selection'subwordDiff to subwordSmart, introduced subwordContributions to monaco-editor:
Contributions to monaco-languages:
strict keyword to Pascal language PR #153IModelDecorationOptions.before/after.label, detail and description (instead of name, parameters, qualifier and type).Contributions to monaco-editor:
Contributions to monaco-languages:
Contributions to monaco-typescript:
registerHTMLLanguageService is not available in the AMD version of the monaco-html contribution.inlineSuggest that features a provider api and new settings.suggest.preview to toggle previewing the selected suggest item.suggest.showDeprecatedregisterHTMLLanguageServiceinlineHints to inlayHints.Contributions to monaco-editor:
Contributions to monaco-languages:
Contributions to monaco-typescript:
domReadOnly which controls if the <textarea> used for editor input should have the DOM readonly attributeuseShadowDOM which can be set to false to prevent the editor from using shadow DOM in its implementation (e.g. for the contextmenus).autoClosingDelete that controls how backspace works inside auto-closing pairs.DiagnosticsOptions.onlyVisible for TypeScript which limits the computation of diagnostics to only visible text models.EditorAutoClosingOvertypeStrategy has been renamed to EditorAutoClosingEditStrategyContributions to monaco-editor:
Contributions to monaco-editor-webpack-plugin:
Contributions to monaco-languages:
Contributions to monaco-typescript:
autoDetectHighContrast.Contributions to monaco-languages:
Contributions to monaco-typescript:
Fixes a regression where symbol icons used in suggestions or quick outline were missing colors (see https://github.com/microsoft/monaco-editor/issues/2329).
Fixes a regression where under certain webpack configurations process.nextTick could be used without explicitly checking for it being defined (see https://github.com/microsoft/monaco-editor/issues/2328).
Fixes a regression where format commands would no longer work (see https://github.com/microsoft/monaco-editor/issues/2327).
monaco.editor.onDidChangeMarkers to listen for marker changes.monaco.editor.registerCommand to register global commands.monaco.languages.setColorMap to allow defining the color map used for tokenization.IMonarchLanguage.includeLF to allow matching against the \n at the end of each line.stickyTabStops to make interacting with spaces in indentation behave more like interacting with tabs.monaco object. You can define global.MonacoEnvironment = { globalAPI: true } if you want for the editor to define this global object.OnTypeRenameProvider to LinkedEditingRangeProvider and related methods like the editor option renameOnType (now linkedEditing), registerOnTypeRenameProvider (now registerLinkedEditingRangeProvider), etc.OnEnterRule.oneLineAboveText to OnEnterRule.previousLineTextContributions to monaco-editor:
Contributions to monaco-languages:
Contributions to monaco-typescript:
Contributions to monaco-css:
Fixes a regression in suggestions where the browser clipboard API would be accessed by incomplete suggestion lists (see https://github.com/microsoft/vscode/commit/96d61842bae1e5dd11f9ff6139fad9e3e5141401).
Fixes a regression in monaco-css.
monaco.uri methods file, from, isUri, joinPath, parse, revive are now static. Changing new monaco.uri.method to monaco.uri.method resolves 'TypeError: monaco.Uri.file is not a constructor at...' errors.Fixes a few regressions.
Contributions to monaco-html:
Contributions to monaco-languages:
Contributions to monaco-typescript:
Paste in the context menu in browsers which support the clipboard API.monaco-typescript: support for "deprecated" tags, API to participate in the web worker, improved lib.d.ts resolving.overflowWidgetsDomNode constructor option to pass in a parent for overflowing widgets.minimap.size option: proportional, fill, fit.OnTypeRename provider and option renameOnType.automaticLayout.tabIndex, scrollPredominantAxis, columnSelection, padding, unfoldOnClickAfterEndOfLine, renderLineHighlightOnlyWhenFocus, definitionLinkOpensInPeek, showDeprecated, comments.ignoreEmptyLines, find.cursorMoveOnType, find.loop.originalCodeLens, modifiedCodeLens.rulers can now define different colors, renderWhitespace can now be trailing.CompletionItemLabel.signature has been renamed to CompletionItemLabel.parameters.CompletionItemProvider.resolveCompletionItem has changed.IMarker.code.link was renamed to IMarker.code.target.IMarkerData.code.link was renamed to IMarkerData.code.target.EditorLayoutInfo has been restructured.Contributions to monaco-editor:
Contributions to monaco-typescript:
Contributions to monaco-json:
Contributions to monaco-languages:
renderValidationDecorations - render validation decorations even in read only editorswrappingStrategy - delegate wrapping points computation to the browsercomments.insertSpace - insert a space around comments when running commenting commandsfoldingHighlight - highlight folded regionspeekWidgetDefaultFocus - focus the inline editor or the tree when opening peek viewonCompositionStart, onCompositionEnd to onDidCompositionStart, onDidCompositionEndonDidPasteWorkspaceEdit.edits has now changed its shape such that edits must no longer be grouped by resource.Contributions to monaco-editor:
Contributions to monaco-typescript:
Contributions to monaco-languages:
Contributions to monaco-editor:
Contributions to monaco-languages:
autoIndent - #1726wordBasedSuggestions) - #1746Contributions to monaco-editor:
Contributions to monaco-languages:
dimension in the editor construction options in order to avoid a synchronous layout.multiCursorPaste: define how to distribute paste in case of multi-cursormatchBrackets: control if enclosing brackets should be highlightedgetConfiguration() is replaced by getRawOptions(), which returns the passed in editor options.Contributions to monaco-editor:
Contributions to monaco-editor-webpack-plugin:
Contributions to monaco-languages:
Contributions to monaco-typescript:
Contributions to monaco-editor:
Contributions to monaco-json:
Contributions to monaco-languages:
Contributions to monaco-typescript:
monaco.languages.typescript.typeScriptVersion PR #31IModelDecorationOptions.minimap, once set the decoration will be rendered in the minimapautoClosingOvertype: it controls whether the editor allows typing over closing quotes or brackets.cursorSurroundingLines: it controls how many visible lines to display around the cursor while moving the cursor towards beginning or end of a file.renderWhitespace: "selection": the editor can render whitespaces only in selection.DeclarationProvider: The declaration provider interface defines the contract between extensions and the go to declaration feature.SelectionRangeProvider Provide smart selection ranges for the given positions, see VS Code issue.CodeLensList instead of ICodeLensSymbol[].DocumentSymbol has a new property tags to support more types.string instead of number.Contributions to monaco-json:
LinkProvider.ProvideLinks should now return ILinksList instead of ILink[].IEditorOptions.iconsInSuggestions and EditorContribOptions.iconsInSuggestions are now replaced by EditorContribOptions.suggest.showIcons.EditorContribOptions.suggest.maxVisibleSuggestions to control maximum suggestions to show in suggestions widget.EditorContribOptions.suggest.filteredTypes is now introduced to allow suggestions to be filtered by the user. For more details, please read vscode#45039.Contributions to monaco-editor:
monaco.editor.remeasureFonts) in case custom fonts are used and the editor is painted at a time when the fonts are not finished loading.renderFinalNewline, or to have a cursorSmoothCaretAnimationCompletionItem.range is now mandatory. Most times, you can use model.getWordUntilPosition() to get a good range.DefinitionLink has been renamed to LocationLink and a couple of its fields have also been renamed.Contributions to monaco-editor:
Contributions to monaco-languages:
Contributions to monaco-typescript:
marked to allow for packaging with rollup (https://github.com/Microsoft/monaco-editor/issues/1183)/esm/ distribution (https://github.com/Microsoft/monaco-editor/issues/1178)monaco.d.ts to better reflect null types.monaco.Promise API has been reduced to indicate that. We are setting up a Promise polyfill to cover browsers which do not have a native Promise implementation yet (i.e. IE11).CompletionItemProvider.provideCompletionItems and CompletionItemProvider.resolveCompletionItem have been modified to better reflect the API of VS Code. Both arguments and return type have changed.SignatureHelpProvider.provideSignatureHelp now receives an extra argument for the context.parameterHints, autoClosingBrackets, autoClosingQuotes, autoSurround, copyWithSyntaxHighlighting, tabCompletion.Contributions to monaco-editor:
Contributions to monaco-languages:
Contributions to monaco-typescript:
Contributions to monaco-json:
Contributions to monaco-css:
typescriptServices is no longer loaded on the UI thread, this helps with webpack's bundle output size.scrollBeyondLastColumn, hover, suggest, highlightActiveIndentGuide, showUnused.setTokensProvider with EncodedTokensProvider.monaco.languages.getEncodedLanguageId to get the numeric language id.DefinitionProvider.provideDefinition, ImplementationProvider.provideImplementation, TypeDefinitionProvider.provideTypeDefinition can now return a DefinitionLink.Severity.IEditor.isFocused to IEditor.hasTextFocus.ICodeEditor.onDidFocusEditor to ICodeEditor.onDidFocusEditorWidget.ICodeEditor.onDidBlurEditor to ICodeEditor.onDidBlurEditorWidget.DocumentSymbolProvider.provideDocumentSymbols must now return DocumentSymbol[].Contributions to monaco-editor:
Contributions to monaco-typescript:
file fields of relatedInformation too. (WIP) PR #21Contributions to monaco-languages:
registerFoldingRangeProvider.IModelDecorationOptions.zIndex. A decoration with greater stack order is always in front of a decoration with a lower stack order.inlineClassName which affects letter spacing. the stack order of a decoration by setting IModelDecorationOptions.inlineClassNameAffectsLetterSpacing.ITextModel.getLineLength(lineNumber: number))codeActionsOnSave, controls whether code action kinds will be run on save.codeActionsOnSaveTimeout, controls timeout for running code actions on save.multiCursorMergeOverlapping, controls if overlapping selections should be merged. Default to true.ICodeEditor.getCenteredRangeInViewport.RenameProvider.resolveRenameLocation now returns RenameLocation instead of IRange.monaco-editor-webpack-plugin - now available on npm.MarkerSeverity instead of Severity for markers serverity.RenameProvider.resolveInitialRenameValue with RenameProvider.resolveRenameLocation.monaco-typescript, renamed setMaximunWorkerIdleTime to setMaximumWorkerIdleTime.fromMarkdownString PR monaco-json#4editor.api.d.ts typingsDocumentColorProvider.MarkedString with IMarkdownString. Source code snippets can be expressed using the GH markdown syntax.IResourceEdit to ResourceTextEdit.IModel, IReadOnlyModel, IEditableTextModel, ITextModelWithMarkers, ITokenizedModel, ITextModelWithDecorations to ITextModel. A type alias for IModel is defined for compatibility.ICommonCodeEditor and ICodeEditor to ICodeEditor.ICommonDiffEditor and IDiffEditor to IDiffEditor.CompletionItem.documentation, ParameterInformation.documentation and SignatureInformation.documentation can now be an IMarkdownString.CompetionItem.command, CompletionItem.commitCharacters and CompletionItem.additionalTextEdits.folding which can define markers for code patterns where a folding regions should be created. See for example the Python configuration.ResourceFileEdit (due to how monaco.d.ts is generated from vscode). That is not honoured by the editor, and should not be used.CodeAction.provideCodeActions in CodeActionProvider now returns Command[] | Thenable<Command[]> instead of CodeAction[] | Thenable<CodeAction[]>, which is already removed.monaco.editor.getModelMarkers. Get markers for owner and/or resource..row for command palette to avoid CSS conflicts with Bootstrap.editor.minimap to disable it).editor.dragAndDrop to disable it).editor.updateOptions() no longer accepts theme; the theme can be changed via the newly introduced monaco.editor.setTheme(). Additionally, we recommend editor colors be customized via monaco.editor.defineTheme() instead of via CSS -- see sample. The color names will be stable, while the CSS class names might break at any time.IModel.findMatches to accept a list of word separators.IModelContentChangedEvent emitted via IModel.onDidChangeContent to now contain a batch of all the changes that the model had.transform: translate3d, now using will-change: transform for browser layer hinting. Use the disableLayerHinting option if you have any trouble with browser layers (blurriness or high GPU memory usage).wordWrap, wordWrapColumn and wordWrapMinified.monaco.languages.registerTypeDefinitionProvider.accessibilityHelpUrl - the url of a page to open for documentation about how to operate the editor when using a Screen Reader.find.seedSearchStringFromSelection - Ctrl+F/Cmd+F seeds search string from the editor selection.find.autoFindInSelection - Ctrl+F/Cmd+F turns on the find in selection toggle if the editor selection is multiline.minimap.enabled - enable minimap.minimap.showSlider - control when to render the minimap slider.minimap.renderCharacters - render characters or blocks in the minimap.minimap.maxColumn - maximum number of columns the minimap shows.overviewRulerBorder - toggle that the overview ruler renders a border.links - enable link detection.multiCursorModifier - change the multi cursor modifier key.accessibilitySupport - optimize the editor for use with a Screen Reader.autoIndent - automatically fix indentation when moving lines, pasting or typing.dragAndDrop - dragging and dropping editor selection within the editor.occurrencesHighlight - enable highlighting of occurences.showFoldingControls - fine-tune when the folding icons should showmatchBrackets - enable bracket matchingletterSpacing - configure font's letter-spacing.vscode which have also made their way into the monaco-editor.Intl missing.disableMonospaceOptimizations editor option that can be used in case browser zooming exposes additional issues.formatOnPaste editor option.IActionDescriptor.precondition.registerTypeDefinitionProvider to registerImplementationProvider and associated types.monaco-typescript (JS and TS language support).nextEmbedded), the state ending up in must immediately contain a nextEmbedded: "@pop" rule. This helps in quickly figuring out where the embedded mode should be left. The editor will throw an error if the Monarch grammar does not respect this condition.span node of text, and CSS rules would match token types and assign styling to them (i.e. color, boldness, etc.to style tokens)monaco.editor.defineTheme() and the playground contains a sample showing how that works.F1 > Developer: Inspect tokens. This will bring up a widget showing the token type and the applied styles.monaco.editor.onDidCreateEditor that will be fired whenever an editor is created (will fire even for a diff editor, with the two editors that a diff editor consists of).monaco.editor.tokenize that returns logical tokens (before theme matching, as opposed to monaco.editor.colorize).monaco.languages.registerTypeDefinitionProviderIModel.getMode().IModelLanguageChangedEvent, IModelDecorationsChangedEvent and IModelTokensChangedEvent;IModel.findMatches, IModel.findNextMatch and IModel.findPreviousMatch to be able to capture matches while searching.ICodeEditor.addAction and IDiffEditor.addAction now return an IDisposable to be able to remove a previously added action.ICodeEditor.onDidChangeModelMode to ICodeEditor.onDidChangeModelLanguage;ICodeEditor.executeEdits can now take resulting selection for better undo/redo stack management;ICodeEditor.getTargetAtClientPoint(clientX, clientY) to be able to do hit testing.IViewZone.marginDomNode to be able to insert a dom node in the margin side of a view zone.lineDecorationsWidth can now take a value in the form of "1.2ch" besides the previous accepted number (in px)renderLineHighlight can now take a value in the set 'none' | 'gutter' | 'line' | 'all'.fixedOverflowWidgets to render overflowing content widgets as 'fixed' (defaults to false)acceptSuggestionOnCommitCharacter to accept suggestions on provider defined characters (defaults to true)emptySelectionClipboard - copying without a selection copies the current line (defaults to true)suggestFontSize - the font size for the suggest widgetsuggestLineHeight - the line height for the suggest widgetrenderIndicators - Render +/- indicators for added/deleted changes. (defaults to true)monaco.d.ts).editor.addAction() and have the action show in the context menu.lineNumbers: 'on' | 'off' | 'relative'renderWhitespace: 'none' | 'boundary' | 'all'model.setMode(), as IMode will soon disappear from the API.monaco-editor-core:
monaco-editor-core is now finally language agnostic.monaco-languages.monaco-html.monaco-editor-core, we could improve the bundling and reduce the number of .js files we ship.editor.addCommand was no longer working.monaco.d.ts is generated by TypeScript 1.8.javascript and typescript language services:
extraLibs.css, less, scss and json language services.mouseWheelZoom, wordWrap, snippetSuggestions, tabCompletion, wordBasedSuggestions, renderControlCharacters, renderLineHighlight, fontWeight.tabFocusMode, outlineMarkers.indentGuides -> renderIndentGuides, referenceInfos -> codeLenseditor.pushUndoStop() to explicitly push an undo stopsuppressMouseDown to IContentWidgetresolveLink to ILinkProviderenablement, contextMenuGroupId from IActionDescriptormonaco.editor.createWebWorker now loads the AMD module and calls create and passes in as first argument a context of type monaco.worker.IWorkerContext and as second argument the initData. This breaking change was needed to allow handling the case of misconfigured web workers (running on a file protocol or the cross-domain case)CodeActionProvider.provideCodeActions now gets passed in a CodeActionContext that contains the markers at the relevant range.hoverMessage of a decoration is now a MarkedString | MarkedString[]contents of a Hover returned by a HoverProvider is now a MarkedString | MarkedString[]IEditor.onDidChangeModelRawContent, IModel.onDidChangeRawContentfile:// or misconfigured cross-domain loading) now load the web worker code in the UI thread. This caused a breaking change in the behaviour of monaco.editor.createWebWorkerposition:fixed element.