mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
ui: upgrade monaco-editor
This commit is contained in:
6 files changed
+17
-6
No files matched your search
@@ -17,11 +17,11 @@ function emoji(range) {
|
||||
function qqEmoji(range) {
|
||||
return qface.data.flatMap((i) => {
|
||||
const url = qface.getUrl(i.QSid, 'https://qq-face.vercel.app');
|
||||
return i.Input.map((input) => ({
|
||||
return [i.QDes.substring(1), ...(i.Input || [])].map((input) => ({
|
||||
label: `/${input}`,
|
||||
kind: monaco.languages.CompletionItemKind.Keyword,
|
||||
documentation: { value: ``, isTrusted: true },
|
||||
insertText: `![${i.Input[0]}](${url} =32x32) `,
|
||||
insertText: `![${i.Input ? i.Input[0] : i.QDes.substring(1)}](${url} =32x32) `,
|
||||
range,
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { setDiagnosticsOptions } from 'monaco-yaml';
|
||||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
import { configureMonacoYaml } from 'monaco-yaml';
|
||||
import problemConfigSchema from '../schema/problemconfig';
|
||||
|
||||
setDiagnosticsOptions({
|
||||
configureMonacoYaml(monaco, {
|
||||
validate: true,
|
||||
enableSchemaRequest: true,
|
||||
hover: true,
|
||||
|
||||
@@ -18,6 +18,14 @@ export function localize(path, message, ...args) {
|
||||
return format(CURRENT_LOCALE_DATA[path.key || path] || message, args);
|
||||
}
|
||||
|
||||
export function localize2(data, message, ...args) {
|
||||
const original = localize(message, args);
|
||||
return {
|
||||
value: original,
|
||||
original,
|
||||
};
|
||||
}
|
||||
|
||||
export function setLocaleData(data) {
|
||||
CURRENT_LOCALE_DATA = Object.assign(...Object.values(data));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user