mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
- Migrate entry points to the 0.57 exports scheme (monaco-editor/editor, languages/features/typescript/register) - Wire workers via the official MonacoEnvironment.getWorker + new Worker(new URL(...)) integration; webpack emits them as shared-chunk classic workers (chrome 70 compatible), total assets -21% - Keep css/html/json language features (register.all) and route their worker labels; json is used by the cmeditor textareas - Replace removed esm/vs/nls.messages with an inline implementation in the nls shim - Drop MinChunkSizePlugin: it merged worker chunks into the main chunk and broke the runtime id module (webpack#15416) - Remove monaco-editor-webpack-plugin dependency - loadMonaco() now returns the loaded feature module exports, e.g. loadMonaco(['typescript']).typescript.javascriptDefaults
23 lines
634 B
TypeScript
23 lines
634 B
TypeScript
import * as monaco from 'monaco-editor/editor';
|
|
import { configureMonacoYaml } from 'monaco-yaml';
|
|
import problemConfigSchema from '../schema/problemconfig';
|
|
|
|
configureMonacoYaml(monaco as any, {
|
|
validate: true,
|
|
enableSchemaRequest: true,
|
|
hover: true,
|
|
completion: true,
|
|
format: false,
|
|
schemas: [
|
|
{
|
|
uri: 'https://hydro.js.org/schema/problemConfig.json',
|
|
fileMatch: ['hydro://problem/file/config.yaml'],
|
|
schema: problemConfigSchema as any,
|
|
},
|
|
{
|
|
uri: new URL('/manage/config/schema.json', window.location.href).toString(),
|
|
fileMatch: ['hydro://system/setting.yaml'],
|
|
},
|
|
],
|
|
});
|