mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Updates changelog
This commit is contained in:
parent
d89eb54d17
commit
39b6dbe8b0
11 changed files with 1772 additions and 3 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
# Monaco Editor Changelog
|
# Monaco Editor Changelog
|
||||||
|
|
||||||
|
## [0.55.0] (unreleased)
|
||||||
|
|
||||||
|
### Breaking Changes
|
||||||
|
- Moves nested namespaces (`languages.css`, `languages.html`, `languages.json`, `languages.typescript`) to top level namespaces (`css`, `html`, `json`, `typescript`) to simplify the build process.
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
- Adds native LSP support (see new `lsp` namespace).
|
||||||
|
|
||||||
## [0.54.0]
|
## [0.54.0]
|
||||||
|
|
||||||
- Adds option `editor.mouseMiddleClickAction`
|
- Adds option `editor.mouseMiddleClickAction`
|
||||||
|
|
|
||||||
2
samples/browser-esm-vite/.gitignore
vendored
Normal file
2
samples/browser-esm-vite/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
dist
|
||||||
|
src/**/*.js
|
||||||
12
samples/browser-esm-vite/index.html
Normal file
12
samples/browser-esm-vite/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>browser-esm-vite</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
samples/browser-esm-vite/main.ts
Normal file
13
samples/browser-esm-vite/main.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import './style.css';
|
||||||
|
import * as monaco from '../../src/editor/editor.main';
|
||||||
|
|
||||||
|
monaco.languages.register({ id: 'typescript' });
|
||||||
|
|
||||||
|
const tm = monaco.editor.createModel(`class Test {}`, 'typescript',
|
||||||
|
monaco.Uri.parse('file:///main.ts'));
|
||||||
|
|
||||||
|
const editor = monaco.editor.create(document.getElementById('root')!, {
|
||||||
|
model: tm,
|
||||||
|
language: 'typescript',
|
||||||
|
theme: 'vs-dark',
|
||||||
|
});
|
||||||
1664
samples/browser-esm-vite/package-lock.json
generated
Normal file
1664
samples/browser-esm-vite/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
14
samples/browser-esm-vite/package.json
Normal file
14
samples/browser-esm-vite/package.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"name": "browser-esm-vite",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"serve": "vite preview"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"monaco-editor": "^0.54.0",
|
||||||
|
"typescript": "^5.9.3",
|
||||||
|
"vite": "^7.1.9"
|
||||||
|
}
|
||||||
|
}
|
||||||
8
samples/browser-esm-vite/style.css
Normal file
8
samples/browser-esm-vite/style.css
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
#root {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
11
samples/browser-esm-vite/tsconfig.json
Normal file
11
samples/browser-esm-vite/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"strict": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
|
},
|
||||||
|
"include": ["./"]
|
||||||
|
}
|
||||||
19
samples/browser-esm-vite/vite.config.ts
Normal file
19
samples/browser-esm-vite/vite.config.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import { join } from 'path';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
server: {
|
||||||
|
fs: {
|
||||||
|
allow: ['../../', '../../../vscode']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: [{
|
||||||
|
find: 'monaco-editor-core/esm/vs',
|
||||||
|
replacement: join(__dirname, '../../../vscode/src/vs')
|
||||||
|
}, {
|
||||||
|
find: 'monaco-editor-core',
|
||||||
|
replacement: join(__dirname, '../../../vscode/src/vs/editor/editor.main.ts')
|
||||||
|
}],
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -14,13 +14,20 @@ export function getMonaco(): typeof monaco | undefined {
|
||||||
return (window as any).monaco;
|
return (window as any).monaco;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IMonacoSetup {
|
export type IAMDMonacoSetup = {
|
||||||
loaderUrl: string;
|
loaderUrl: string;
|
||||||
loaderConfigPaths: Record<string, string>;
|
loaderConfigPaths: Record<string, string>;
|
||||||
codiconUrl: string;
|
codiconUrl: string;
|
||||||
monacoTypesUrl: string | undefined;
|
monacoTypesUrl: string | undefined;
|
||||||
language?: string;
|
language?: string;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export type IESMMonacoSetup = {
|
||||||
|
esmUrl: string;
|
||||||
|
monacoTypesUrl: string | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type IMonacoSetup = IAMDMonacoSetup | IESMMonacoSetup;
|
||||||
|
|
||||||
let loading = false;
|
let loading = false;
|
||||||
let resolve: (value: typeof monaco) => void;
|
let resolve: (value: typeof monaco) => void;
|
||||||
|
|
@ -47,6 +54,10 @@ export async function loadMonaco(
|
||||||
async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
|
async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
|
||||||
const global = self as any;
|
const global = self as any;
|
||||||
|
|
||||||
|
if ('esmUrl' in setup) {
|
||||||
|
return await import(/* webpackIgnore: true */setup.esmUrl); // CodeQL [SM01507] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. // CodeQL [SM03712] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration.
|
||||||
|
}
|
||||||
|
|
||||||
if (!(global as any).require) {
|
if (!(global as any).require) {
|
||||||
await loadScript(setup.loaderUrl);
|
await loadScript(setup.loaderUrl);
|
||||||
}
|
}
|
||||||
|
|
@ -112,7 +123,7 @@ export const prodMonacoSetup = getMonacoSetup(
|
||||||
export function getMonacoSetup(
|
export function getMonacoSetup(
|
||||||
corePath: string,
|
corePath: string,
|
||||||
language?: string
|
language?: string
|
||||||
): IMonacoSetup {
|
): IAMDMonacoSetup {
|
||||||
const loaderConfigPaths = {
|
const loaderConfigPaths = {
|
||||||
vs: `${corePath}`,
|
vs: `${corePath}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,13 @@ export function toLoaderConfig(settings: Settings): IMonacoSetup {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (coreUrl.endsWith('?esm')) {
|
||||||
|
return {
|
||||||
|
esmUrl: coreUrl,
|
||||||
|
monacoTypesUrl: undefined,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let languagesUrl: string;
|
let languagesUrl: string;
|
||||||
switch (settings.languagesSource) {
|
switch (settings.languagesSource) {
|
||||||
case "latest":
|
case "latest":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue