From 3afc60f1ac37a0e630453246b2fc43132a656932 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 10 Dec 2021 22:58:25 +0100 Subject: [PATCH] Add changelog entry for 0.31.0 --- CHANGELOG.md | 21 +++++++ MAINTAINING.md | 49 +++------------ package-lock.json | 6 +- package.json | 2 +- website/playground/monaco.d.ts.txt | 97 +++++++++++++++++++++--------- website/typedoc/monaco.d.ts | 97 +++++++++++++++++++++--------- 6 files changed, 171 insertions(+), 101 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb39135..2ddd64ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Monaco Editor Changelog +## [0.31.0] (10.12.2021) + +- adds support for [highlighting non basic ASCII, invisible or ambiguous unicode characters](https://code.visualstudio.com/updates/v1_63#_unicode-highlighting). +- adds support for setting an editor banner +- streaming hover results in case of multiple hover providers +- fixes multiple IME issues + +### Thank you + +- [@activeguild (j1ngzoue)](https://github.com/activeguild): Add 'browser-ems-vite-react' sample [PR #2767](https://github.com/microsoft/monaco-editor/pull/2767) +- [@emojiiii (C.Y.Kun)](https://github.com/emojiiii): Fix some errors on the website playground [PR #2779](https://github.com/microsoft/monaco-editor/pull/2779) +- [@gitpaladin (Chen Minglong)](https://github.com/gitpaladin): Fix token while missing `syntax=` directive [PR #2809](https://github.com/microsoft/monaco-editor/pull/2809) +- [@jonatanklosko (Jonatan Kłosko)](https://github.com/jonatanklosko): Update Elixir tokenization of sigil modifiers [PR #2806](https://github.com/microsoft/monaco-editor/pull/2806) +- [@MasterOdin (Matthew Peveler)](https://github.com/MasterOdin) + - Update builtin functions for mysql [PR #2749](https://github.com/microsoft/monaco-editor/pull/2749) + - Update list of keywords for redshift [PR #2757](https://github.com/microsoft/monaco-editor/pull/2757) + - Remove return from example addAction [PR #2772](https://github.com/microsoft/monaco-editor/pull/2772) +- [@milahu](https://github.com/milahu): fix link to monaco.d.ts [PR #2769](https://github.com/microsoft/monaco-editor/pull/2769) +- [@Pranomvignesh (Pranom Vignesh)](https://github.com/Pranomvignesh): Semantic Tokens Provider Sample is broken in docs [PR #2764](https://github.com/microsoft/monaco-editor/pull/2764) +- [@rramo012 (Rafael Ramos)](https://github.com/rramo012): Fixing the documentation links [PR #2748](https://github.com/microsoft/monaco-editor/pull/2748) + ## [0.30.1] (09.11.2021) - Fixes [a performance regression where all languages would be loaded when loading the first language](https://github.com/microsoft/monaco-editor/issues/2750). diff --git a/MAINTAINING.md b/MAINTAINING.md index 04bcffb5..ff93770f 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -11,45 +11,16 @@ ## Shipping a new monaco-editor npm module -#### 0. - -- make sure you have `https://github.com/microsoft/vscode-loc` checked out next to the `vscode` folder. - -#### 1. Ship a new `monaco-editor-core` npm module - -- bump version in `/src/vscode/build/monaco/package.json` -- **[important]** push all local changes to the remote to get a good public commit id. -- generate npm package `/src/vscode> yarn gulp editor-distro` -- publish npm package `/src/vscode/out-monaco-editor-core> npm publish` - -#### 2. Adopt new `monaco-editor-core` version - -- edit `/src/monaco-editor/package.json` and update the version of [`monaco-editor-core`](https://www.npmjs.com/package/monaco-editor-core) - -```sh -# fetch latest deps -/src/monaco-editor> npm install . -``` - -#### 4. Generate and try out the local release - -- run the editor smoketest via CI or [manually](#running-the-editor-tests). - -#### 5. Update release note. - -- API Changes / Breaking Changes / New and noteworthy -- Thank you ([use this tool](https://vscode-tools.azurewebsites.net/)) - -#### 6. Publish - -- `/src/monaco-editor> npm version minor` -- `/src/monaco-editor> npm run release` -- `/src/monaco-editor/release> npm publish` -- `/src/monaco-editor> git push origin v0.50.0` - -#### 7. Update Website - -- `/src/monaco-editor> npm run website` +- update `package.json` and bump `"version"` as necessary +- update `package.json` and edit `"vscode"` to point to the vscode repo commit that should be shipped at `monaco-editor-core` (both `monaco-editor-core` and `monaco-editor` will be published under the same version defined in `package.json`). +- trigger a build using [`Publish to npm`](https://github.com/microsoft/monaco-editor/actions/workflows/publish.yml) and type false when asked "is nightly?" +- if the publish succeeded, run `git tag 0.x.y` and `git push origin 0.x.y` +- edit `package.json` and update the `"monaco-editor-core"` dev dependency. +- run `npm install` +- run `npm run release` +- write entry in `CHANGELOG.md` + - API Changes / Breaking Changes / New and noteworthy + - Thank you ([use this tool](https://vscode-tools.azurewebsites.net/acknowledgement/)) #### 8. Publish new webpack plugin diff --git a/package-lock.json b/package-lock.json index 42f9dedc..876b5a0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1159,9 +1159,9 @@ } }, "monaco-editor-core": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.30.1.tgz", - "integrity": "sha512-WNxfchYafMZXVfysqg/ESW4MtOpYLPaIKrzudNlgwYvfYID+O/nwSZI5X+KxW84roVzHsNgFGyOOesfHFZwYUA==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.31.0.tgz", + "integrity": "sha512-7LmacXy6p+kwVoLZu64GLPaM/eg/f4IJoaaJK+X3r5n0yDBxPtHgjVwPvjdgwC1/1RnEiuSlFkPFyvBHugB1Nw==", "dev": true }, "mri": { diff --git a/package.json b/package.json index ab475f21..c8bdc49a 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "jsdom": "^18.1.0", "jsonc-parser": "^3.0.0", "mocha": "^9.1.3", - "monaco-editor-core": "0.30.1", + "monaco-editor-core": "0.31.0", "playwright": "^1.16.3", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", diff --git a/website/playground/monaco.d.ts.txt b/website/playground/monaco.d.ts.txt index 02f42a34..b09b1a34 100644 --- a/website/playground/monaco.d.ts.txt +++ b/website/playground/monaco.d.ts.txt @@ -807,6 +807,10 @@ declare namespace monaco { * Get the position at `positionLineNumber` and `positionColumn`. */ getPosition(): Position; + /** + * Get the position at the start of the selection. + */ + getSelectionStart(): Position; /** * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. */ @@ -815,6 +819,10 @@ declare namespace monaco { * Create a `Selection` from one or two positions */ static fromPositions(start: IPosition, end?: IPosition): Selection; + /** + * Creates a `Selection` from a range, given a direction. + */ + static fromRange(range: Range, direction: SelectionDirection): Selection; /** * Create a `Selection` from an `ISelection`. */ @@ -1804,7 +1812,7 @@ declare namespace monaco.editor { */ getLineLastNonWhitespaceColumn(lineNumber: number): number; /** - * Create a valid position, + * Create a valid position. */ validatePosition(position: IPosition): Position; /** @@ -1839,7 +1847,7 @@ declare namespace monaco.editor { */ getPositionAt(offset: number): Position; /** - * Get a range covering the entire model + * Get a range covering the entire model. */ getFullModelRange(): Range; /** @@ -2954,12 +2962,10 @@ declare namespace monaco.editor { wrappingStrategy?: 'simple' | 'advanced'; /** * Configure word wrapping characters. A break will be introduced before these characters. - * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. */ wordWrapBreakBeforeCharacters?: string; /** * Configure word wrapping characters. A break will be introduced after these characters. - * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. */ wordWrapBreakAfterCharacters?: string; /** @@ -3298,6 +3304,7 @@ declare namespace monaco.editor { * Controls the behavior of editor guides. */ guides?: IGuidesOptions; + unicodeHighlight?: IUnicodeHighlightOptions; } export interface IDiffEditorBaseOptions { @@ -3376,6 +3383,16 @@ declare namespace monaco.editor { readonly id: K1; readonly name: string; defaultValue: V; + /** + * Might modify `value`. + */ + applyUpdate(value: V, update: V): ApplyUpdateResult; + } + + export class ApplyUpdateResult { + readonly newValue: T; + readonly didChange: boolean; + constructor(newValue: T, didChange: boolean); } /** @@ -3861,6 +3878,22 @@ declare namespace monaco.editor { readonly scrollByPage: boolean; } + export type InUntrustedWorkspace = 'inUntrustedWorkspace'; + + /** + * Configuration options for unicode highlighting. + */ + export interface IUnicodeHighlightOptions { + nonBasicASCII?: boolean | InUntrustedWorkspace; + invisibleCharacters?: boolean; + ambiguousCharacters?: boolean; + includeComments?: boolean | InUntrustedWorkspace; + /** + * A map of allowed characters (true: allowed). + */ + allowedCharacters?: Record; + } + export interface IInlineSuggestOptions { /** * Enable or disable the rendering of automatic inline completions. @@ -4215,25 +4248,26 @@ declare namespace monaco.editor { suggestSelection = 109, tabCompletion = 110, tabIndex = 111, - unusualLineTerminators = 112, - useShadowDOM = 113, - useTabStops = 114, - wordSeparators = 115, - wordWrap = 116, - wordWrapBreakAfterCharacters = 117, - wordWrapBreakBeforeCharacters = 118, - wordWrapColumn = 119, - wordWrapOverride1 = 120, - wordWrapOverride2 = 121, - wrappingIndent = 122, - wrappingStrategy = 123, - showDeprecated = 124, - inlayHints = 125, - editorClassName = 126, - pixelRatio = 127, - tabFocusMode = 128, - layoutInfo = 129, - wrappingInfo = 130 + unicodeHighlighting = 112, + unusualLineTerminators = 113, + useShadowDOM = 114, + useTabStops = 115, + wordSeparators = 116, + wordWrap = 117, + wordWrapBreakAfterCharacters = 118, + wordWrapBreakBeforeCharacters = 119, + wordWrapColumn = 120, + wordWrapOverride1 = 121, + wordWrapOverride2 = 122, + wrappingIndent = 123, + wrappingStrategy = 124, + showDeprecated = 125, + inlayHints = 126, + editorClassName = 127, + pixelRatio = 128, + tabFocusMode = 129, + layoutInfo = 130, + wrappingInfo = 131 } export const EditorOptions: { @@ -4351,6 +4385,7 @@ declare namespace monaco.editor { suggestSelection: IEditorOption; tabCompletion: IEditorOption; tabIndex: IEditorOption; + unicodeHighlight: IEditorOption>>; unusualLineTerminators: IEditorOption; useShadowDOM: IEditorOption; useTabStops: IEditorOption; @@ -5097,6 +5132,7 @@ declare namespace monaco.editor { * Apply the same font settings as the editor to `target`. */ applyFontInfo(target: HTMLElement): void; + setBanner(bannerDomNode: HTMLElement | null, height: number): void; } /** @@ -5822,6 +5858,11 @@ declare namespace monaco.languages { InsertAsSnippet = 4 } + export interface CompletionItemRanges { + insert: IRange; + replace: IRange; + } + /** * A completion item represents a text snippet that is * proposed to complete text that is being typed. @@ -5873,11 +5914,10 @@ declare namespace monaco.languages { /** * A string or snippet that should be inserted in a document when selecting * this completion. - * is used. */ insertText: string; /** - * Addition rules (as bitmask) that should be applied when inserting + * Additional rules (as bitmask) that should be applied when inserting * this completion. */ insertTextRules?: CompletionItemInsertTextRule; @@ -5890,10 +5930,7 @@ declare namespace monaco.languages { * *Note:* The range must be a {@link Range.isSingleLine single line} and it must * {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. */ - range: IRange | { - insert: IRange; - replace: IRange; - }; + range: IRange | CompletionItemRanges; /** * An optional set of characters that when pressed while this completion is active will accept it first and * then type that character. *Note* that all commit characters should have `length=1` and that superfluous @@ -5997,6 +6034,8 @@ declare namespace monaco.languages { export interface SelectedSuggestionInfo { range: IRange; text: string; + isSnippetText: boolean; + completionKind: CompletionItemKind; } export interface InlineCompletion { diff --git a/website/typedoc/monaco.d.ts b/website/typedoc/monaco.d.ts index 02f42a34..b09b1a34 100644 --- a/website/typedoc/monaco.d.ts +++ b/website/typedoc/monaco.d.ts @@ -807,6 +807,10 @@ declare namespace monaco { * Get the position at `positionLineNumber` and `positionColumn`. */ getPosition(): Position; + /** + * Get the position at the start of the selection. + */ + getSelectionStart(): Position; /** * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. */ @@ -815,6 +819,10 @@ declare namespace monaco { * Create a `Selection` from one or two positions */ static fromPositions(start: IPosition, end?: IPosition): Selection; + /** + * Creates a `Selection` from a range, given a direction. + */ + static fromRange(range: Range, direction: SelectionDirection): Selection; /** * Create a `Selection` from an `ISelection`. */ @@ -1804,7 +1812,7 @@ declare namespace monaco.editor { */ getLineLastNonWhitespaceColumn(lineNumber: number): number; /** - * Create a valid position, + * Create a valid position. */ validatePosition(position: IPosition): Position; /** @@ -1839,7 +1847,7 @@ declare namespace monaco.editor { */ getPositionAt(offset: number): Position; /** - * Get a range covering the entire model + * Get a range covering the entire model. */ getFullModelRange(): Range; /** @@ -2954,12 +2962,10 @@ declare namespace monaco.editor { wrappingStrategy?: 'simple' | 'advanced'; /** * Configure word wrapping characters. A break will be introduced before these characters. - * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. */ wordWrapBreakBeforeCharacters?: string; /** * Configure word wrapping characters. A break will be introduced after these characters. - * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. */ wordWrapBreakAfterCharacters?: string; /** @@ -3298,6 +3304,7 @@ declare namespace monaco.editor { * Controls the behavior of editor guides. */ guides?: IGuidesOptions; + unicodeHighlight?: IUnicodeHighlightOptions; } export interface IDiffEditorBaseOptions { @@ -3376,6 +3383,16 @@ declare namespace monaco.editor { readonly id: K1; readonly name: string; defaultValue: V; + /** + * Might modify `value`. + */ + applyUpdate(value: V, update: V): ApplyUpdateResult; + } + + export class ApplyUpdateResult { + readonly newValue: T; + readonly didChange: boolean; + constructor(newValue: T, didChange: boolean); } /** @@ -3861,6 +3878,22 @@ declare namespace monaco.editor { readonly scrollByPage: boolean; } + export type InUntrustedWorkspace = 'inUntrustedWorkspace'; + + /** + * Configuration options for unicode highlighting. + */ + export interface IUnicodeHighlightOptions { + nonBasicASCII?: boolean | InUntrustedWorkspace; + invisibleCharacters?: boolean; + ambiguousCharacters?: boolean; + includeComments?: boolean | InUntrustedWorkspace; + /** + * A map of allowed characters (true: allowed). + */ + allowedCharacters?: Record; + } + export interface IInlineSuggestOptions { /** * Enable or disable the rendering of automatic inline completions. @@ -4215,25 +4248,26 @@ declare namespace monaco.editor { suggestSelection = 109, tabCompletion = 110, tabIndex = 111, - unusualLineTerminators = 112, - useShadowDOM = 113, - useTabStops = 114, - wordSeparators = 115, - wordWrap = 116, - wordWrapBreakAfterCharacters = 117, - wordWrapBreakBeforeCharacters = 118, - wordWrapColumn = 119, - wordWrapOverride1 = 120, - wordWrapOverride2 = 121, - wrappingIndent = 122, - wrappingStrategy = 123, - showDeprecated = 124, - inlayHints = 125, - editorClassName = 126, - pixelRatio = 127, - tabFocusMode = 128, - layoutInfo = 129, - wrappingInfo = 130 + unicodeHighlighting = 112, + unusualLineTerminators = 113, + useShadowDOM = 114, + useTabStops = 115, + wordSeparators = 116, + wordWrap = 117, + wordWrapBreakAfterCharacters = 118, + wordWrapBreakBeforeCharacters = 119, + wordWrapColumn = 120, + wordWrapOverride1 = 121, + wordWrapOverride2 = 122, + wrappingIndent = 123, + wrappingStrategy = 124, + showDeprecated = 125, + inlayHints = 126, + editorClassName = 127, + pixelRatio = 128, + tabFocusMode = 129, + layoutInfo = 130, + wrappingInfo = 131 } export const EditorOptions: { @@ -4351,6 +4385,7 @@ declare namespace monaco.editor { suggestSelection: IEditorOption; tabCompletion: IEditorOption; tabIndex: IEditorOption; + unicodeHighlight: IEditorOption>>; unusualLineTerminators: IEditorOption; useShadowDOM: IEditorOption; useTabStops: IEditorOption; @@ -5097,6 +5132,7 @@ declare namespace monaco.editor { * Apply the same font settings as the editor to `target`. */ applyFontInfo(target: HTMLElement): void; + setBanner(bannerDomNode: HTMLElement | null, height: number): void; } /** @@ -5822,6 +5858,11 @@ declare namespace monaco.languages { InsertAsSnippet = 4 } + export interface CompletionItemRanges { + insert: IRange; + replace: IRange; + } + /** * A completion item represents a text snippet that is * proposed to complete text that is being typed. @@ -5873,11 +5914,10 @@ declare namespace monaco.languages { /** * A string or snippet that should be inserted in a document when selecting * this completion. - * is used. */ insertText: string; /** - * Addition rules (as bitmask) that should be applied when inserting + * Additional rules (as bitmask) that should be applied when inserting * this completion. */ insertTextRules?: CompletionItemInsertTextRule; @@ -5890,10 +5930,7 @@ declare namespace monaco.languages { * *Note:* The range must be a {@link Range.isSingleLine single line} and it must * {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}. */ - range: IRange | { - insert: IRange; - replace: IRange; - }; + range: IRange | CompletionItemRanges; /** * An optional set of characters that when pressed while this completion is active will accept it first and * then type that character. *Note* that all commit characters should have `length=1` and that superfluous @@ -5997,6 +6034,8 @@ declare namespace monaco.languages { export interface SelectedSuggestionInfo { range: IRange; text: string; + isSnippetText: boolean; + completionKind: CompletionItemKind; } export interface InlineCompletion {