@bhsd/codemirror-mediawiki 3.9.1 → 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 +113 -40
- package/dist/hover.d.ts +2 -2
- package/dist/hover.js +74 -62
- 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 +31 -9
- package/dist/theme.js +10 -23
- 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
|
@@ -4,9 +4,9 @@ import { syntaxTree, ensureSyntaxTree, foldEffect, unfoldEffect, foldedRanges, u
|
|
|
4
4
|
import { getRegex } from '@bhsd/common';
|
|
5
5
|
import elt from 'crelt';
|
|
6
6
|
import { tokens } from './config.js';
|
|
7
|
-
import {
|
|
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
|
}
|
|
@@ -134,6 +134,7 @@ export const foldable = (state, posOrNode, tree, refOnly = false) => {
|
|
|
134
134
|
const /** The end of the first delimiter */ from = delimiter?.to;
|
|
135
135
|
return from && from < to ? { from, to } : false;
|
|
136
136
|
};
|
|
137
|
+
const foldSelector = '.cm-tooltip-fold';
|
|
137
138
|
/**
|
|
138
139
|
* 创建折叠提示
|
|
139
140
|
* @param state
|
|
@@ -201,7 +202,9 @@ const getAnchor = (state) => Math.max(...state.selection.ranges.map(({ to }) =>
|
|
|
201
202
|
* @param refOnly 是否仅检查`<ref>`标签
|
|
202
203
|
*/
|
|
203
204
|
const traverse = (state, tree, effects, node, end, anchor, update, refOnly) => {
|
|
204
|
-
while (node && node.from
|
|
205
|
+
while (node && (node.from < end
|
|
206
|
+
|| node.from === end
|
|
207
|
+
&& !(isTemplateBracket(node) && sliceDoc(state, node).startsWith('}}')))) {
|
|
205
208
|
const range = foldable(state, node, tree, refOnly);
|
|
206
209
|
if (range) {
|
|
207
210
|
effects.push(foldEffect.of(range));
|
|
@@ -236,8 +239,8 @@ const findFold = ({ state }, line) => {
|
|
|
236
239
|
});
|
|
237
240
|
return found;
|
|
238
241
|
};
|
|
239
|
-
export const foldableLine = ({ state,
|
|
240
|
-
const tree = syntaxTree(state);
|
|
242
|
+
export const foldableLine = ({ state, viewportLineBlocks }, { from: f, to: t }) => {
|
|
243
|
+
const tree = syntaxTree(state), { doc } = state, { length } = viewportLineBlocks;
|
|
241
244
|
/**
|
|
242
245
|
* 获取标题层级
|
|
243
246
|
* @param pos 行首位置
|
|
@@ -252,36 +255,55 @@ export const foldableLine = ({ state, viewport: { to: end }, viewportLineBlocks
|
|
|
252
255
|
* @param to 行尾位置
|
|
253
256
|
*/
|
|
254
257
|
getTable = (from, to) => {
|
|
255
|
-
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;
|
|
256
261
|
if (bracket) {
|
|
257
|
-
|
|
258
|
-
if (name.includes(tokens.tableBracket)) {
|
|
259
|
-
return bracket.endsWith('|}') ? -1 : 1;
|
|
260
|
-
}
|
|
262
|
+
return /\|\}$|\{\{\s*!(?:\s*\}|\)\s*)\}\}$/u.test(sliceDoc(state, bracket)) ? -1 : 1;
|
|
261
263
|
}
|
|
262
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;
|
|
263
291
|
};
|
|
264
292
|
const level = getLevel(f);
|
|
265
293
|
if (level < 7) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
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;
|
|
272
299
|
}
|
|
273
300
|
else if (getTable(f, t) === 1) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
else if (bracket === 1 || getLevel(from) < 7) {
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
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;
|
|
285
307
|
}
|
|
286
308
|
return false;
|
|
287
309
|
};
|
|
@@ -321,7 +343,18 @@ const defaultFoldExtension = /* @__PURE__ */ (() => [foldGutter(), keymap.of(fol
|
|
|
321
343
|
* @param refOnly 是否仅检查`<ref>`标签
|
|
322
344
|
*/
|
|
323
345
|
const foldCommand = (refOnly) => view => {
|
|
324
|
-
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
|
+
}
|
|
325
358
|
return execute(view, effects, anchor);
|
|
326
359
|
};
|
|
327
360
|
export const foldRef = /* @__PURE__ */ foldCommand(true);
|
|
@@ -339,6 +372,28 @@ export const unfoldRef = (view) => {
|
|
|
339
372
|
}
|
|
340
373
|
return false;
|
|
341
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
|
+
};
|
|
342
397
|
export default ((e = defaultFoldExtension) => [
|
|
343
398
|
e,
|
|
344
399
|
EditorView.theme({
|
|
@@ -347,7 +402,7 @@ export default ((e = defaultFoldExtension) => [
|
|
|
347
402
|
},
|
|
348
403
|
}),
|
|
349
404
|
]);
|
|
350
|
-
export const
|
|
405
|
+
export const mediawikiFold = /* @__PURE__ */ (() => [
|
|
351
406
|
codeFolding({
|
|
352
407
|
placeholderDOM(view) {
|
|
353
408
|
const element = elt('span', { 'aria-label': 'folded code', title: view.state.phrase('unfold'), class: 'cm-foldPlaceholder' }, '…');
|
|
@@ -395,7 +450,15 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
395
450
|
}
|
|
396
451
|
anchor = traverse(state, tree, effects, node, to, anchor, updateSelection);
|
|
397
452
|
}
|
|
398
|
-
|
|
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;
|
|
399
462
|
},
|
|
400
463
|
},
|
|
401
464
|
{
|
|
@@ -425,6 +488,16 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
425
488
|
view.dispatch({ effects, selection });
|
|
426
489
|
return true;
|
|
427
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
|
+
}
|
|
428
501
|
return false;
|
|
429
502
|
},
|
|
430
503
|
},
|
|
@@ -441,17 +514,12 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
441
514
|
},
|
|
442
515
|
domEventHandlers: {
|
|
443
516
|
click(view, line) {
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
view.dispatch({ effects
|
|
517
|
+
const effects = unfoldCode(view, line);
|
|
518
|
+
if (effects) {
|
|
519
|
+
view.dispatch({ effects });
|
|
447
520
|
return true;
|
|
448
521
|
}
|
|
449
|
-
|
|
450
|
-
if (range) {
|
|
451
|
-
view.dispatch({ effects: foldEffect.of(range) });
|
|
452
|
-
return true;
|
|
453
|
-
}
|
|
454
|
-
return false;
|
|
522
|
+
return foldCode(view, line);
|
|
455
523
|
},
|
|
456
524
|
},
|
|
457
525
|
}),
|
|
@@ -466,6 +534,11 @@ export const mediaWikiFold = /* @__PURE__ */ (() => [
|
|
|
466
534
|
opacity: 1,
|
|
467
535
|
},
|
|
468
536
|
}),
|
|
537
|
+
EditorView.baseTheme({
|
|
538
|
+
[`&dark div${foldSelector}`]: {
|
|
539
|
+
backgroundColor: bgDark,
|
|
540
|
+
},
|
|
541
|
+
}),
|
|
469
542
|
])();
|
|
470
543
|
/**
|
|
471
544
|
* 点击提示折叠模板参数
|
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
|
@@ -2,67 +2,79 @@ import { hoverTooltip, EditorView } from '@codemirror/view';
|
|
|
2
2
|
import { ensureSyntaxTree } from '@codemirror/language';
|
|
3
3
|
import { getLSP, loadScript, } from '@bhsd/browser';
|
|
4
4
|
import { tokens } from './config.js';
|
|
5
|
-
import { base, hoverSelector } from './constants.js';
|
|
6
|
-
import { indexToPos, posToIndex, createTooltipView, escHTML, } from './util.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
import { base, hoverSelector, bgDark } from './constants.js';
|
|
6
|
+
import { indexToPos, posToIndex, createTooltipView, toConfigGetter, escHTML, sliceDoc, findTemplateName, } from './util.js';
|
|
7
|
+
const code = `${hoverSelector} code`;
|
|
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
|
+
}
|
|
28
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
|
+
};
|
|
29
61
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
padding: '2px 5px',
|
|
50
|
-
width: 'max-content',
|
|
51
|
-
maxWidth: '60vw',
|
|
52
|
-
overflowY: 'auto',
|
|
53
|
-
},
|
|
54
|
-
[`${hoverSelector} *`]: {
|
|
55
|
-
marginTop: '0!important',
|
|
56
|
-
marginBottom: '0!important',
|
|
57
|
-
},
|
|
58
|
-
[`${hoverSelector}>div`]: {
|
|
59
|
-
fontSize: '90%',
|
|
60
|
-
lineHeight: 1.4,
|
|
61
|
-
},
|
|
62
|
-
[`${hoverSelector} code`]: {
|
|
63
|
-
color: 'inherit',
|
|
64
|
-
padding: '.1em .4em',
|
|
65
|
-
borderRadius: '.4em',
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
];
|
|
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
|