From 858b03fd8a29ba565a2327806a9c7e0dc9533481 Mon Sep 17 00:00:00 2001 From: tamayika Date: Thu, 6 Apr 2023 17:36:52 +0900 Subject: [PATCH 01/22] Change JSON symbol information to document symbol --- src/language/common/lspLanguageFeatures.ts | 45 ++++++++++++++++------ src/language/json/jsonWorker.ts | 4 +- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/language/common/lspLanguageFeatures.ts b/src/language/common/lspLanguageFeatures.ts index 48982daf..7197a2d2 100644 --- a/src/language/common/lspLanguageFeatures.ts +++ b/src/language/common/lspLanguageFeatures.ts @@ -651,7 +651,7 @@ function toWorkspaceEdit(edit: lsTypes.WorkspaceEdit | null): languages.Workspac //#region DocumentSymbolAdapter export interface ILanguageWorkerWithDocumentSymbols { - findDocumentSymbols(uri: string): Promise; + findDocumentSymbols(uri: string): Promise; } export class DocumentSymbolAdapter @@ -671,25 +671,48 @@ export class DocumentSymbolAdapter if (!items) { return; } - return items.map((item) => ({ - name: item.name, - detail: '', - containerName: item.containerName, - kind: toSymbolKind(item.kind), - range: toRange(item.location.range), - selectionRange: toRange(item.location.range), - tags: [] - })); + return items.map((item) => { + if (isDocumentSymbol(item)) { + return toDocumentSymbol(item); + } + return { + name: item.name, + detail: '', + containerName: item.containerName, + kind: toSymbolKind(item.kind), + range: toRange(item.location.range), + selectionRange: toRange(item.location.range), + tags: [] + }; + }); }); } } +function isDocumentSymbol( + symbol: lsTypes.SymbolInformation | lsTypes.DocumentSymbol +): symbol is lsTypes.DocumentSymbol { + return 'children' in symbol; +} + +function toDocumentSymbol(symbol: lsTypes.DocumentSymbol): languages.DocumentSymbol { + return { + name: symbol.name, + detail: symbol.detail ?? '', + kind: toSymbolKind(symbol.kind), + range: toRange(symbol.range), + selectionRange: toRange(symbol.selectionRange), + tags: symbol.tags ?? [], + children: (symbol.children ?? []).map((item) => toDocumentSymbol(item)) + }; +} + function toSymbolKind(kind: lsTypes.SymbolKind): languages.SymbolKind { let mKind = languages.SymbolKind; switch (kind) { case lsTypes.SymbolKind.File: - return mKind.Array; + return mKind.File; case lsTypes.SymbolKind.Module: return mKind.Module; case lsTypes.SymbolKind.Namespace: diff --git a/src/language/json/jsonWorker.ts b/src/language/json/jsonWorker.ts index d18a83de..9487161e 100644 --- a/src/language/json/jsonWorker.ts +++ b/src/language/json/jsonWorker.ts @@ -82,13 +82,13 @@ export class JSONWorker { async resetSchema(uri: string): Promise { return Promise.resolve(this._languageService.resetSchema(uri)); } - async findDocumentSymbols(uri: string): Promise { + async findDocumentSymbols(uri: string): Promise { let document = this._getTextDocument(uri); if (!document) { return []; } let jsonDocument = this._languageService.parseJSONDocument(document); - let symbols = this._languageService.findDocumentSymbols(document, jsonDocument); + let symbols = this._languageService.findDocumentSymbols2(document, jsonDocument); return Promise.resolve(symbols); } async findDocumentColors(uri: string): Promise { From 12ff2914286ecbe8b7842f684e49e1ade36bec00 Mon Sep 17 00:00:00 2001 From: dmkokovtsev Date: Sat, 7 Oct 2023 22:42:05 +0300 Subject: [PATCH 02/22] fix: enable markdown in completion details --- src/language/json/jsonWorker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/language/json/jsonWorker.ts b/src/language/json/jsonWorker.ts index d18a83de..c8f0cf88 100644 --- a/src/language/json/jsonWorker.ts +++ b/src/language/json/jsonWorker.ts @@ -32,7 +32,10 @@ export class JSONWorker { return resolvePath(base, relativePath); } }, - schemaRequestService: createData.enableSchemaRequest ? defaultSchemaRequestService : undefined + schemaRequestService: createData.enableSchemaRequest + ? defaultSchemaRequestService + : undefined, + clientCapabilities: jsonService.ClientCapabilities.LATEST }); this._languageService.configure(this._languageSettings); } From d200c7147a107264034ae93eaeac7ea01db45561 Mon Sep 17 00:00:00 2001 From: Soof Golan <83900570+soof-golan@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:27:27 +0300 Subject: [PATCH 03/22] feat: add Python 3.12 keyword --- src/basic-languages/python/python.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic-languages/python/python.ts b/src/basic-languages/python/python.ts index 5aa542ec..c9d43a46 100644 --- a/src/basic-languages/python/python.ts +++ b/src/basic-languages/python/python.ts @@ -93,6 +93,7 @@ export const language = { 'raise', 'return', 'try', + 'type', // new in Python 3.12 'while', 'with', 'yield', From fb9789818623ca9ca390f99a372e1fc98612a2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20S=C3=B6derlund?= Date: Sun, 5 Nov 2023 17:04:24 +0100 Subject: [PATCH 04/22] chore(docs): fix monaco.d.ts link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eee79f77..8c3d8ff2 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Many Monaco related objects often implement the `.dispose()` method. This method - [Integrate the AMD version](./docs/integrate-amd.md). - [Integrate the ESM version](./docs/integrate-esm.md) - Learn how to use the editor API and try out your own customizations in the [playground](https://microsoft.github.io/monaco-editor/playground.html). -- Explore the [API docs](https://microsoft.github.io/monaco-editor/docs.html) or read them straight from [`monaco.d.ts`](https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/monaco.d.ts). +- Explore the [API docs](https://microsoft.github.io/monaco-editor/docs.html) or read them straight from [`monaco.d.ts`](https://github.com/microsoft/monaco-editor/blob/gh-pages/node_modules/monaco-editor/monaco.d.ts). - Read [this guide](https://github.com/microsoft/monaco-editor/wiki/Accessibility-Guide-for-Integrators) to ensure the editor is accessible to all your users! - Create a Monarch tokenizer for a new programming language [in the Monarch playground](https://microsoft.github.io/monaco-editor/monarch.html). - Ask questions on [StackOverflow](https://stackoverflow.com/questions/tagged/monaco-editor)! Search open and closed issues, there are a lot of tips in there! From 091550e89857bd926d2b66e100dc3c2094475783 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 10 Nov 2023 12:42:11 +0100 Subject: [PATCH 05/22] Fixes nightly CI --- test/unit/setup.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/unit/setup.js b/test/unit/setup.js index 13a598eb..f06bf323 100644 --- a/test/unit/setup.js +++ b/test/unit/setup.js @@ -10,6 +10,9 @@ define('vs/nls', [], { localize: function () { return 'NO_LOCALIZATION_FOR_YOU'; }, + localize2: function () { + return 'NO_LOCALIZATION_FOR_YOU'; + }, getConfiguredDefaultLocale: function () { return undefined; } From aafca45ff97ec008262ab01a8d5aebd264b7d200 Mon Sep 17 00:00:00 2001 From: Ofek Shilon Date: Sun, 12 Nov 2023 20:08:59 +0200 Subject: [PATCH 06/22] Wording fix --- website/static/monarch-static.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/static/monarch-static.html b/website/static/monarch-static.html index fa1329d6..9fe56172 100644 --- a/website/static/monarch-static.html +++ b/website/static/monarch-static.html @@ -380,7 +380,7 @@ meta .[content]bracket - attribute is set such that the editor is + attribute is set such that the editor matches the braces (and does auto indentation). For example:

