wikilint 2.16.3 → 2.16.5
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/coverage/badge.svg +1 -1
- package/data/signatures.json +43 -0
- package/dist/base.d.mts +84 -27
- package/dist/base.d.ts +84 -27
- package/dist/bin/cli.js +2 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +55 -11
- package/dist/lib/element.d.ts +56 -10
- package/dist/lib/element.js +97 -11
- package/dist/lib/lsp.d.ts +62 -27
- package/dist/lib/lsp.js +395 -304
- package/dist/lib/node.d.ts +51 -19
- package/dist/lib/node.js +80 -34
- package/dist/lib/text.d.ts +8 -2
- package/dist/lib/text.js +10 -3
- package/dist/lib/title.d.ts +23 -9
- package/dist/lib/title.js +56 -21
- package/dist/mixin/attributesParent.d.ts +4 -4
- package/dist/mixin/attributesParent.js +2 -4
- package/dist/mixin/hidden.d.ts +0 -2
- package/dist/mixin/hidden.js +0 -2
- package/dist/parser/braces.js +4 -2
- package/dist/parser/links.js +8 -7
- package/dist/parser/list.js +3 -1
- package/dist/parser/quotes.js +2 -1
- package/dist/parser/redirect.js +4 -1
- package/dist/src/arg.d.ts +4 -2
- package/dist/src/arg.js +8 -4
- package/dist/src/atom.d.ts +5 -1
- package/dist/src/atom.js +5 -1
- package/dist/src/attribute.d.ts +9 -3
- package/dist/src/attribute.js +9 -3
- package/dist/src/attributes.d.ts +12 -4
- package/dist/src/attributes.js +12 -4
- package/dist/src/converter.d.ts +3 -1
- package/dist/src/converter.js +8 -5
- package/dist/src/converterFlags.d.ts +13 -3
- package/dist/src/converterFlags.js +13 -3
- package/dist/src/converterRule.d.ts +3 -1
- package/dist/src/converterRule.js +3 -1
- package/dist/src/extLink.d.ts +2 -0
- package/dist/src/extLink.js +2 -0
- package/dist/src/gallery.d.ts +3 -1
- package/dist/src/gallery.js +7 -5
- package/dist/src/heading.d.ts +3 -1
- package/dist/src/heading.js +10 -8
- package/dist/src/hidden.d.ts +5 -1
- package/dist/src/hidden.js +5 -1
- package/dist/src/html.d.ts +9 -2
- package/dist/src/html.js +201 -146
- package/dist/src/imageParameter.d.ts +11 -3
- package/dist/src/imageParameter.js +12 -4
- package/dist/src/imagemap.d.ts +1 -1
- package/dist/src/imagemap.js +5 -4
- package/dist/src/imagemapLink.d.ts +2 -0
- package/dist/src/imagemapLink.js +2 -0
- package/dist/src/index.d.ts +5 -24
- package/dist/src/index.js +28 -73
- package/dist/src/link/base.d.ts +5 -1
- package/dist/src/link/base.js +17 -7
- package/dist/src/link/category.d.ts +4 -0
- package/dist/src/link/category.js +2 -0
- package/dist/src/link/file.d.ts +17 -7
- package/dist/src/link/file.js +28 -14
- package/dist/src/link/galleryImage.d.ts +5 -1
- package/dist/src/link/galleryImage.js +9 -5
- package/dist/src/link/index.d.ts +4 -0
- package/dist/src/link/index.js +2 -0
- package/dist/src/link/redirectTarget.d.ts +3 -1
- package/dist/src/link/redirectTarget.js +4 -2
- package/dist/src/magicLink.d.ts +12 -3
- package/dist/src/magicLink.js +36 -7
- package/dist/src/nested.d.ts +3 -1
- package/dist/src/nested.js +7 -4
- package/dist/src/nowiki/base.d.ts +3 -1
- package/dist/src/nowiki/base.js +3 -1
- package/dist/src/nowiki/comment.d.ts +5 -1
- package/dist/src/nowiki/comment.js +5 -1
- package/dist/src/nowiki/doubleUnderscore.d.ts +5 -1
- package/dist/src/nowiki/doubleUnderscore.js +5 -1
- package/dist/src/nowiki/index.d.ts +5 -1
- package/dist/src/nowiki/index.js +5 -1
- package/dist/src/nowiki/list.d.ts +5 -1
- package/dist/src/nowiki/list.js +5 -1
- package/dist/src/nowiki/noinclude.d.ts +5 -1
- package/dist/src/nowiki/noinclude.js +5 -1
- package/dist/src/nowiki/quote.d.ts +5 -1
- package/dist/src/nowiki/quote.js +5 -1
- package/dist/src/onlyinclude.d.ts +3 -1
- package/dist/src/onlyinclude.js +3 -1
- package/dist/src/paramTag/index.d.ts +1 -1
- package/dist/src/paramTag/index.js +1 -1
- package/dist/src/parameter.d.ts +3 -1
- package/dist/src/parameter.js +3 -1
- package/dist/src/pre.d.ts +1 -1
- package/dist/src/pre.js +1 -1
- package/dist/src/redirect.d.ts +2 -0
- package/dist/src/redirect.js +2 -0
- package/dist/src/syntax.d.ts +5 -1
- package/dist/src/syntax.js +5 -1
- package/dist/src/table/base.js +3 -1
- package/dist/src/table/index.d.ts +20 -15
- package/dist/src/table/index.js +22 -23
- package/dist/src/table/td.d.ts +9 -3
- package/dist/src/table/td.js +9 -3
- package/dist/src/table/tr.d.ts +3 -1
- package/dist/src/table/tr.js +4 -2
- package/dist/src/table/trBase.d.ts +9 -9
- package/dist/src/table/trBase.js +13 -18
- package/dist/src/tagPair/ext.d.ts +6 -1
- package/dist/src/tagPair/ext.js +151 -98
- package/dist/src/tagPair/include.d.ts +2 -0
- package/dist/src/tagPair/include.js +2 -0
- package/dist/src/tagPair/index.d.ts +6 -2
- package/dist/src/tagPair/index.js +6 -2
- package/dist/src/transclude.d.ts +39 -10
- package/dist/src/transclude.js +69 -18
- package/dist/util/debug.js +2 -16
- package/dist/util/string.js +2 -0
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +3 -2
- package/dist/bin/coverage.js +0 -20
package/dist/lib/element.d.ts
CHANGED
|
@@ -1,53 +1,99 @@
|
|
|
1
1
|
import { AstNode } from './node';
|
|
2
2
|
import type { LintError } from '../base';
|
|
3
3
|
import type { AstNodes, Token } from '../internal';
|
|
4
|
-
|
|
4
|
+
export interface CaretPosition {
|
|
5
|
+
readonly offsetNode: AstNodes;
|
|
6
|
+
readonly offset: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* HTMLElement-like
|
|
10
|
+
*
|
|
11
|
+
* 类似HTMLElement
|
|
12
|
+
*/
|
|
5
13
|
export declare abstract class AstElement extends AstNode {
|
|
6
14
|
#private;
|
|
7
15
|
readonly name?: string;
|
|
8
16
|
readonly data: undefined;
|
|
9
|
-
/** 子节点总数 */
|
|
17
|
+
/** number of child nodes / 子节点总数 */
|
|
10
18
|
get length(): number;
|
|
11
19
|
/**
|
|
20
|
+
* Remove a child node
|
|
21
|
+
*
|
|
12
22
|
* 移除子节点
|
|
13
|
-
* @param i 移除位置
|
|
23
|
+
* @param i position of the child node / 移除位置
|
|
14
24
|
*/
|
|
15
25
|
removeAt(i: number): AstNodes;
|
|
16
26
|
/**
|
|
27
|
+
* Insert a child node
|
|
28
|
+
*
|
|
17
29
|
* 插入子节点
|
|
18
|
-
* @param node 待插入的子节点
|
|
19
|
-
* @param i 插入位置
|
|
30
|
+
* @param node node to be inserted / 待插入的子节点
|
|
31
|
+
* @param i position to be inserted at / 插入位置
|
|
20
32
|
*/
|
|
21
33
|
insertAt<T extends AstNodes>(node: T, i?: number): T;
|
|
22
34
|
/**
|
|
23
|
-
*
|
|
35
|
+
* Get the closest ancestor node that matches the selector
|
|
36
|
+
*
|
|
37
|
+
* 最近的符合选择器的祖先节点
|
|
24
38
|
* @param selector 选择器
|
|
25
39
|
*/
|
|
26
40
|
closest<T = Token>(selector: string): T | undefined;
|
|
27
41
|
/**
|
|
42
|
+
* Get the first descendant that matches the selector
|
|
43
|
+
*
|
|
28
44
|
* 符合选择器的第一个后代节点
|
|
29
45
|
* @param selector 选择器
|
|
30
46
|
*/
|
|
31
47
|
querySelector<T = Token>(selector: string): T | undefined;
|
|
32
48
|
/**
|
|
49
|
+
* Get all descendants that match the selector
|
|
50
|
+
*
|
|
33
51
|
* 符合选择器的所有后代节点
|
|
34
52
|
* @param selector 选择器
|
|
35
53
|
*/
|
|
36
54
|
querySelectorAll<T = Token>(selector: string): T[];
|
|
37
55
|
/**
|
|
56
|
+
* Insert a batch of child nodes at the end
|
|
57
|
+
*
|
|
38
58
|
* 在末尾批量插入子节点
|
|
39
|
-
* @param elements 插入节点
|
|
59
|
+
* @param elements nodes to be inserted / 插入节点
|
|
40
60
|
*/
|
|
41
61
|
append(...elements: (AstNodes | string)[]): void;
|
|
42
62
|
/**
|
|
63
|
+
* Replace all child nodes
|
|
64
|
+
*
|
|
43
65
|
* 批量替换子节点
|
|
44
|
-
* @param elements 新的子节点
|
|
66
|
+
* @param elements nodes to be inserted / 新的子节点
|
|
45
67
|
*/
|
|
46
68
|
replaceChildren(...elements: (AstNodes | string)[]): void;
|
|
47
69
|
/**
|
|
70
|
+
* Modify the text child node
|
|
71
|
+
*
|
|
48
72
|
* 修改文本子节点
|
|
49
|
-
* @param str 新文本
|
|
50
|
-
* @param i 子节点位置
|
|
73
|
+
* @param str new text / 新文本
|
|
74
|
+
* @param i position of the text child node / 子节点位置
|
|
51
75
|
*/
|
|
52
76
|
setText(str: string, i?: number): string;
|
|
77
|
+
/**
|
|
78
|
+
* Get the caret position from the character index
|
|
79
|
+
*
|
|
80
|
+
* 找到给定位置
|
|
81
|
+
* @param index character index / 位置
|
|
82
|
+
*/
|
|
83
|
+
caretPositionFromIndex(index?: number): CaretPosition | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Get the closest ancestor element from the character index
|
|
86
|
+
*
|
|
87
|
+
* 找到给定位置所在的最内层非文本节点
|
|
88
|
+
* @param index character index / 位置
|
|
89
|
+
*/
|
|
90
|
+
elementFromIndex(index?: number): Token | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Get the closest ancestor element from the position
|
|
93
|
+
*
|
|
94
|
+
* 找到给定位置所在的最内层非文本节点
|
|
95
|
+
* @param x column number / 列数
|
|
96
|
+
* @param y line number / 行数
|
|
97
|
+
*/
|
|
98
|
+
elementFromPoint(x: number, y: number): Token | undefined;
|
|
53
99
|
}
|
package/dist/lib/element.js
CHANGED
|
@@ -5,9 +5,13 @@ const string_1 = require("../util/string");
|
|
|
5
5
|
const debug_1 = require("../util/debug");
|
|
6
6
|
const selector_1 = require("../parser/selector");
|
|
7
7
|
const node_1 = require("./node");
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* HTMLElement-like
|
|
10
|
+
*
|
|
11
|
+
* 类似HTMLElement
|
|
12
|
+
*/
|
|
9
13
|
class AstElement extends node_1.AstNode {
|
|
10
|
-
/** 子节点总数 */
|
|
14
|
+
/** number of child nodes / 子节点总数 */
|
|
11
15
|
get length() {
|
|
12
16
|
return this.childNodes.length;
|
|
13
17
|
}
|
|
@@ -17,7 +21,7 @@ class AstElement extends node_1.AstNode {
|
|
|
17
21
|
}
|
|
18
22
|
/** @private */
|
|
19
23
|
normalize() {
|
|
20
|
-
const childNodes =
|
|
24
|
+
const childNodes = this.getChildNodes();
|
|
21
25
|
/**
|
|
22
26
|
* 移除子节点
|
|
23
27
|
* @param i 移除位置
|
|
@@ -39,23 +43,29 @@ class AstElement extends node_1.AstNode {
|
|
|
39
43
|
this.setAttribute('childNodes', childNodes);
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
46
|
+
* Remove a child node
|
|
47
|
+
*
|
|
42
48
|
* 移除子节点
|
|
43
|
-
* @param i 移除位置
|
|
49
|
+
* @param i position of the child node / 移除位置
|
|
44
50
|
*/
|
|
45
51
|
removeAt(i) {
|
|
46
52
|
return (0, debug_1.setChildNodes)(this, i, 1)[0];
|
|
47
53
|
}
|
|
48
54
|
/**
|
|
55
|
+
* Insert a child node
|
|
56
|
+
*
|
|
49
57
|
* 插入子节点
|
|
50
|
-
* @param node 待插入的子节点
|
|
51
|
-
* @param i 插入位置
|
|
58
|
+
* @param node node to be inserted / 待插入的子节点
|
|
59
|
+
* @param i position to be inserted at / 插入位置
|
|
52
60
|
*/
|
|
53
61
|
insertAt(node, i = this.length) {
|
|
54
62
|
(0, debug_1.setChildNodes)(this, i, 0, [node]);
|
|
55
63
|
return node;
|
|
56
64
|
}
|
|
57
65
|
/**
|
|
58
|
-
*
|
|
66
|
+
* Get the closest ancestor node that matches the selector
|
|
67
|
+
*
|
|
68
|
+
* 最近的符合选择器的祖先节点
|
|
59
69
|
* @param selector 选择器
|
|
60
70
|
*/
|
|
61
71
|
closest(selector) {
|
|
@@ -89,6 +99,8 @@ class AstElement extends node_1.AstNode {
|
|
|
89
99
|
return undefined;
|
|
90
100
|
}
|
|
91
101
|
/**
|
|
102
|
+
* Get the first descendant that matches the selector
|
|
103
|
+
*
|
|
92
104
|
* 符合选择器的第一个后代节点
|
|
93
105
|
* @param selector 选择器
|
|
94
106
|
*/
|
|
@@ -114,6 +126,8 @@ class AstElement extends node_1.AstNode {
|
|
|
114
126
|
return descendants;
|
|
115
127
|
}
|
|
116
128
|
/**
|
|
129
|
+
* Get all descendants that match the selector
|
|
130
|
+
*
|
|
117
131
|
* 符合选择器的所有后代节点
|
|
118
132
|
* @param selector 选择器
|
|
119
133
|
*/
|
|
@@ -122,8 +136,10 @@ class AstElement extends node_1.AstNode {
|
|
|
122
136
|
return this.#getElementsBy(condition);
|
|
123
137
|
}
|
|
124
138
|
/**
|
|
139
|
+
* Insert a batch of child nodes at the end
|
|
140
|
+
*
|
|
125
141
|
* 在末尾批量插入子节点
|
|
126
|
-
* @param elements 插入节点
|
|
142
|
+
* @param elements nodes to be inserted / 插入节点
|
|
127
143
|
*/
|
|
128
144
|
append(...elements) {
|
|
129
145
|
for (const element of elements) {
|
|
@@ -131,8 +147,10 @@ class AstElement extends node_1.AstNode {
|
|
|
131
147
|
}
|
|
132
148
|
}
|
|
133
149
|
/**
|
|
150
|
+
* Replace all child nodes
|
|
151
|
+
*
|
|
134
152
|
* 批量替换子节点
|
|
135
|
-
* @param elements 新的子节点
|
|
153
|
+
* @param elements nodes to be inserted / 新的子节点
|
|
136
154
|
*/
|
|
137
155
|
replaceChildren(...elements) {
|
|
138
156
|
for (let i = this.length - 1; i >= 0; i--) {
|
|
@@ -141,9 +159,11 @@ class AstElement extends node_1.AstNode {
|
|
|
141
159
|
this.append(...elements);
|
|
142
160
|
}
|
|
143
161
|
/**
|
|
162
|
+
* Modify the text child node
|
|
163
|
+
*
|
|
144
164
|
* 修改文本子节点
|
|
145
|
-
* @param str 新文本
|
|
146
|
-
* @param i 子节点位置
|
|
165
|
+
* @param str new text / 新文本
|
|
166
|
+
* @param i position of the text child node / 子节点位置
|
|
147
167
|
*/
|
|
148
168
|
setText(str, i = 0) {
|
|
149
169
|
i += i < 0 ? this.length : 0;
|
|
@@ -156,11 +176,77 @@ class AstElement extends node_1.AstNode {
|
|
|
156
176
|
toString(skip, separator = '') {
|
|
157
177
|
return this.childNodes.map(child => child.toString(skip)).join(separator);
|
|
158
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Get the caret position from the character index
|
|
181
|
+
*
|
|
182
|
+
* 找到给定位置
|
|
183
|
+
* @param index character index / 位置
|
|
184
|
+
*/
|
|
185
|
+
caretPositionFromIndex(index) {
|
|
186
|
+
LSP: { // eslint-disable-line no-unused-labels
|
|
187
|
+
if (index === undefined) {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
const { length } = this.toString();
|
|
191
|
+
if (index > length || index < -length) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
index += index < 0 ? length : 0;
|
|
195
|
+
let self = this, acc = 0, start = 0;
|
|
196
|
+
while (self.type !== 'text') {
|
|
197
|
+
const { childNodes } = self;
|
|
198
|
+
acc += self.getAttribute('padding');
|
|
199
|
+
for (let i = 0; acc <= index && i < childNodes.length; i++) {
|
|
200
|
+
const cur = childNodes[i], { nextSibling } = cur, str = cur.toString(), l = str.length;
|
|
201
|
+
acc += l;
|
|
202
|
+
// 优先选择靠前的非文本兄弟节点,但永不进入假节点
|
|
203
|
+
if (acc > index
|
|
204
|
+
|| acc === index && l > 0 && (!nextSibling
|
|
205
|
+
|| nextSibling.type === 'text'
|
|
206
|
+
|| cur.type !== 'text' && (str.trim() || !nextSibling.toString().trim()))) {
|
|
207
|
+
self = cur;
|
|
208
|
+
acc -= l;
|
|
209
|
+
start = acc;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
acc += self.getGaps(i);
|
|
213
|
+
}
|
|
214
|
+
if (self.childNodes === childNodes) {
|
|
215
|
+
return { offsetNode: self, offset: index - start };
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return { offsetNode: self, offset: index - start };
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get the closest ancestor element from the character index
|
|
223
|
+
*
|
|
224
|
+
* 找到给定位置所在的最内层非文本节点
|
|
225
|
+
* @param index character index / 位置
|
|
226
|
+
*/
|
|
227
|
+
elementFromIndex(index) {
|
|
228
|
+
LSP: { // eslint-disable-line no-unused-labels
|
|
229
|
+
const node = this.caretPositionFromIndex(index)?.offsetNode;
|
|
230
|
+
return node?.type === 'text' ? node.parentNode : node;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get the closest ancestor element from the position
|
|
235
|
+
*
|
|
236
|
+
* 找到给定位置所在的最内层非文本节点
|
|
237
|
+
* @param x column number / 列数
|
|
238
|
+
* @param y line number / 行数
|
|
239
|
+
*/
|
|
240
|
+
elementFromPoint(x, y) {
|
|
241
|
+
// eslint-disable-next-line no-unused-labels
|
|
242
|
+
LSP: return this.elementFromIndex(this.indexFromPos(y, x));
|
|
243
|
+
}
|
|
159
244
|
/** @private */
|
|
160
245
|
lint(start = this.getAbsoluteIndex(), re) {
|
|
161
246
|
const errors = [];
|
|
162
247
|
for (let i = 0, cur = start + this.getAttribute('padding'); i < this.length; i++) {
|
|
163
248
|
const child = this.childNodes[i];
|
|
249
|
+
child.setAttribute('aIndex', cur);
|
|
164
250
|
errors.push(...child.lint(cur, re));
|
|
165
251
|
cur += child.toString().length + this.getGaps(i);
|
|
166
252
|
}
|
package/dist/lib/lsp.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Parser from '../index';
|
|
2
|
-
import type { Range, Position, ColorInformation, ColorPresentation, FoldingRange,
|
|
2
|
+
import type { Range, Position, ColorInformation, ColorPresentation, FoldingRange, DocumentLink, Location, WorkspaceEdit, Diagnostic as DiagnosticBase, TextEdit, Hover, SignatureHelp, InlayHint, CodeAction, DocumentSymbol } from 'vscode-languageserver-types';
|
|
3
3
|
import type { LanguageService as LanguageServiceBase, CompletionItem, SignatureData } from '../base';
|
|
4
|
+
declare interface Diagnostic extends DiagnosticBase {
|
|
5
|
+
data: QuickFixData[];
|
|
6
|
+
}
|
|
4
7
|
declare interface QuickFixData extends TextEdit {
|
|
5
8
|
title: string;
|
|
6
9
|
fix: boolean;
|
|
7
10
|
}
|
|
8
|
-
declare interface Diagnostic extends DiagnosticBase {
|
|
9
|
-
data: QuickFixData[];
|
|
10
|
-
}
|
|
11
11
|
export declare const tasks: WeakMap<object, Parser.LanguageService>;
|
|
12
12
|
/** VSCode-style language service */
|
|
13
13
|
export declare class LanguageService implements LanguageServiceBase {
|
|
@@ -17,84 +17,119 @@ export declare class LanguageService implements LanguageServiceBase {
|
|
|
17
17
|
/** @implements */
|
|
18
18
|
destroy(): void;
|
|
19
19
|
/**
|
|
20
|
+
* Provide color decorators
|
|
21
|
+
*
|
|
20
22
|
* 提供颜色指示
|
|
21
|
-
* @param rgba 颜色解析函数
|
|
22
|
-
* @param text 源代码
|
|
23
|
-
* @param hsl 是否允许HSL颜色
|
|
23
|
+
* @param rgba color parser / 颜色解析函数
|
|
24
|
+
* @param text source Wikitext / 源代码
|
|
25
|
+
* @param hsl whether HSL colors are treated / 是否允许HSL颜色
|
|
24
26
|
*/
|
|
25
27
|
provideDocumentColors(rgba: (s: string) => [number, number, number, number] | [], text: string, hsl?: boolean): Promise<ColorInformation[]>;
|
|
26
|
-
/** @implements */
|
|
27
|
-
provideColorPresentations(// eslint-disable-line @typescript-eslint/class-methods-use-this
|
|
28
|
-
{ color: { red, green, blue, alpha }, range }: ColorInformation): ColorPresentation[];
|
|
29
28
|
/**
|
|
29
|
+
* Provide color pickers
|
|
30
|
+
*
|
|
31
|
+
* 颜色选择器
|
|
32
|
+
* @param color color information / 颜色信息
|
|
33
|
+
*/
|
|
34
|
+
provideColorPresentations(color: ColorInformation): ColorPresentation[];
|
|
35
|
+
/**
|
|
36
|
+
* Provide auto-completion
|
|
37
|
+
*
|
|
30
38
|
* 提供自动补全
|
|
31
|
-
* @param text 源代码
|
|
39
|
+
* @param text source Wikitext / 源代码
|
|
32
40
|
* @param position 位置
|
|
33
41
|
*/
|
|
34
42
|
provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
|
|
35
43
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
44
|
+
* Provide grammar check
|
|
45
|
+
*
|
|
46
|
+
* 提供语法检查
|
|
47
|
+
* @param text source Wikitext / 源代码
|
|
48
|
+
* @param warning whether to include warnings / 是否包含警告
|
|
39
49
|
*/
|
|
40
|
-
provideDiagnostics(
|
|
50
|
+
provideDiagnostics(text: string, warning?: boolean): Promise<Diagnostic[]>;
|
|
41
51
|
/**
|
|
52
|
+
* Provide folding ranges
|
|
53
|
+
*
|
|
42
54
|
* 提供折叠范围
|
|
43
|
-
* @param text 源代码
|
|
55
|
+
* @param text source Wikitext / 源代码
|
|
44
56
|
*/
|
|
45
57
|
provideFoldingRanges(text: string): Promise<FoldingRange[]>;
|
|
46
58
|
/**
|
|
59
|
+
* Provide links
|
|
60
|
+
*
|
|
47
61
|
* 提供链接
|
|
48
|
-
* @param text 源代码
|
|
62
|
+
* @param text source Wikitext / 源代码
|
|
49
63
|
*/
|
|
50
64
|
provideLinks(text: string): Promise<DocumentLink[]>;
|
|
51
65
|
/**
|
|
66
|
+
* Provide references
|
|
67
|
+
*
|
|
52
68
|
* 提供引用
|
|
53
|
-
* @param text 源代码
|
|
69
|
+
* @param text source Wikitext / 源代码
|
|
54
70
|
* @param position 位置
|
|
55
71
|
*/
|
|
56
72
|
provideReferences(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
|
|
57
73
|
/**
|
|
74
|
+
* Provide definitions
|
|
75
|
+
*
|
|
58
76
|
* 提供定义
|
|
59
|
-
* @param text 源代码
|
|
77
|
+
* @param text source Wikitext / 源代码
|
|
60
78
|
* @param position 位置
|
|
61
79
|
*/
|
|
62
80
|
provideDefinition(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
|
|
63
81
|
/**
|
|
82
|
+
* Provide locations for renaming
|
|
83
|
+
*
|
|
64
84
|
* 提供变量更名准备
|
|
65
|
-
* @param text 源代码
|
|
85
|
+
* @param text source Wikitext / 源代码
|
|
66
86
|
* @param position 位置
|
|
67
87
|
*/
|
|
68
88
|
resolveRenameLocation(text: string, position: Position): Promise<Range | undefined>;
|
|
69
89
|
/**
|
|
90
|
+
* Provide rename edits
|
|
91
|
+
*
|
|
70
92
|
* 变量更名
|
|
71
|
-
* @param text 源代码
|
|
93
|
+
* @param text source Wikitext / 源代码
|
|
72
94
|
* @param position 位置
|
|
73
|
-
* @param newName 新名称
|
|
95
|
+
* @param newName new name / 新名称
|
|
74
96
|
*/
|
|
75
97
|
provideRenameEdits(text: string, position: Position, newName: string): Promise<WorkspaceEdit | undefined>;
|
|
76
98
|
/**
|
|
99
|
+
* Provide hover information
|
|
100
|
+
*
|
|
77
101
|
* 提供悬停信息
|
|
78
|
-
* @param text 源代码
|
|
102
|
+
* @param text source Wikitext / 源代码
|
|
79
103
|
* @param position 位置
|
|
80
104
|
*/
|
|
81
105
|
provideHover(text: string, position: Position): Promise<Hover | undefined>;
|
|
82
106
|
/**
|
|
107
|
+
* Provide signature help for magic words
|
|
108
|
+
*
|
|
83
109
|
* 提供魔术字帮助
|
|
84
|
-
* @param text 源代码
|
|
110
|
+
* @param text source Wikitext / 源代码
|
|
85
111
|
* @param position 位置
|
|
86
112
|
*/
|
|
87
113
|
provideSignatureHelp(text: string, position: Position): Promise<SignatureHelp | undefined>;
|
|
88
114
|
/**
|
|
115
|
+
* Provide CodeLens
|
|
116
|
+
*
|
|
89
117
|
* 提供 CodeLens
|
|
90
|
-
* @param text 源代码
|
|
118
|
+
* @param text source Wikitext / 源代码
|
|
91
119
|
*/
|
|
92
120
|
provideInlayHints(text: string): Promise<InlayHint[]>;
|
|
93
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Provide quick fixes
|
|
123
|
+
*
|
|
124
|
+
* 提供快速修复建议
|
|
125
|
+
* @param diagnostics grammar diagnostics / 语法诊断信息
|
|
126
|
+
*/
|
|
94
127
|
provideCodeAction(diagnostics: Diagnostic[]): CodeAction[];
|
|
95
128
|
/**
|
|
129
|
+
* Provide document sections
|
|
130
|
+
*
|
|
96
131
|
* 提供章节
|
|
97
|
-
* @param text 源代码
|
|
132
|
+
* @param text source Wikitext / 源代码
|
|
98
133
|
*/
|
|
99
134
|
provideDocumentSymbols(text: string): Promise<DocumentSymbol[]>;
|
|
100
135
|
}
|