@bhsd/codemirror-mediawiki 3.9.2 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -11
- package/dist/bidi.d.ts +4 -8
- package/dist/bidi.js +33 -23
- package/dist/codemirror.js +15 -9
- package/dist/color.d.ts +1 -1
- package/dist/color.js +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +3 -2
- package/dist/css.js +9 -6
- package/dist/escape.d.ts +1 -1
- package/dist/escape.js +4 -3
- package/dist/fold.d.ts +2 -2
- package/dist/fold.js +106 -39
- package/dist/hover.d.ts +2 -2
- package/dist/hover.js +72 -69
- package/dist/index.d.ts +54 -16
- package/dist/index.js +91 -38
- package/dist/inlay.d.ts +1 -1
- package/dist/inlay.js +26 -25
- package/dist/javascript.js +45 -2
- package/dist/linter.d.ts +15 -2
- package/dist/linter.js +2 -2
- package/dist/lintsource.d.ts +15 -3
- package/dist/lintsource.js +13 -7
- package/dist/lua.d.ts +0 -2
- package/dist/lua.js +32 -26
- package/dist/main.min.js +31 -29
- package/dist/matchTag.js +4 -3
- package/dist/mediawiki.d.ts +4 -2
- package/dist/mediawiki.js +56 -44
- package/dist/mw.min.js +33 -37
- package/dist/mwConfig.js +2 -2
- package/dist/openLinks.d.ts +4 -2
- package/dist/openLinks.js +56 -54
- package/dist/ref.d.ts +1 -1
- package/dist/ref.js +92 -93
- package/dist/signature.d.ts +1 -1
- package/dist/signature.js +50 -49
- package/dist/statusBar.js +9 -8
- package/dist/theme.js +6 -0
- package/dist/token.d.ts +20 -6
- package/dist/token.js +26 -17
- package/dist/util.d.ts +17 -2
- package/dist/util.js +39 -1
- package/dist/wiki.min.js +32 -36
- package/i18n/en.json +2 -2
- package/i18n/zh-hans.json +2 -2
- package/i18n/zh-hant.json +2 -2
- package/package.json +14 -12
package/dist/fold.js
CHANGED
|
@@ -6,7 +6,7 @@ import elt from 'crelt';
|
|
|
6
6
|
import { tokens } from './config.js';
|
|
7
7
|
import { bgDark } from './constants.js';
|
|
8
8
|
import { matchTag, getTag } from './matchTag.js';
|
|
9
|
-
import { braceStackUpdate } from './util.js';
|
|
9
|
+
import { braceStackUpdate, sliceDoc } from './util.js';
|
|
10
10
|
const getExtRegex = /* @__PURE__ */ getRegex(tag => new RegExp(`mw-tag-${tag}(?![a-z])`, 'u'));
|
|
11
11
|
const updateSelection = (pos, { to }) => Math.max(pos, to), updateAll = (pos, { from, to }) => from <= pos && to > pos ? to : pos;
|
|
12
12
|
/**
|
|
@@ -98,7 +98,7 @@ export const foldable = (state, posOrNode, tree, refOnly = false) => {
|
|
|
98
98
|
if (stack <= 0) {
|
|
99
99
|
// The closing bracket of the current template
|
|
100
100
|
to = nextSibling.from
|
|
101
|
-
+
|
|
101
|
+
+ sliceDoc(state, nextSibling)
|
|
102
102
|
.split('}}').slice(0, stack - 1).join('}}').length;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
@@ -202,7 +202,9 @@ const getAnchor = (state) => Math.max(...state.selection.ranges.map(({ to }) =>
|
|
|
202
202
|
* @param refOnly 是否仅检查`<ref>`标签
|
|
203
203
|
*/
|
|
204
204
|
const traverse = (state, tree, effects, node, end, anchor, update, refOnly) => {
|
|
205
|
-
while (node && node.from
|
|
205
|
+
while (node && (node.from < end
|
|
206
|
+
|| node.from === end
|
|
207
|
+
&& !(isTemplateBracket(node) && sliceDoc(state, node).startsWith('}}')))) {
|
|
206
208
|
const range = foldable(state, node, tree, refOnly);
|
|
207
209
|
if (range) {
|
|
208
210
|
effects.push(foldEffect.of(range));
|
|
@@ -237,8 +239,8 @@ const findFold = ({ state }, line) => {
|
|
|
237
239
|
});
|
|
238
240
|
return found;
|
|
239
241
|
};
|
|
240
|
-
export const foldableLine = ({ state,
|
|
241
|
-
const tree = syntaxTree(state);
|
|
242
|
+
export const foldableLine = ({ state, viewportLineBlocks }, { from: f, to: t }) => {
|
|
243
|
+
const tree = syntaxTree(state), { doc } = state, { length } = viewportLineBlocks;
|
|
242
244
|
/**
|
|
243
245
|
* 获取标题层级
|
|
244
246
|
* @param pos 行首位置
|
|
@@ -253,36 +255,55 @@ export const foldableLine = ({ state, viewport: { to: end }, viewportLineBlocks
|
|
|
253
255
|
* @param to 行尾位置
|
|
254
256
|
*/
|
|
255
257
|
getTable = (from, to) => {
|
|
256
|
-
const
|
|
258
|
+
const node = tree.resolve(from, 1), { nextSibling } = node, bracket = node.name.includes(tokens.tableBracket)
|
|
259
|
+
? node
|
|
260
|
+
: node.to < to && nextSibling?.name.includes(tokens.tableBracket) && nextSibling;
|
|
257
261
|
if (bracket) {
|
|
258
|
-
|
|
259
|
-
if (name.includes(tokens.tableBracket)) {
|
|
260
|
-
return bracket.endsWith('|}') ? -1 : 1;
|
|
261
|
-
}
|
|
262
|
+
return /\|\}$|\{\{\s*!(?:\s*\}|\)\s*)\}\}$/u.test(sliceDoc(state, bracket)) ? -1 : 1;
|
|
262
263
|
}
|
|
263
264
|
return 0;
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* 逐行检查是否是折叠终点
|
|
268
|
+
* @param checkLine 检查函数
|
|
269
|
+
* @returns 折叠范围或是否继续查找
|
|
270
|
+
*/
|
|
271
|
+
loop = (checkLine) => {
|
|
272
|
+
let i = 0;
|
|
273
|
+
while (i <= doc.lines) {
|
|
274
|
+
const { from, to } = i < length ? viewportLineBlocks[i] : doc.line(i);
|
|
275
|
+
if (from >= tree.topNode.to) {
|
|
276
|
+
return from === doc.length;
|
|
277
|
+
}
|
|
278
|
+
else if (from > f) {
|
|
279
|
+
/** 折叠范围或是否继续查找 */
|
|
280
|
+
const result = checkLine(from, to);
|
|
281
|
+
if (result !== true) {
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
i++;
|
|
286
|
+
if (i === length) {
|
|
287
|
+
i = doc.lineAt(to).number + 1;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return true;
|
|
264
291
|
};
|
|
265
292
|
const level = getLevel(f);
|
|
266
293
|
if (level < 7) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
return end === state.doc.length && end > t && { from: t, to: end };
|
|
294
|
+
const checkLine = from => getLevel(from) > level || t < from - 1 && { from: t, to: from - 1 };
|
|
295
|
+
const /** 折叠范围或是否继续查找 */ result = loop(checkLine);
|
|
296
|
+
return result === true
|
|
297
|
+
? t < doc.length && { from: t, to: doc.length }
|
|
298
|
+
: result;
|
|
273
299
|
}
|
|
274
300
|
else if (getTable(f, t) === 1) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
else if (bracket === 1 || getLevel(from) < 7) {
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
301
|
+
const checkLine = (from, to) => {
|
|
302
|
+
const bracket = getTable(from, to);
|
|
303
|
+
return bracket === -1 ? t < from - 1 && { from: t, to: from - 1 } : bracket !== 1 && getLevel(from) === 7;
|
|
304
|
+
};
|
|
305
|
+
const /** 折叠范围或是否继续查找 */ result = loop(checkLine);
|
|
306
|
+
return typeof result === 'object' && result;
|
|
286
307
|
}
|
|
287
308
|
return false;
|
|
288
309
|
};
|
|
@@ -322,7 +343,18 @@ const defaultFoldExtension = /* @__PURE__ */ (() => [foldGutter(), keymap.of(fol
|
|
|
322
343
|
* @param refOnly 是否仅检查`<ref>`标签
|
|
323
344
|
*/
|
|
324
345
|
const foldCommand = (refOnly) => view => {
|
|
325
|
-
const { state } = view, tree = ensureSyntaxTree(state, state.doc.length, 1e3) ?? syntaxTree(state), effects = []
|
|
346
|
+
const { state } = view, tree = ensureSyntaxTree(state, state.doc.length, 1e3) ?? syntaxTree(state), effects = [];
|
|
347
|
+
let anchor = traverse(state, tree, effects, tree.topNode.firstChild, Infinity, getAnchor(state), updateAll, refOnly);
|
|
348
|
+
if (!refOnly) {
|
|
349
|
+
for (let pos = 0; pos < state.doc.length;) {
|
|
350
|
+
const line = view.lineBlockAt(pos), range = foldableLine(view, line);
|
|
351
|
+
if (range) {
|
|
352
|
+
effects.push(foldEffect.of(range));
|
|
353
|
+
anchor = updateAll(anchor, range);
|
|
354
|
+
}
|
|
355
|
+
pos = (range ? view.lineBlockAt(range.to) : line).to + 1;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
326
358
|
return execute(view, effects, anchor);
|
|
327
359
|
};
|
|
328
360
|
export const foldRef = /* @__PURE__ */ foldCommand(true);
|
|
@@ -340,6 +372,28 @@ export const unfoldRef = (view) => {
|
|
|
340
372
|
}
|
|
341
373
|
return false;
|
|
342
374
|
};
|
|
375
|
+
const selectedLines = (view) => {
|
|
376
|
+
const lines = [];
|
|
377
|
+
for (const { head } of view.state.selection.ranges) {
|
|
378
|
+
if (lines.some(({ from, to }) => from <= head && to >= head)) {
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
lines.push(view.lineBlockAt(head));
|
|
382
|
+
}
|
|
383
|
+
return lines;
|
|
384
|
+
};
|
|
385
|
+
const foldCode = (view, line) => {
|
|
386
|
+
const range = foldableLine(view, line);
|
|
387
|
+
if (range) {
|
|
388
|
+
view.dispatch({ effects: foldEffect.of(range) });
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
return false;
|
|
392
|
+
};
|
|
393
|
+
const unfoldCode = (view, line) => {
|
|
394
|
+
const folded = findFold(view, line);
|
|
395
|
+
return folded && unfoldEffect.of(folded);
|
|
396
|
+
};
|
|
343
397
|
export default ((e = defaultFoldExtension) => [
|
|
344
398
|
e,
|
|
345
399
|
EditorView.theme({
|
|
@@ -348,7 +402,7 @@ export default ((e = defaultFoldExtension) => [
|
|
|
348
402
|
},
|
|
349
403
|
}),
|
|
350
404
|
]);
|
|
351
|
-
export const
|
|
405
|
+
export const mediawikiFold = /* @__PURE__ */ (() => [
|
|
352
406
|
codeFolding({
|
|
353
407
|
placeholderDOM(view) {
|
|
354
408
|
const element = elt('span', { 'aria-label': 'folded code', title: view.state.phrase('unfold'), class: 'cm-foldPlaceholder' }, '…');
|
|
@@ -396,7 +450,15 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
396
450
|
}
|
|
397
451
|
anchor = traverse(state, tree, effects, node, to, anchor, updateSelection);
|
|
398
452
|
}
|
|
399
|
-
|
|
453
|
+
if (effects.length > 0) {
|
|
454
|
+
return execute(view, effects, anchor);
|
|
455
|
+
}
|
|
456
|
+
for (const line of selectedLines(view)) {
|
|
457
|
+
if (foldCode(view, line)) {
|
|
458
|
+
return true;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return false;
|
|
400
462
|
},
|
|
401
463
|
},
|
|
402
464
|
{
|
|
@@ -426,6 +488,16 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
426
488
|
view.dispatch({ effects, selection });
|
|
427
489
|
return true;
|
|
428
490
|
}
|
|
491
|
+
for (const line of selectedLines(view)) {
|
|
492
|
+
const effect = unfoldCode(view, line);
|
|
493
|
+
if (effect) {
|
|
494
|
+
effects.push(effect);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (effects.length > 0) {
|
|
498
|
+
view.dispatch({ effects });
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
429
501
|
return false;
|
|
430
502
|
},
|
|
431
503
|
},
|
|
@@ -442,17 +514,12 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
442
514
|
},
|
|
443
515
|
domEventHandlers: {
|
|
444
516
|
click(view, line) {
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
view.dispatch({ effects
|
|
517
|
+
const effects = unfoldCode(view, line);
|
|
518
|
+
if (effects) {
|
|
519
|
+
view.dispatch({ effects });
|
|
448
520
|
return true;
|
|
449
521
|
}
|
|
450
|
-
|
|
451
|
-
if (range) {
|
|
452
|
-
view.dispatch({ effects: foldEffect.of(range) });
|
|
453
|
-
return true;
|
|
454
|
-
}
|
|
455
|
-
return false;
|
|
522
|
+
return foldCode(view, line);
|
|
456
523
|
},
|
|
457
524
|
},
|
|
458
525
|
}),
|
package/dist/hover.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Extension } from '@codemirror/state';
|
|
2
|
-
import type { CodeMirror6 } from './codemirror
|
|
3
|
-
declare const _default: (cm: CodeMirror6) => Extension;
|
|
2
|
+
import type { CodeMirror6 } from './codemirror';
|
|
3
|
+
declare const _default: (articlePath?: string, templatedata?: boolean) => (cm: CodeMirror6) => Extension;
|
|
4
4
|
export default _default;
|
package/dist/hover.js
CHANGED
|
@@ -3,75 +3,78 @@ import { ensureSyntaxTree } from '@codemirror/language';
|
|
|
3
3
|
import { getLSP, loadScript, } from '@bhsd/browser';
|
|
4
4
|
import { tokens } from './config.js';
|
|
5
5
|
import { base, hoverSelector, bgDark } from './constants.js';
|
|
6
|
-
import { indexToPos, posToIndex, createTooltipView, escHTML, } from './util.js';
|
|
6
|
+
import { indexToPos, posToIndex, createTooltipView, toConfigGetter, escHTML, sliceDoc, findTemplateName, } from './util.js';
|
|
7
7
|
const code = `${hoverSelector} code`;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
? ''
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
const getDoc = (section, info = '') => escHTML(info)
|
|
9
|
+
+ (section === 'Optional' ? '' : `<br><b><i>@${section.toLowerCase()}</i></b>`);
|
|
10
|
+
export default (articlePath, templatedata) => (cm) => {
|
|
11
|
+
return [
|
|
12
|
+
hoverTooltip(async (view, pos, side) => {
|
|
13
|
+
const { state } = view, { doc } = state;
|
|
14
|
+
const { paramSuggest, tags } = cm.langConfig;
|
|
15
|
+
let hover = await getLSP(view, false, toConfigGetter(cm.getWikiConfig, articlePath), base.CDN)?.provideHover(doc.toString(), indexToPos(doc, pos));
|
|
16
|
+
if (!hover && paramSuggest && 'templatedata' in tags) {
|
|
17
|
+
const node = ensureSyntaxTree(state, pos + Math.max(side, 0))?.resolve(pos, side);
|
|
18
|
+
if (node?.name.includes(tokens.templateName)) {
|
|
19
|
+
const result = await paramSuggest(sliceDoc(state, node), templatedata), { description, length } = result;
|
|
20
|
+
if (description || length > 0) {
|
|
21
|
+
hover = {
|
|
22
|
+
contents: {
|
|
23
|
+
kind: 'plaintext',
|
|
24
|
+
value: (description ? `<p>${escHTML(description)}</p>` : '') + (length === 0
|
|
25
|
+
? ''
|
|
26
|
+
: `<ul>${result.map(([keys, , info, section]) => `<li>${keys.map(key => `<code>${escHTML(key)}</code>`).join('/')}${info && ' - '}${getDoc(section, info)}</li>`).join('')}</ul>`),
|
|
27
|
+
},
|
|
28
|
+
range: { start: indexToPos(doc, node.from), end: indexToPos(doc, node.to) },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
29
31
|
}
|
|
32
|
+
else if (node?.name.includes(tokens.templateArgumentName)) {
|
|
33
|
+
const name = findTemplateName(state, node);
|
|
34
|
+
if (name) {
|
|
35
|
+
const result = await paramSuggest(name, templatedata), param = sliceDoc(state, node).trim().slice(0, -1).trim(), [, , info, section] = result.find(([keys]) => keys.includes(param)) ?? [];
|
|
36
|
+
if (info || section !== 'Optional') {
|
|
37
|
+
hover = {
|
|
38
|
+
contents: {
|
|
39
|
+
kind: 'plaintext',
|
|
40
|
+
value: getDoc(section, info).replace(/^<br>/u, ''),
|
|
41
|
+
},
|
|
42
|
+
range: { start: indexToPos(doc, node.from), end: indexToPos(doc, node.to) },
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (hover) {
|
|
49
|
+
const { CDN = '' } = base;
|
|
50
|
+
await loadScript(`${CDN}${CDN && '/'}npm/marked/lib/marked.umd.js`, 'marked', true);
|
|
51
|
+
const { end } = hover.range;
|
|
52
|
+
return {
|
|
53
|
+
pos,
|
|
54
|
+
end: posToIndex(doc, end),
|
|
55
|
+
above: true,
|
|
56
|
+
create() {
|
|
57
|
+
const { kind, value } = hover.contents;
|
|
58
|
+
return createTooltipView(view, kind === 'plaintext' ? value : marked.parse(value));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
30
61
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
padding: '2px 5px',
|
|
51
|
-
width: 'max-content',
|
|
52
|
-
maxWidth: '60vw',
|
|
53
|
-
overflowY: 'auto',
|
|
54
|
-
},
|
|
55
|
-
[`${hoverSelector} *`]: {
|
|
56
|
-
marginTop: '0!important',
|
|
57
|
-
marginBottom: '0!important',
|
|
58
|
-
},
|
|
59
|
-
[`${hoverSelector}>div`]: {
|
|
60
|
-
fontSize: '90%',
|
|
61
|
-
lineHeight: 1.4,
|
|
62
|
-
},
|
|
63
|
-
[code]: {
|
|
64
|
-
color: 'inherit',
|
|
65
|
-
padding: '.1em .4em',
|
|
66
|
-
borderRadius: '.4em',
|
|
67
|
-
},
|
|
68
|
-
}),
|
|
69
|
-
EditorView.baseTheme({
|
|
70
|
-
[`&light ${code}`]: {
|
|
71
|
-
backgroundColor: '#e0e6eb',
|
|
72
|
-
},
|
|
73
|
-
[`&dark ${code}`]: {
|
|
74
|
-
backgroundColor: bgDark,
|
|
75
|
-
},
|
|
76
|
-
}),
|
|
77
|
-
];
|
|
62
|
+
return null;
|
|
63
|
+
}),
|
|
64
|
+
EditorView.theme({
|
|
65
|
+
[code]: {
|
|
66
|
+
color: 'inherit',
|
|
67
|
+
padding: '.1em .4em',
|
|
68
|
+
borderRadius: '.4em',
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
EditorView.baseTheme({
|
|
72
|
+
[`&light ${code}`]: {
|
|
73
|
+
backgroundColor: '#e0e6eb',
|
|
74
|
+
},
|
|
75
|
+
[`&dark ${code}`]: {
|
|
76
|
+
backgroundColor: bgDark,
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
];
|
|
80
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -31,30 +31,64 @@ export declare const registerCodeFolding: () => void;
|
|
|
31
31
|
export declare const registerColorPicker: () => void;
|
|
32
32
|
/** Register all common extensions */
|
|
33
33
|
export declare const registerCommonExtensions: () => void;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export declare const
|
|
46
|
-
/**
|
|
47
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Register MediaWiki language support
|
|
36
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
37
|
+
* @param templatedata whether to use [Extension:TemplateData](https://www.mediawiki.org/wiki/Extension:TemplateData)
|
|
38
|
+
* for template hover information; enabled by default
|
|
39
|
+
*/
|
|
40
|
+
export declare const registerMediaWiki: (articlePath?: string, templatedata?: boolean) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Register the `openLinks` extension
|
|
43
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
44
|
+
*/
|
|
45
|
+
export declare const registerOpenLinks: (articlePath?: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Register the `escape` extension
|
|
48
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
49
|
+
*/
|
|
50
|
+
export declare const registerEscape: (articlePath?: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Register the `refHover` extension
|
|
53
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
54
|
+
*/
|
|
55
|
+
export declare const registerRefHover: (articlePath?: string) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Register the `hover` extension
|
|
58
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
59
|
+
* @param templatedata whether to use [Extension:TemplateData](https://www.mediawiki.org/wiki/Extension:TemplateData)
|
|
60
|
+
* for template information; enabled by default
|
|
61
|
+
*/
|
|
62
|
+
export declare const registerHover: (articlePath?: string, templatedata?: boolean) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Register the `signatureHelp` extension
|
|
65
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
66
|
+
*/
|
|
67
|
+
export declare const registerSignatureHelp: (articlePath?: string) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Register the `inlayHints` extension
|
|
70
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
71
|
+
*/
|
|
72
|
+
export declare const registerInlayHints: (articlePath?: string) => void;
|
|
73
|
+
/** Register the `bidiIsolates` extension */
|
|
74
|
+
export declare const registerBidiIsolates: () => void;
|
|
48
75
|
/** Register the `colorPicker` extension for MediaWiki */
|
|
49
76
|
export declare const registerColorPickerForMediaWiki: () => void;
|
|
50
77
|
/** Register the `bracketMatching` extension for MediaWiki */
|
|
51
78
|
export declare const registerBracketMatchingForMediaWiki: () => void;
|
|
52
79
|
/** Register the `codeFolding` extension for MediaWiki */
|
|
53
80
|
export declare const registerCodeFoldingForMediaWiki: () => void;
|
|
54
|
-
/**
|
|
55
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Register MediaWiki core language support
|
|
83
|
+
* @param articlePath article path (e.g., 'https://www.mediawiki.org/wiki/')
|
|
84
|
+
* @param templatedata whether to use [Extension:TemplateData](https://www.mediawiki.org/wiki/Extension:TemplateData)
|
|
85
|
+
* for template parameter autocompletion
|
|
86
|
+
*/
|
|
87
|
+
export declare const registerMediaWikiCore: (articlePath?: string, templatedata?: boolean) => void;
|
|
56
88
|
/** Register mixed MediaWiki-HTML language support */
|
|
57
89
|
export declare const registerHTML: () => void;
|
|
90
|
+
/** Register the `bracketMatching` extension for mixed MediaWiki-HTML */
|
|
91
|
+
export declare const registerBracketMatchingForHTML: () => void;
|
|
58
92
|
/** Register the `closeBrackets` extension for mixed MediaWiki-HTML */
|
|
59
93
|
export declare const registerCloseBracketsForHTML: () => void;
|
|
60
94
|
/** Register the `colorPicker` extension for mixed MediaWiki-HTML */
|
|
@@ -87,6 +121,10 @@ export declare const registerCloseBracketsForVue: () => void;
|
|
|
87
121
|
export declare const registerColorPickerForVue: () => void;
|
|
88
122
|
/** Register Vue core language support */
|
|
89
123
|
export declare const registerVueCore: () => void;
|
|
124
|
+
/** Register AbuseFilter language support */
|
|
125
|
+
export declare const registerAbuseFilter: () => void;
|
|
126
|
+
/** Register AbuseFilter core language support */
|
|
127
|
+
export declare const registerAbuseFilterCore: () => void;
|
|
90
128
|
/**
|
|
91
129
|
* Register a custom language support
|
|
92
130
|
* @param name language name
|