From d38b3853824290f376cffaf46b05abf2fa575d90 Mon Sep 17 00:00:00 2001
From: Ofek Shilon 
Date: Sun, 12 Nov 2023 20:13:57 +0200
Subject: [PATCH 07/22] Remove 2 java-only operators from c++ tokenizer

---
 src/basic-languages/cpp/cpp.ts | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/basic-languages/cpp/cpp.ts b/src/basic-languages/cpp/cpp.ts
index e1cc31a7..2dccc8f9 100644
--- a/src/basic-languages/cpp/cpp.ts
+++ b/src/basic-languages/cpp/cpp.ts
@@ -259,7 +259,6 @@ export const language = {
 		'%',
 		'<<',
 		'>>',
-		'>>>',
 		'+=',
 		'-=',
 		'*=',
@@ -269,8 +268,7 @@ export const language = {
 		'^=',
 		'%=',
 		'<<=',
-		'>>=',
-		'>>>='
+		'>>='
 	],
 
 	// we include these common regular expressions

From d5a1a09eba3ea927028d994dc72450a5f57ca2dc Mon Sep 17 00:00:00 2001
From: Ofek Shilon 
Date: Sun, 12 Nov 2023 20:24:31 +0200
Subject: [PATCH 08/22] Fix #4253

---
 src/basic-languages/cpp/cpp.ts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/basic-languages/cpp/cpp.ts b/src/basic-languages/cpp/cpp.ts
index e1cc31a7..290df215 100644
--- a/src/basic-languages/cpp/cpp.ts
+++ b/src/basic-languages/cpp/cpp.ts
@@ -312,8 +312,7 @@ export const language = {
 			// [[ attributes ]].
 			[/\[\s*\[/, { token: 'annotation', next: '@annotation' }],
 			// delimiters and operators
-			[/[{}()\[\]]/, '@brackets'],
-			[/[<>](?!@symbols)/, '@brackets'],
+			[/[{}()<>\[\]]/, '@brackets'],
 			[
 				/@symbols/,
 				{

From 5e5af013f8d295555a7210df0d5f2cea0bf5dd56 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Thu, 7 Dec 2023 15:14:51 +0100
Subject: [PATCH 09/22] v0.45.0

---
 CHANGELOG.md      | 14 ++++++++++++++
 package-lock.json | 18 +++++++++---------
 package.json      |  6 +++---
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b6d5fac..02fdf901 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
 # Monaco Editor Changelog
 
+## [0.45.0]
+
+### Breaking Changes
+
+- `wordBasedSuggestions: boolean` -> `'off' | 'currentDocument' | 'matchingDocuments' | 'allDocuments'`
+- `occurrencesHighlight: boolean` -> `'off' | 'singleFile' | 'multiFile'`
+
+### Additions
+
+- Many bug fixes
+- `IEditorScrollbarOptions.ignoreHorizontalScrollbarInContentHeight`
+- `IDiffEditor.goToDiff`
+- `IDiffEditor.revealFirstDiff`
+
 ## [0.44.0]
 
 - Removes old diff editor implementation.
diff --git a/package-lock.json b/package-lock.json
index 003b2cc2..2a4b3938 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
 	"name": "monaco-editor",
-	"version": "0.44.0",
+	"version": "0.45.0",
 	"lockfileVersion": 2,
 	"requires": true,
 	"packages": {
 		"": {
 			"name": "monaco-editor",
-			"version": "0.44.0",
+			"version": "0.45.0",
 			"hasInstallScript": true,
 			"license": "MIT",
 			"devDependencies": {
@@ -25,7 +25,7 @@
 				"jsdom": "^19.0.0",
 				"jsonc-parser": "^3.0.0",
 				"mocha": "^9.2.0",
-				"monaco-editor-core": "0.44.0-rc1",
+				"monaco-editor-core": "0.45.0-rc",
 				"parcel": "^2.7.0",
 				"pin-github-action": "^1.8.0",
 				"playwright": "^1.32.2",
@@ -5337,9 +5337,9 @@
 			"dev": true
 		},
 		"node_modules/monaco-editor-core": {
-			"version": "0.44.0-rc1",
-			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.44.0-rc1.tgz",
-			"integrity": "sha512-7dSz2GkAZO4tr0RgbLvjpRKzCamKxHm9yRCaPL+XA90HKEdrKv3uX30BwYq5rji8yuS62YuvcaaPaXEfULZbaA==",
+			"version": "0.45.0-rc",
+			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.45.0-rc.tgz",
+			"integrity": "sha512-iNh84qarOK8KhJNaxitm+07m9sCCoF4OxQXDOru1pOSPNFGpMEOV/35agYm9ab9RAm2CPGGHz27eJUY1FY0iKg==",
 			"dev": true
 		},
 		"node_modules/mri": {
@@ -11069,9 +11069,9 @@
 			}
 		},
 		"monaco-editor-core": {
-			"version": "0.44.0-rc1",
-			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.44.0-rc1.tgz",
-			"integrity": "sha512-7dSz2GkAZO4tr0RgbLvjpRKzCamKxHm9yRCaPL+XA90HKEdrKv3uX30BwYq5rji8yuS62YuvcaaPaXEfULZbaA==",
+			"version": "0.45.0-rc",
+			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.45.0-rc.tgz",
+			"integrity": "sha512-iNh84qarOK8KhJNaxitm+07m9sCCoF4OxQXDOru1pOSPNFGpMEOV/35agYm9ab9RAm2CPGGHz27eJUY1FY0iKg==",
 			"dev": true
 		},
 		"mri": {
diff --git a/package.json b/package.json
index 3039223e..9f54e019 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
 	"name": "monaco-editor",
-	"version": "0.44.0",
-	"vscodeRef": "e7e037083ff4455cf320e344325dacb480062c3c",
+	"version": "0.45.0",
+	"vscodeRef": "af28b32d7e553898b2a91af498b1fb666fdebe0c",
 	"private": true,
 	"description": "A browser based code editor",
 	"homepage": "https://github.com/microsoft/monaco-editor",
@@ -52,7 +52,7 @@
 		"jsdom": "^19.0.0",
 		"jsonc-parser": "^3.0.0",
 		"mocha": "^9.2.0",
-		"monaco-editor-core": "0.44.0-rc1",
+		"monaco-editor-core": "0.45.0-rc",
 		"parcel": "^2.7.0",
 		"pin-github-action": "^1.8.0",
 		"playwright": "^1.32.2",

From 99622db664d9a483bc9cdbf926fb08950597cf07 Mon Sep 17 00:00:00 2001
From: Aiday Marlen Kyzy 
Date: Thu, 14 Dec 2023 17:50:27 +0100
Subject: [PATCH 10/22] changing the range of the color

---
 .../color-provider-example/sample.js                 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js b/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js
index 5f6aa8ca..3d8db248 100644
--- a/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js
+++ b/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js
@@ -43,27 +43,27 @@ monaco.languages.registerColorProvider("colorLanguage", {
 				color: { red: 1, blue: 0, green: 0, alpha: 1 },
 				range: {
 					startLineNumber: 1,
-					startColumn: 0,
+					startColumn: 1,
 					endLineNumber: 1,
-					endColumn: 0,
+					endColumn: 4,
 				},
 			},
 			{
 				color: { red: 0, blue: 1, green: 0, alpha: 1 },
 				range: {
 					startLineNumber: 2,
-					startColumn: 0,
+					startColumn: 1,
 					endLineNumber: 2,
-					endColumn: 0,
+					endColumn: 5,
 				},
 			},
 			{
 				color: { red: 0, blue: 0, green: 1, alpha: 1 },
 				range: {
 					startLineNumber: 3,
-					startColumn: 0,
+					startColumn: 1,
 					endLineNumber: 3,
-					endColumn: 0,
+					endColumn: 6,
 				},
 			},
 		];

From 8d1525eb6d7cdc4b23909597c54347d47242fa9e Mon Sep 17 00:00:00 2001
From: DavidMulder0 
Date: Thu, 11 May 2023 08:37:40 +0000
Subject: [PATCH 11/22] Expose JSON worker

Fix #727
---
 src/language/json/jsonMode.ts            | 16 +++++++++++++---
 src/language/json/jsonWorker.ts          | 16 ++++++++++++++++
 src/language/json/monaco.contribution.ts |  9 +++++++--
 3 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/language/json/jsonMode.ts b/src/language/json/jsonMode.ts
index 2133e848..d1345b2d 100644
--- a/src/language/json/jsonMode.ts
+++ b/src/language/json/jsonMode.ts
@@ -10,6 +10,18 @@ import * as languageFeatures from '../common/lspLanguageFeatures';
 import { createTokenizationSupport } from './tokenization';
 import { Uri, IDisposable, languages, editor } from '../../fillers/monaco-editor-core';
 
+let worker: languageFeatures.WorkerAccessor;
+
+export function getWorker(): Promise<(...uris: Uri[]) => Promise> {
+	return new Promise((resolve, reject) => {
+		if (!worker) {
+			return reject('JSON not registered!');
+		}
+
+		resolve(worker);
+	});
+}
+
 class JSONDiagnosticsAdapter extends languageFeatures.DiagnosticsAdapter {
 	constructor(
 		languageId: string,
@@ -44,9 +56,7 @@ export function setupMode(defaults: LanguageServiceDefaults): IDisposable {
 	const client = new WorkerManager(defaults);
 	disposables.push(client);
 
-	const worker: languageFeatures.WorkerAccessor = (
-		...uris: Uri[]
-	): Promise => {
+	worker = (...uris: Uri[]): Promise => {
 		return client.getLanguageServiceWorker(...uris);
 	};
 
diff --git a/src/language/json/jsonWorker.ts b/src/language/json/jsonWorker.ts
index 02900d80..138f40b9 100644
--- a/src/language/json/jsonWorker.ts
+++ b/src/language/json/jsonWorker.ts
@@ -144,6 +144,22 @@ export class JSONWorker {
 		let ranges = this._languageService.getSelectionRanges(document, positions, jsonDocument);
 		return Promise.resolve(ranges);
 	}
+	async parseJSONDocument(uri: string): Promise {
+		let document = this._getTextDocument(uri);
+		if (!document) {
+			return null;
+		}
+		let jsonDocument = this._languageService.parseJSONDocument(document);
+		return Promise.resolve(jsonDocument);
+	}
+	async getMatchingSchemas(uri: string): Promise {
+		let document = this._getTextDocument(uri);
+		if (!document) {
+			return [];
+		}
+		let jsonDocument = this._languageService.parseJSONDocument(document);
+		return Promise.resolve(this._languageService.getMatchingSchemas(document, jsonDocument));
+	}
 	private _getTextDocument(uri: string): jsonService.TextDocument | null {
 		let models = this._ctx.getMirrorModels();
 		for (let model of models) {
diff --git a/src/language/json/monaco.contribution.ts b/src/language/json/monaco.contribution.ts
index 3f9544c6..663aa1d1 100644
--- a/src/language/json/monaco.contribution.ts
+++ b/src/language/json/monaco.contribution.ts
@@ -4,7 +4,8 @@
  *--------------------------------------------------------------------------------------------*/
 
 import * as mode from './jsonMode';
-import { Emitter, IEvent, languages } from '../../fillers/monaco-editor-core';
+import { Emitter, IEvent, languages, Uri } from '../../fillers/monaco-editor-core';
+import type { JSONWorker } from './jsonWorker';
 
 // --- JSON configuration and defaults ---------
 
@@ -197,8 +198,12 @@ export const jsonDefaults: LanguageServiceDefaults = new LanguageServiceDefaults
 	modeConfigurationDefault
 );
 
+export const getWorker = (): Promise<(...uris: Uri[]) => Promise> => {
+	return getMode().then((mode) => mode.getWorker());
+};
+
 // export to the global based API
-(languages).json = { jsonDefaults };
+(languages).json = { jsonDefaults, getWorker };
 
 // --- Registration to monaco editor ---
 

From d39ac8ecc09e30377844aed80f993a056c76dd04 Mon Sep 17 00:00:00 2001
From: Alexander Makarenko 
Date: Wed, 13 Dec 2023 16:05:42 +0100
Subject: [PATCH 12/22] Export IJSONWorker type

Fix microsoft#727
---
 src/language/json/monaco.contribution.ts | 28 +++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/language/json/monaco.contribution.ts b/src/language/json/monaco.contribution.ts
index 663aa1d1..9db5923d 100644
--- a/src/language/json/monaco.contribution.ts
+++ b/src/language/json/monaco.contribution.ts
@@ -4,8 +4,8 @@
  *--------------------------------------------------------------------------------------------*/
 
 import * as mode from './jsonMode';
-import { Emitter, IEvent, languages, Uri } from '../../fillers/monaco-editor-core';
-import type { JSONWorker } from './jsonWorker';
+import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
+import * as jsonService from 'vscode-json-languageservice';
 
 // --- JSON configuration and defaults ---------
 
@@ -198,9 +198,27 @@ export const jsonDefaults: LanguageServiceDefaults = new LanguageServiceDefaults
 	modeConfigurationDefault
 );
 
-export const getWorker = (): Promise<(...uris: Uri[]) => Promise> => {
-	return getMode().then((mode) => mode.getWorker());
-};
+export interface IJSONWorker {
+	findDocumentSymbols(uri: string): Promise;
+	getColorPresentations(
+		uri: string,
+		color: jsonService.Color,
+		range: jsonService.Range
+	): Promise;
+	getFoldingRanges(
+		uri: string,
+		context?: { rangeLimit?: number }
+	): Promise;
+	getSelectionRanges(
+		uri: string,
+		positions: jsonService.Position[]
+	): Promise;
+	parseJSONDocument(uri: string): Promise;
+	getMatchingSchemas(uri: string): Promise;
+}
+
+export const getWorker = (): Promise<(...uris: Uri[]) => Promise> =>
+	getMode().then((mode) => mode.getWorker());
 
 // export to the global based API
 (languages).json = { jsonDefaults, getWorker };

From c3aeff033a02c48fe5774226d49829f46f5a548a Mon Sep 17 00:00:00 2001
From: Alexander Makarenko 
Date: Fri, 15 Dec 2023 15:52:28 +0100
Subject: [PATCH 13/22] Inline JSON language service types in
 monaco.contribution.ts

Fix microsoft#727
---
 src/language/json/monaco.contribution.ts | 421 ++++++++++++++++++++++-
 1 file changed, 404 insertions(+), 17 deletions(-)

diff --git a/src/language/json/monaco.contribution.ts b/src/language/json/monaco.contribution.ts
index 9db5923d..fa427870 100644
--- a/src/language/json/monaco.contribution.ts
+++ b/src/language/json/monaco.contribution.ts
@@ -5,8 +5,405 @@
 
 import * as mode from './jsonMode';
 import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
-import * as jsonService from 'vscode-json-languageservice';
 
+// ---- JSON service types ----
+/**
+ * Defines a decimal number. Since decimal numbers are very
+ * rare in the language server specification we denote the
+ * exact range with every decimal using the mathematics
+ * interval notations (e.g. [0, 1] denotes all decimals d with
+ * 0 <= d <= 1.
+ */
+export type decimal = number;
+
+/**
+ * Represents a color in RGBA space.
+ */
+export interface Color {
+	/**
+	 * The red component of this color in the range [0-1].
+	 */
+	readonly red: decimal;
+	/**
+	 * The green component of this color in the range [0-1].
+	 */
+	readonly green: decimal;
+	/**
+	 * The blue component of this color in the range [0-1].
+	 */
+	readonly blue: decimal;
+	/**
+	 * The alpha component of this color in the range [0-1].
+	 */
+	readonly alpha: decimal;
+}
+
+/**
+ * Defines an unsigned integer in the range of 0 to 2^31 - 1.
+ */
+export type uinteger = number;
+
+/**
+ * Position in a text document expressed as zero-based line and character offset.
+ * The offsets are based on a UTF-16 string representation. So a string of the form
+ * `a𐐀b` the character offset of the character `a` is 0, the character offset of `𐐀`
+ * is 1 and the character offset of b is 3 since `𐐀` is represented using two code
+ * units in UTF-16.
+ *
+ * Positions are line end character agnostic. So you can not specify a position that
+ * denotes `\r|\n` or `\n|` where `|` represents the character offset.
+ */
+export interface Position {
+	/**
+	 * Line position in a document (zero-based).
+	 */
+	line: uinteger;
+	/**
+	 * Character offset on a line in a document (zero-based). Assuming that the line is
+	 * represented as a string, the `character` value represents the gap between the
+	 * `character` and `character + 1`.
+	 *
+	 * If the character value is greater than the line length it defaults back to the
+	 * line length.
+	 */
+	character: uinteger;
+}
+
+/**
+ * A range in a text document expressed as (zero-based) start and end positions.
+ *
+ * If you want to specify a range that contains a line including the line ending
+ * character(s) then use an end position denoting the start of the next line.
+ * For example:
+ * ```ts
+ * {
+ *     start: { line: 5, character: 23 }
+ *     end : { line 6, character : 0 }
+ * }
+ * ```
+ */
+export interface Range {
+	/**
+	 * The range's start position
+	 */
+	start: Position;
+	/**
+	 * The range's end position.
+	 */
+	end: Position;
+}
+
+/**
+ * A text edit applicable to a text document.
+ */
+export interface TextEdit {
+	/**
+	 * The range of the text document to be manipulated. To insert
+	 * text into a document create a range where start === end.
+	 */
+	range: Range;
+	/**
+	 * The string to be inserted. For delete operations use an
+	 * empty string.
+	 */
+	newText: string;
+}
+
+export interface ColorPresentation {
+	/**
+	 * The label of this color presentation. It will be shown on the color
+	 * picker header. By default this is also the text that is inserted when selecting
+	 * this color presentation.
+	 */
+	label: string;
+	/**
+	 * An [edit](#TextEdit) which is applied to a document when selecting
+	 * this presentation for the color.  When `falsy` the [label](#ColorPresentation.label)
+	 * is used.
+	 */
+	textEdit?: TextEdit;
+	/**
+	 * An optional array of additional [text edits](#TextEdit) that are applied when
+	 * selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
+	 */
+	additionalTextEdits?: TextEdit[];
+}
+
+/**
+ * Represents a folding range. To be valid, start and end line must be bigger than zero and smaller
+ * than the number of lines in the document. Clients are free to ignore invalid ranges.
+ */
+export interface FoldingRange {
+	/**
+	 * The zero-based start line of the range to fold. The folded area starts after the line's last character.
+	 * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
+	 */
+	startLine: uinteger;
+	/**
+	 * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
+	 */
+	startCharacter?: uinteger;
+	/**
+	 * The zero-based end line of the range to fold. The folded area ends with the line's last character.
+	 * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
+	 */
+	endLine: uinteger;
+	/**
+	 * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
+	 */
+	endCharacter?: uinteger;
+	/**
+	 * Describes the kind of the folding range such as `comment' or 'region'. The kind
+	 * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
+	 * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
+	 */
+	kind?: string;
+}
+
+export interface BaseASTNode {
+	readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
+	readonly parent?: ASTNode;
+	readonly offset: number;
+	readonly length: number;
+	readonly children?: ASTNode[];
+	readonly value?: string | boolean | number | null;
+}
+export interface ObjectASTNode extends BaseASTNode {
+	readonly type: 'object';
+	readonly properties: PropertyASTNode[];
+	readonly children: ASTNode[];
+}
+export interface PropertyASTNode extends BaseASTNode {
+	readonly type: 'property';
+	readonly keyNode: StringASTNode;
+	readonly valueNode?: ASTNode;
+	readonly colonOffset?: number;
+	readonly children: ASTNode[];
+}
+export interface ArrayASTNode extends BaseASTNode {
+	readonly type: 'array';
+	readonly items: ASTNode[];
+	readonly children: ASTNode[];
+}
+export interface StringASTNode extends BaseASTNode {
+	readonly type: 'string';
+	readonly value: string;
+}
+export interface NumberASTNode extends BaseASTNode {
+	readonly type: 'number';
+	readonly value: number;
+	readonly isInteger: boolean;
+}
+export interface BooleanASTNode extends BaseASTNode {
+	readonly type: 'boolean';
+	readonly value: boolean;
+}
+export interface NullASTNode extends BaseASTNode {
+	readonly type: 'null';
+	readonly value: null;
+}
+
+export type ASTNode =
+	| ObjectASTNode
+	| PropertyASTNode
+	| ArrayASTNode
+	| StringASTNode
+	| NumberASTNode
+	| BooleanASTNode
+	| NullASTNode;
+
+export type JSONDocument = {
+	root: ASTNode | undefined;
+	getNodeFromOffset(offset: number, includeRightBound?: boolean): ASTNode | undefined;
+};
+
+export type JSONSchemaRef = JSONSchema | boolean;
+
+export interface JSONSchemaMap {
+	[name: string]: JSONSchemaRef;
+}
+
+export interface JSONSchema {
+	id?: string;
+	$id?: string;
+	$schema?: string;
+	type?: string | string[];
+	title?: string;
+	default?: any;
+	definitions?: {
+		[name: string]: JSONSchema;
+	};
+	description?: string;
+	properties?: JSONSchemaMap;
+	patternProperties?: JSONSchemaMap;
+	additionalProperties?: boolean | JSONSchemaRef;
+	minProperties?: number;
+	maxProperties?: number;
+	dependencies?:
+		| JSONSchemaMap
+		| {
+				[prop: string]: string[];
+		  };
+	items?: JSONSchemaRef | JSONSchemaRef[];
+	minItems?: number;
+	maxItems?: number;
+	uniqueItems?: boolean;
+	additionalItems?: boolean | JSONSchemaRef;
+	pattern?: string;
+	minLength?: number;
+	maxLength?: number;
+	minimum?: number;
+	maximum?: number;
+	exclusiveMinimum?: boolean | number;
+	exclusiveMaximum?: boolean | number;
+	multipleOf?: number;
+	required?: string[];
+	$ref?: string;
+	anyOf?: JSONSchemaRef[];
+	allOf?: JSONSchemaRef[];
+	oneOf?: JSONSchemaRef[];
+	not?: JSONSchemaRef;
+	enum?: any[];
+	format?: string;
+	const?: any;
+	contains?: JSONSchemaRef;
+	propertyNames?: JSONSchemaRef;
+	examples?: any[];
+	$comment?: string;
+	if?: JSONSchemaRef;
+	then?: JSONSchemaRef;
+	else?: JSONSchemaRef;
+	defaultSnippets?: {
+		label?: string;
+		description?: string;
+		markdownDescription?: string;
+		body?: any;
+		bodyText?: string;
+	}[];
+	errorMessage?: string;
+	patternErrorMessage?: string;
+	deprecationMessage?: string;
+	enumDescriptions?: string[];
+	markdownEnumDescriptions?: string[];
+	markdownDescription?: string;
+	doNotSuggest?: boolean;
+	suggestSortText?: string;
+	allowComments?: boolean;
+	allowTrailingCommas?: boolean;
+}
+
+export interface MatchingSchema {
+	node: ASTNode;
+	schema: JSONSchema;
+}
+
+/**
+ * A selection range represents a part of a selection hierarchy. A selection range
+ * may have a parent selection range that contains it.
+ */
+export interface SelectionRange {
+	/**
+	 * The [range](#Range) of this selection range.
+	 */
+	range: Range;
+	/**
+	 * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
+	 */
+	parent?: SelectionRange;
+}
+
+/**
+ * A tagging type for string properties that are actually document URIs.
+ */
+export type DocumentUri = string;
+
+/**
+ * Represents a location inside a resource, such as a line
+ * inside a text file.
+ */
+export interface Location {
+	uri: DocumentUri;
+	range: Range;
+}
+
+export type SymbolKind =
+	| 1
+	| 2
+	| 3
+	| 4
+	| 5
+	| 6
+	| 7
+	| 8
+	| 9
+	| 10
+	| 11
+	| 12
+	| 13
+	| 14
+	| 15
+	| 16
+	| 17
+	| 18
+	| 19
+	| 20
+	| 21
+	| 22
+	| 23
+	| 24
+	| 25
+	| 26;
+
+/**
+ * Symbol tags are extra annotations that tweak the rendering of a symbol.
+ * @since 3.16
+ */
+export type SymbolTag = 1;
+/**
+ * Represents information about programming constructs like variables, classes,
+ * interfaces etc.
+ */
+export interface SymbolInformation {
+	/**
+	 * The name of this symbol.
+	 */
+	name: string;
+	/**
+	 * The kind of this symbol.
+	 */
+	kind: SymbolKind;
+	/**
+	 * Tags for this completion item.
+	 *
+	 * @since 3.16.0
+	 */
+	tags?: SymbolTag[];
+	/**
+	 * Indicates if this symbol is deprecated.
+	 *
+	 * @deprecated Use tags instead
+	 */
+	deprecated?: boolean;
+	/**
+	 * The location of this symbol. The location's range is used by a tool
+	 * to reveal the location in the editor. If the symbol is selected in the
+	 * tool the range's start information is used to position the cursor. So
+	 * the range usually spans more than the actual symbol's name and does
+	 * normally include thinks like visibility modifiers.
+	 *
+	 * The range doesn't have to denote a node range in the sense of a abstract
+	 * syntax tree. It can therefore not be used to re-construct a hierarchy of
+	 * the symbols.
+	 */
+	location: Location;
+	/**
+	 * The name of the symbol containing this symbol. This information is for
+	 * user interface purposes (e.g. to render a qualifier in the user interface
+	 * if necessary). It can't be used to re-infer a hierarchy for the document
+	 * symbols.
+	 */
+	containerName?: string;
+}
 // --- JSON configuration and defaults ---------
 
 export interface DiagnosticsOptions {
@@ -199,22 +596,12 @@ export const jsonDefaults: LanguageServiceDefaults = new LanguageServiceDefaults
 );
 
 export interface IJSONWorker {
-	findDocumentSymbols(uri: string): Promise;
-	getColorPresentations(
-		uri: string,
-		color: jsonService.Color,
-		range: jsonService.Range
-	): Promise;
-	getFoldingRanges(
-		uri: string,
-		context?: { rangeLimit?: number }
-	): Promise;
-	getSelectionRanges(
-		uri: string,
-		positions: jsonService.Position[]
-	): Promise;
-	parseJSONDocument(uri: string): Promise;
-	getMatchingSchemas(uri: string): Promise;
+	findDocumentSymbols(uri: string): Promise;
+	getColorPresentations(uri: string, color: Color, range: Range): Promise;
+	getFoldingRanges(uri: string, context?: { rangeLimit?: number }): Promise;
+	getSelectionRanges(uri: string, positions: Position[]): Promise;
+	parseJSONDocument(uri: string): Promise;
+	getMatchingSchemas(uri: string): Promise;
 }
 
 export const getWorker = (): Promise<(...uris: Uri[]) => Promise> =>

From eb704f3a862a667377620cfdabc39ae6e9a4cfd8 Mon Sep 17 00:00:00 2001
From: Alexander Makarenko 
Date: Wed, 20 Dec 2023 10:09:00 +0100
Subject: [PATCH 14/22] Remove excessive APIs

Fix microsoft#727
---
 src/language/json/monaco.contribution.ts | 189 -----------------------
 1 file changed, 189 deletions(-)

diff --git a/src/language/json/monaco.contribution.ts b/src/language/json/monaco.contribution.ts
index fa427870..0ef14dda 100644
--- a/src/language/json/monaco.contribution.ts
+++ b/src/language/json/monaco.contribution.ts
@@ -16,28 +16,6 @@ import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
  */
 export type decimal = number;
 
-/**
- * Represents a color in RGBA space.
- */
-export interface Color {
-	/**
-	 * The red component of this color in the range [0-1].
-	 */
-	readonly red: decimal;
-	/**
-	 * The green component of this color in the range [0-1].
-	 */
-	readonly green: decimal;
-	/**
-	 * The blue component of this color in the range [0-1].
-	 */
-	readonly blue: decimal;
-	/**
-	 * The alpha component of this color in the range [0-1].
-	 */
-	readonly alpha: decimal;
-}
-
 /**
  * Defines an unsigned integer in the range of 0 to 2^31 - 1.
  */
@@ -92,74 +70,6 @@ export interface Range {
 	 */
 	end: Position;
 }
-
-/**
- * A text edit applicable to a text document.
- */
-export interface TextEdit {
-	/**
-	 * The range of the text document to be manipulated. To insert
-	 * text into a document create a range where start === end.
-	 */
-	range: Range;
-	/**
-	 * The string to be inserted. For delete operations use an
-	 * empty string.
-	 */
-	newText: string;
-}
-
-export interface ColorPresentation {
-	/**
-	 * The label of this color presentation. It will be shown on the color
-	 * picker header. By default this is also the text that is inserted when selecting
-	 * this color presentation.
-	 */
-	label: string;
-	/**
-	 * An [edit](#TextEdit) which is applied to a document when selecting
-	 * this presentation for the color.  When `falsy` the [label](#ColorPresentation.label)
-	 * is used.
-	 */
-	textEdit?: TextEdit;
-	/**
-	 * An optional array of additional [text edits](#TextEdit) that are applied when
-	 * selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
-	 */
-	additionalTextEdits?: TextEdit[];
-}
-
-/**
- * Represents a folding range. To be valid, start and end line must be bigger than zero and smaller
- * than the number of lines in the document. Clients are free to ignore invalid ranges.
- */
-export interface FoldingRange {
-	/**
-	 * The zero-based start line of the range to fold. The folded area starts after the line's last character.
-	 * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
-	 */
-	startLine: uinteger;
-	/**
-	 * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
-	 */
-	startCharacter?: uinteger;
-	/**
-	 * The zero-based end line of the range to fold. The folded area ends with the line's last character.
-	 * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
-	 */
-	endLine: uinteger;
-	/**
-	 * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
-	 */
-	endCharacter?: uinteger;
-	/**
-	 * Describes the kind of the folding range such as `comment' or 'region'. The kind
-	 * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
-	 * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
-	 */
-	kind?: string;
-}
-
 export interface BaseASTNode {
 	readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
 	readonly parent?: ASTNode;
@@ -296,22 +206,6 @@ export interface MatchingSchema {
 	node: ASTNode;
 	schema: JSONSchema;
 }
-
-/**
- * A selection range represents a part of a selection hierarchy. A selection range
- * may have a parent selection range that contains it.
- */
-export interface SelectionRange {
-	/**
-	 * The [range](#Range) of this selection range.
-	 */
-	range: Range;
-	/**
-	 * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
-	 */
-	parent?: SelectionRange;
-}
-
 /**
  * A tagging type for string properties that are actually document URIs.
  */
@@ -325,85 +219,6 @@ export interface Location {
 	uri: DocumentUri;
 	range: Range;
 }
-
-export type SymbolKind =
-	| 1
-	| 2
-	| 3
-	| 4
-	| 5
-	| 6
-	| 7
-	| 8
-	| 9
-	| 10
-	| 11
-	| 12
-	| 13
-	| 14
-	| 15
-	| 16
-	| 17
-	| 18
-	| 19
-	| 20
-	| 21
-	| 22
-	| 23
-	| 24
-	| 25
-	| 26;
-
-/**
- * Symbol tags are extra annotations that tweak the rendering of a symbol.
- * @since 3.16
- */
-export type SymbolTag = 1;
-/**
- * Represents information about programming constructs like variables, classes,
- * interfaces etc.
- */
-export interface SymbolInformation {
-	/**
-	 * The name of this symbol.
-	 */
-	name: string;
-	/**
-	 * The kind of this symbol.
-	 */
-	kind: SymbolKind;
-	/**
-	 * Tags for this completion item.
-	 *
-	 * @since 3.16.0
-	 */
-	tags?: SymbolTag[];
-	/**
-	 * Indicates if this symbol is deprecated.
-	 *
-	 * @deprecated Use tags instead
-	 */
-	deprecated?: boolean;
-	/**
-	 * The location of this symbol. The location's range is used by a tool
-	 * to reveal the location in the editor. If the symbol is selected in the
-	 * tool the range's start information is used to position the cursor. So
-	 * the range usually spans more than the actual symbol's name and does
-	 * normally include thinks like visibility modifiers.
-	 *
-	 * The range doesn't have to denote a node range in the sense of a abstract
-	 * syntax tree. It can therefore not be used to re-construct a hierarchy of
-	 * the symbols.
-	 */
-	location: Location;
-	/**
-	 * The name of the symbol containing this symbol. This information is for
-	 * user interface purposes (e.g. to render a qualifier in the user interface
-	 * if necessary). It can't be used to re-infer a hierarchy for the document
-	 * symbols.
-	 */
-	containerName?: string;
-}
 // --- JSON configuration and defaults ---------
 
 export interface DiagnosticsOptions {
@@ -596,10 +411,6 @@ export const jsonDefaults: LanguageServiceDefaults = new LanguageServiceDefaults
 );
 
 export interface IJSONWorker {
-	findDocumentSymbols(uri: string): Promise;
-	getColorPresentations(uri: string, color: Color, range: Range): Promise;
-	getFoldingRanges(uri: string, context?: { rangeLimit?: number }): Promise;
-	getSelectionRanges(uri: string, positions: Position[]): Promise;
 	parseJSONDocument(uri: string): Promise;
 	getMatchingSchemas(uri: string): Promise;
 }

From 9be16fa852a6157c1b51cfa2fe675dd675407e76 Mon Sep 17 00:00:00 2001
From: Alexander Makarenko 
Date: Wed, 20 Dec 2023 11:39:05 +0100
Subject: [PATCH 15/22] Remove unused types

Fix microsoft#727
---
 src/language/json/monaco.contribution.ts | 76 ------------------------
 1 file changed, 76 deletions(-)

diff --git a/src/language/json/monaco.contribution.ts b/src/language/json/monaco.contribution.ts
index 0ef14dda..ae44000f 100644
--- a/src/language/json/monaco.contribution.ts
+++ b/src/language/json/monaco.contribution.ts
@@ -7,69 +7,6 @@ import * as mode from './jsonMode';
 import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
 
 // ---- JSON service types ----
-/**
- * Defines a decimal number. Since decimal numbers are very
- * rare in the language server specification we denote the
- * exact range with every decimal using the mathematics
- * interval notations (e.g. [0, 1] denotes all decimals d with
- * 0 <= d <= 1.
- */
-export type decimal = number;
-
-/**
- * Defines an unsigned integer in the range of 0 to 2^31 - 1.
- */
-export type uinteger = number;
-
-/**
- * Position in a text document expressed as zero-based line and character offset.
- * The offsets are based on a UTF-16 string representation. So a string of the form
- * `a𐐀b` the character offset of the character `a` is 0, the character offset of `𐐀`
- * is 1 and the character offset of b is 3 since `𐐀` is represented using two code
- * units in UTF-16.
- *
- * Positions are line end character agnostic. So you can not specify a position that
- * denotes `\r|\n` or `\n|` where `|` represents the character offset.
- */
-export interface Position {
-	/**
-	 * Line position in a document (zero-based).
-	 */
-	line: uinteger;
-	/**
-	 * Character offset on a line in a document (zero-based). Assuming that the line is
-	 * represented as a string, the `character` value represents the gap between the
-	 * `character` and `character + 1`.
-	 *
-	 * If the character value is greater than the line length it defaults back to the
-	 * line length.
-	 */
-	character: uinteger;
-}
-
-/**
- * A range in a text document expressed as (zero-based) start and end positions.
- *
- * If you want to specify a range that contains a line including the line ending
- * character(s) then use an end position denoting the start of the next line.
- * For example:
- * ```ts
- * {
- *     start: { line: 5, character: 23 }
- *     end : { line 6, character : 0 }
- * }
- * ```
- */
-export interface Range {
-	/**
-	 * The range's start position
-	 */
-	start: Position;
-	/**
-	 * The range's end position.
-	 */
-	end: Position;
-}
 export interface BaseASTNode {
 	readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
 	readonly parent?: ASTNode;
@@ -206,21 +143,8 @@ export interface MatchingSchema {
 	node: ASTNode;
 	schema: JSONSchema;
 }
-/**
- * A tagging type for string properties that are actually document URIs.
- */
-export type DocumentUri = string;
 
-/**
- * Represents a location inside a resource, such as a line
- * inside a text file.
- */
-export interface Location {
-	uri: DocumentUri;
-	range: Range;
-}
 // --- JSON configuration and defaults ---------
-
 export interface DiagnosticsOptions {
 	/**
 	 * If set, the validator will be enabled and perform syntax and schema based validation,

From 787421ee5444097acde50af4fbaf74c7b9985e94 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 20 Jan 2024 14:40:25 -0800
Subject: [PATCH 16/22] Bump vite from 3.2.7 to 3.2.8 (#4350)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 3.2.7 to 3.2.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v3.2.8/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v3.2.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
 package-lock.json | 14 +++++++-------
 package.json      |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 2a4b3938..ce0b2375 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -37,7 +37,7 @@
 				"terser": "^5.14.2",
 				"ts-node": "^10.6.0",
 				"typescript": "^5.0.2",
-				"vite": "^3.2.7",
+				"vite": "^3.2.8",
 				"vscode-css-languageservice": "5.4.1",
 				"vscode-html-languageservice": "4.2.4",
 				"vscode-json-languageservice": "4.2.1",
@@ -6966,9 +6966,9 @@
 			"dev": true
 		},
 		"node_modules/vite": {
-			"version": "3.2.7",
-			"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz",
-			"integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==",
+			"version": "3.2.8",
+			"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz",
+			"integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==",
 			"dev": true,
 			"dependencies": {
 				"esbuild": "^0.15.9",
@@ -12211,9 +12211,9 @@
 			"dev": true
 		},
 		"vite": {
-			"version": "3.2.7",
-			"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz",
-			"integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==",
+			"version": "3.2.8",
+			"resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz",
+			"integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==",
 			"dev": true,
 			"requires": {
 				"esbuild": "^0.15.9",
diff --git a/package.json b/package.json
index 9f54e019..52641b0b 100644
--- a/package.json
+++ b/package.json
@@ -64,7 +64,7 @@
 		"terser": "^5.14.2",
 		"ts-node": "^10.6.0",
 		"typescript": "^5.0.2",
-		"vite": "^3.2.7",
+		"vite": "^3.2.8",
 		"vscode-css-languageservice": "5.4.1",
 		"vscode-html-languageservice": "4.2.4",
 		"vscode-json-languageservice": "4.2.1",

From 4fc87360d1b93d2cdd8b50b034c7b6b52cb5fef9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 20 Jan 2024 14:40:41 -0800
Subject: [PATCH 17/22] Bump vite from 2.9.16 to 2.9.17 in
 /samples/browser-esm-vite-react (#4349)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 2.9.16 to 2.9.17.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v2.9.17/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v2.9.17/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
 samples/browser-esm-vite-react/package-lock.json | 14 +++++++-------
 samples/browser-esm-vite-react/package.json      |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/samples/browser-esm-vite-react/package-lock.json b/samples/browser-esm-vite-react/package-lock.json
index ff042a8a..31593daa 100644
--- a/samples/browser-esm-vite-react/package-lock.json
+++ b/samples/browser-esm-vite-react/package-lock.json
@@ -13,7 +13,7 @@
 				"react": "^17.0.2",
 				"react-dom": "^17.0.2",
 				"typescript": "^5.0.2",
-				"vite": "^2.9.16"
+				"vite": "^2.9.17"
 			}
 		},
 		"node_modules/@ampproject/remapping": {
@@ -1392,9 +1392,9 @@
 			}
 		},
 		"node_modules/vite": {
-			"version": "2.9.16",
-			"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz",
-			"integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==",
+			"version": "2.9.17",
+			"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.17.tgz",
+			"integrity": "sha512-XxcRzra6d7xrKXH66jZUgb+srThoPu+TLJc06GifUyKq9JmjHkc1Numc8ra0h56rju2jfVWw3B3fs5l3OFMvUw==",
 			"dev": true,
 			"dependencies": {
 				"esbuild": "^0.14.27",
@@ -2325,9 +2325,9 @@
 			"dev": true
 		},
 		"vite": {
-			"version": "2.9.16",
-			"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz",
-			"integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==",
+			"version": "2.9.17",
+			"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.17.tgz",
+			"integrity": "sha512-XxcRzra6d7xrKXH66jZUgb+srThoPu+TLJc06GifUyKq9JmjHkc1Numc8ra0h56rju2jfVWw3B3fs5l3OFMvUw==",
 			"dev": true,
 			"requires": {
 				"esbuild": "^0.14.27",
diff --git a/samples/browser-esm-vite-react/package.json b/samples/browser-esm-vite-react/package.json
index 07ff5a1b..6445f402 100644
--- a/samples/browser-esm-vite-react/package.json
+++ b/samples/browser-esm-vite-react/package.json
@@ -15,6 +15,6 @@
 		"@types/react-dom": "^17.0.11",
 		"@vitejs/plugin-react": "^1.1.4",
 		"typescript": "^5.0.2",
-		"vite": "^2.9.16"
+		"vite": "^2.9.17"
 	}
 }

From 6c7087b94ed1477142b9bdd950e78e4e9e4477b2 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Tue, 23 Jan 2024 16:34:51 +0100
Subject: [PATCH 18/22] Adds publishMonacoEditorCore and publishMonacoEditor
 options to nightly pipeline to publish skipped builds

---
 .azure-pipelines/publish-nightly.yml | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/.azure-pipelines/publish-nightly.yml b/.azure-pipelines/publish-nightly.yml
index e5c622eb..a5a7c95e 100644
--- a/.azure-pipelines/publish-nightly.yml
+++ b/.azure-pipelines/publish-nightly.yml
@@ -24,6 +24,14 @@ resources:
       endpoint: Monaco
 
 parameters:
+  - name: publishMonacoEditorCore
+    displayName: 🚀 Publish Monaco Editor Core
+    type: boolean
+    default: true
+  - name: publishMonacoEditor
+    displayName: 🚀 Publish Editor Core
+    type: boolean
+    default: true
   - name: vscodeRef
     displayName: The VS Code commit id.
     type: string
@@ -56,7 +64,7 @@ extends:
 
         tag: next
         ghCreateTag: false
-        publishPackage: true
+        publishPackage: ${{ parameters.publishMonacoEditorCore }}
         publishRequiresApproval: false
 
       - name: monaco-editor
@@ -74,5 +82,5 @@ extends:
             displayName: Setup, Build & Test monaco-editor
 
         tag: next
-        publishPackage: true
+        publishPackage: ${{ parameters.publishMonacoEditor }}
         publishRequiresApproval: false

From b0330f8eed00fb81f50b5d8ff17824cfe2e734c5 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Tue, 23 Jan 2024 16:39:35 +0100
Subject: [PATCH 19/22] Fixes monaco-editor nightly build (needed for
 verification)

---
 package-lock.json           | 14 +++----
 package.json                |  2 +-
 test/unit/all.js            |  4 ++
 website/src/runner/debug.ts | 75 +++++++++++++++++++++++++++++++++++++
 4 files changed, 87 insertions(+), 8 deletions(-)
 create mode 100644 website/src/runner/debug.ts

diff --git a/package-lock.json b/package-lock.json
index ce0b2375..e4042ee5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,7 +25,7 @@
 				"jsdom": "^19.0.0",
 				"jsonc-parser": "^3.0.0",
 				"mocha": "^9.2.0",
-				"monaco-editor-core": "0.45.0-rc",
+				"monaco-editor-core": "0.46.0-dev-20240109",
 				"parcel": "^2.7.0",
 				"pin-github-action": "^1.8.0",
 				"playwright": "^1.32.2",
@@ -5337,9 +5337,9 @@
 			"dev": true
 		},
 		"node_modules/monaco-editor-core": {
-			"version": "0.45.0-rc",
-			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.45.0-rc.tgz",
-			"integrity": "sha512-iNh84qarOK8KhJNaxitm+07m9sCCoF4OxQXDOru1pOSPNFGpMEOV/35agYm9ab9RAm2CPGGHz27eJUY1FY0iKg==",
+			"version": "0.46.0-dev-20240109",
+			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.46.0-dev-20240109.tgz",
+			"integrity": "sha512-HK4YgFFpBpZ0zGbNbN/Julb8AXaB8Z7wuy4bgezj4MEjMYnTB4zn/CQ+ogCy+ZblVB6pD1X4vXN2mfiTqDeOMw==",
 			"dev": true
 		},
 		"node_modules/mri": {
@@ -11069,9 +11069,9 @@
 			}
 		},
 		"monaco-editor-core": {
-			"version": "0.45.0-rc",
-			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.45.0-rc.tgz",
-			"integrity": "sha512-iNh84qarOK8KhJNaxitm+07m9sCCoF4OxQXDOru1pOSPNFGpMEOV/35agYm9ab9RAm2CPGGHz27eJUY1FY0iKg==",
+			"version": "0.46.0-dev-20240109",
+			"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.46.0-dev-20240109.tgz",
+			"integrity": "sha512-HK4YgFFpBpZ0zGbNbN/Julb8AXaB8Z7wuy4bgezj4MEjMYnTB4zn/CQ+ogCy+ZblVB6pD1X4vXN2mfiTqDeOMw==",
 			"dev": true
 		},
 		"mri": {
diff --git a/package.json b/package.json
index 52641b0b..d03821cb 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,7 @@
 		"jsdom": "^19.0.0",
 		"jsonc-parser": "^3.0.0",
 		"mocha": "^9.2.0",
-		"monaco-editor-core": "0.45.0-rc",
+		"monaco-editor-core": "0.46.0-dev-20240109",
 		"parcel": "^2.7.0",
 		"pin-github-action": "^1.8.0",
 		"playwright": "^1.32.2",
diff --git a/test/unit/all.js b/test/unit/all.js
index 44a43feb..2cb2b0f7 100644
--- a/test/unit/all.js
+++ b/test/unit/all.js
@@ -26,6 +26,10 @@ global.UIEvent = tmp.window.UIEvent;
 global.window = {
 	location: {},
 	navigator: tmp.window.navigator,
+	document: {
+		body: tmp.window.document.body,
+		addEventListener: (...args) => tmp.window.document.addEventListener(...args)
+	},
 	matchMedia: function () {
 		return {
 			matches: false,
diff --git a/website/src/runner/debug.ts b/website/src/runner/debug.ts
new file mode 100644
index 00000000..d0a81a36
--- /dev/null
+++ b/website/src/runner/debug.ts
@@ -0,0 +1,75 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { loadMonaco } from "../monaco-loader";
+import { IPreviewState } from "../shared";
+import { LzmaCompressor } from "../website/utils/lzmaCompressor";
+import "./style.scss";
+
+let monacoPromise: Promise | undefined = undefined;
+
+async function initialize(state: IPreviewState) {
+	if (monacoPromise) {
+		throw new Error("already initialized");
+	}
+
+	const loadingContainerDiv = document.createElement("div");
+	loadingContainerDiv.className = "loader-container";
+	const loadingDiv = document.createElement("div");
+	loadingDiv.className = "loader";
+	loadingContainerDiv.appendChild(loadingDiv);
+	document.body.appendChild(loadingContainerDiv);
+
+	monacoPromise = loadMonaco(state.monacoSetup);
+	await monacoPromise;
+
+	loadingContainerDiv.remove();
+
+	const style = document.createElement("style");
+	style.id = "custom-style";
+	style.innerHTML = state.css; // CodeQL [SM03712] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground. // CodeQL [SM02688] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground.
+	document.body.appendChild(style);
+
+	document.body.innerHTML += state.html;
+
+	const js = state.js;
+
+	try {
+		eval(js); // CodeQL [SM01632] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground. // CodeQL [SM02688] This is safe because the runner runs in an isolated iframe. This feature is essential to the functionality of the playground.
+	} catch (err) {
+		const pre = document.createElement("pre");
+		pre.appendChild(
+			document.createTextNode(`${err}: ${(err as any).state}`)
+		);
+		document.body.insertBefore(pre, document.body.firstChild);
+	}
+}
+
+async function main() {
+	const compressor = new LzmaCompressor();
+	const stateStr = new URLSearchParams(window.location.search).get("state");
+	const state = compressor.decodeData(stateStr!);
+
+	const previousStateStr = localStorage.getItem("stateStr");
+	if (previousStateStr === stateStr) {
+		initialize(state);
+	} else {
+		// If it does not, show the load button
+		const loadButton = document.createElement("button");
+		loadButton.style.position = "absolute";
+		loadButton.style.top = "50%";
+		loadButton.style.left = "50%";
+		loadButton.style.transform = "translate(-50%, -50%)";
+		loadButton.innerText = "Load";
+		loadButton.style.padding = "10px 20px";
+		loadButton.onclick = () => {
+			loadButton.remove();
+			localStorage.setItem("stateStr", stateStr!);
+			initialize(state);
+		};
+		document.body.appendChild(loadButton);
+	}
+}
+main();

From 9488e7e078b8252e0e5401759be3b025384e1119 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Tue, 23 Jan 2024 17:40:32 +0100
Subject: [PATCH 20/22] Removes parcel smoke test, as it replaces process with
 {}

---
 test/smoke/runner.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/smoke/runner.js b/test/smoke/runner.js
index 02f1635f..1e5f109d 100644
--- a/test/smoke/runner.js
+++ b/test/smoke/runner.js
@@ -42,7 +42,8 @@ async function runTests() {
 	// uncomment to shortcircuit and run a specific combo
 	// await runTest('webpack', 'chromium'); return;
 	/** @type {PackagerKind[]} */
-	const testTypes = ['amd', 'webpack', 'esbuild', 'vite', 'parcel'];
+	const testTypes = ['amd', 'webpack', 'esbuild', 'vite'];
+	// TODO: add parcel! (this currently fails because parcel replaces process with {})
 
 	for (const type of testTypes) {
 		await runTest(type, 'chromium');

From 73b47d4592354b7e450099e676f2118d33673646 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Tue, 23 Jan 2024 19:57:21 +0100
Subject: [PATCH 21/22] Fixes parameter labels

---
 .azure-pipelines/publish-nightly.yml | 2 +-
 .azure-pipelines/publish-stable.yml  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.azure-pipelines/publish-nightly.yml b/.azure-pipelines/publish-nightly.yml
index a5a7c95e..c8df3f09 100644
--- a/.azure-pipelines/publish-nightly.yml
+++ b/.azure-pipelines/publish-nightly.yml
@@ -29,7 +29,7 @@ parameters:
     type: boolean
     default: true
   - name: publishMonacoEditor
-    displayName: 🚀 Publish Editor Core
+    displayName: 🚀 Publish Monaco Editor
     type: boolean
     default: true
   - name: vscodeRef
diff --git a/.azure-pipelines/publish-stable.yml b/.azure-pipelines/publish-stable.yml
index f2aac055..3974b763 100644
--- a/.azure-pipelines/publish-stable.yml
+++ b/.azure-pipelines/publish-stable.yml
@@ -21,7 +21,7 @@ parameters:
     type: boolean
     default: false
   - name: publishMonacoEditor
-    displayName: 🚀 Publish Editor Core
+    displayName: 🚀 Publish Monaco Editor
     type: boolean
     default: false
   - name: publishWebpackPlugin

From 21db3aebf09e6e3c43720084e270870184855642 Mon Sep 17 00:00:00 2001
From: Henning Dieterichs 
Date: Tue, 23 Jan 2024 20:17:22 +0100
Subject: [PATCH 22/22] Sorts version numbers

---
 .../pages/playground/getNpmVersionsSync.ts    | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/website/src/website/pages/playground/getNpmVersionsSync.ts b/website/src/website/pages/playground/getNpmVersionsSync.ts
index 2ec1eb9e..30a47875 100644
--- a/website/src/website/pages/playground/getNpmVersionsSync.ts
+++ b/website/src/website/pages/playground/getNpmVersionsSync.ts
@@ -59,9 +59,38 @@ async function _getNpmVersions(): Promise {
 	]);
 
 	const validVersions = versions.filter((v) => !brokenVersions.has(v));
+
+	validVersions.sort((v1, v2) => -compareSemanticVersions(v1, v2));
+
 	return validVersions;
 }
 
+function compareSemanticVersions(version1: string, version2: string): number {
+	const v1 = version1.split(/[.]/);
+	const v2 = version2.split(/[.]/);
+	for (let i = 0; i < Math.min(v1.length, v2.length); i++) {
+		const isNumber = /^\d+$/.test(v1[i]) && /^\d+$/.test(v2[i]);
+
+		if (isNumber) {
+			const n1 = parseInt(v1[i]);
+			const n2 = parseInt(v2[i]);
+			if (n1 < n2) {
+				return -1;
+			}
+			if (n1 > n2) {
+				return 1;
+			}
+		} else {
+			const compare = v1[i].localeCompare(v2[i]);
+			if (compare !== 0) {
+				return compare;
+			}
+		}
+	}
+
+	return v1.length - v2.length;
+}
+
 export async function getVsCodeCommitId(
 	monacoEditorVersion: string
 ): Promise {