wikiparser-node 1.15.1 → 1.16.1
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/bundle/bundle.es7.js +29 -29
- package/bundle/bundle.lsp.js +42 -0
- package/bundle/bundle.min.js +30 -30
- package/config/default.json +0 -2
- package/config/zhwiki.json +0 -2
- package/data/.schema.json +56 -0
- package/data/signatures.json +2673 -0
- package/dist/base.d.mts +217 -0
- package/dist/base.d.ts +108 -1
- package/dist/base.js +70 -64
- package/dist/base.mjs +74 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +10 -0
- package/dist/internal.d.ts +41 -41
- package/dist/lib/element.js +1 -1
- package/dist/lib/lsp.d.ts +87 -0
- package/dist/lib/lsp.js +792 -0
- package/dist/lib/node.js +2 -14
- package/dist/lib/rect.d.ts +3 -5
- package/dist/lib/rect.js +13 -10
- package/dist/lib/text.js +2 -1
- package/dist/lib/title.js +3 -0
- package/dist/src/attribute.js +3 -4
- package/dist/src/heading.js +3 -1
- package/dist/src/html.js +3 -4
- package/dist/src/magicLink.js +1 -1
- package/dist/src/nowiki/comment.d.ts +1 -1
- package/dist/src/nowiki/comment.js +1 -1
- package/dist/src/nowiki/quote.js +8 -12
- package/dist/src/transclude.js +3 -2
- package/dist/util/debug.js +13 -1
- package/dist/util/html.js +3 -1
- package/dist/util/lint.js +16 -4
- package/dist/util/sharable.js +5 -4
- package/dist/util/sharable.mjs +4 -4
- package/extensions/dist/base.js +106 -4
- package/extensions/dist/lsp.js +67 -0
- package/extensions/es7/base.js +114 -3
- package/extensions/typings.d.ts +16 -9
- package/package.json +33 -19
package/dist/internal.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export type { AstNodes
|
|
2
|
-
export type
|
|
1
|
+
export type { AstNodes } from './lib/node';
|
|
2
|
+
export type { AstText } from './lib/text';
|
|
3
3
|
export type { Token } from './src/index';
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
4
|
+
export type { RedirectToken } from './src/redirect';
|
|
5
|
+
export type { RedirectTargetToken } from './src/link/redirectTarget';
|
|
6
|
+
export type { OnlyincludeToken } from './src/onlyinclude';
|
|
7
|
+
export type { NoincludeToken } from './src/nowiki/noinclude';
|
|
8
|
+
export type { IncludeToken } from './src/tagPair/include';
|
|
9
|
+
export type { CommentToken } from './src/nowiki/comment';
|
|
10
|
+
export type { AtomToken } from './src/atom';
|
|
11
11
|
export type { AttributeToken } from './src/attribute';
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
12
|
+
export type { AttributesToken } from './src/attributes';
|
|
13
|
+
export type { ExtToken } from './src/tagPair/ext';
|
|
14
|
+
export type { HiddenToken } from './src/hidden';
|
|
15
|
+
export type { ArgToken } from './src/arg';
|
|
16
|
+
export type { SyntaxToken } from './src/syntax';
|
|
17
|
+
export type { ParameterToken } from './src/parameter';
|
|
18
|
+
export type { TranscludeToken } from './src/transclude';
|
|
19
|
+
export type { HeadingToken } from './src/heading';
|
|
20
|
+
export type { HtmlToken } from './src/html';
|
|
21
21
|
export type { TdToken } from './src/table/td';
|
|
22
|
-
export type
|
|
22
|
+
export type { TrToken } from './src/table/tr';
|
|
23
23
|
export type { TableToken } from './src/table/index';
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
24
|
+
export type { HrToken } from './src/nowiki/hr';
|
|
25
|
+
export type { DoubleUnderscoreToken } from './src/nowiki/doubleUnderscore';
|
|
26
|
+
export type { LinkToken } from './src/link/index';
|
|
27
|
+
export type { CategoryToken } from './src/link/category';
|
|
28
28
|
export type { ImageParameterToken } from './src/imageParameter';
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
29
|
+
export type { FileToken } from './src/link/file';
|
|
30
|
+
export type { GalleryImageToken } from './src/link/galleryImage';
|
|
31
|
+
export type { QuoteToken } from './src/nowiki/quote';
|
|
32
|
+
export type { MagicLinkToken } from './src/magicLink';
|
|
33
|
+
export type { ExtLinkToken } from './src/extLink';
|
|
34
34
|
export type { ListRangeToken } from './src/nowiki/listBase';
|
|
35
|
-
export type
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
38
|
-
export type
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
42
|
-
export type
|
|
43
|
-
export type
|
|
44
|
-
export type
|
|
45
|
-
export type
|
|
46
|
-
export type
|
|
47
|
-
export type
|
|
35
|
+
export type { DdToken } from './src/nowiki/dd';
|
|
36
|
+
export type { ListToken } from './src/nowiki/list';
|
|
37
|
+
export type { ConverterFlagsToken } from './src/converterFlags';
|
|
38
|
+
export type { ConverterRuleToken } from './src/converterRule';
|
|
39
|
+
export type { ConverterToken } from './src/converter';
|
|
40
|
+
export type { NowikiToken } from './src/nowiki/index';
|
|
41
|
+
export type { PreToken } from './src/pre';
|
|
42
|
+
export type { ParamTagToken } from './src/paramTag/index';
|
|
43
|
+
export type { InputboxToken } from './src/paramTag/inputbox';
|
|
44
|
+
export type { NestedToken } from './src/nested';
|
|
45
|
+
export type { GalleryToken } from './src/gallery';
|
|
46
|
+
export type { ImagemapLinkToken } from './src/imagemapLink';
|
|
47
|
+
export type { ImagemapToken } from './src/imagemap';
|
package/dist/lib/element.js
CHANGED
|
@@ -274,7 +274,7 @@ class AstElement extends node_1.AstNode {
|
|
|
274
274
|
*/
|
|
275
275
|
json(file, start = this.getAbsoluteIndex()) {
|
|
276
276
|
const json = {
|
|
277
|
-
...this,
|
|
277
|
+
...this, // eslint-disable-line @typescript-eslint/no-misused-spread
|
|
278
278
|
type: this.type,
|
|
279
279
|
range: [start, start + this.toString().length],
|
|
280
280
|
childNodes: [],
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Parser from '../index';
|
|
2
|
+
import type { Range, Position, ColorInformation, ColorPresentation, FoldingRange, DocumentSymbol, DocumentLink, Location, WorkspaceEdit, Diagnostic, Hover, CodeAction, SignatureHelp } from 'vscode-languageserver-types';
|
|
3
|
+
import type { LanguageService as LanguageServiceBase, CompletionItem, SignatureData } from '../base';
|
|
4
|
+
export declare const tasks: WeakMap<object, Parser.LanguageService>;
|
|
5
|
+
/** VSCode-style language service */
|
|
6
|
+
export declare class LanguageService implements LanguageServiceBase {
|
|
7
|
+
#private;
|
|
8
|
+
/** @param uri 任务标识 */
|
|
9
|
+
constructor(uri: object);
|
|
10
|
+
/** @implements */
|
|
11
|
+
destroy(): void;
|
|
12
|
+
/**
|
|
13
|
+
* 提供颜色指示
|
|
14
|
+
* @param rgba 颜色解析函数
|
|
15
|
+
* @param text 源代码
|
|
16
|
+
* @param hsl 是否允许HSL颜色
|
|
17
|
+
*/
|
|
18
|
+
provideDocumentColors(rgba: (s: string) => [number, number, number, number] | [], text: string, hsl?: boolean): Promise<ColorInformation[]>;
|
|
19
|
+
/** @implements */
|
|
20
|
+
provideColorPresentations(// eslint-disable-line @typescript-eslint/class-methods-use-this
|
|
21
|
+
{ color: { red, green, blue, alpha }, range }: ColorInformation): ColorPresentation[];
|
|
22
|
+
/**
|
|
23
|
+
* 提供自动补全
|
|
24
|
+
* @param text 源代码
|
|
25
|
+
* @param position 位置
|
|
26
|
+
*/
|
|
27
|
+
provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* 提供语法诊断
|
|
30
|
+
* @param wikitext 源代码
|
|
31
|
+
*/
|
|
32
|
+
provideDiagnostics(wikitext: string): Promise<Diagnostic[]>;
|
|
33
|
+
/**
|
|
34
|
+
* 提供折叠范围
|
|
35
|
+
* @param text 源代码
|
|
36
|
+
*/
|
|
37
|
+
provideFoldingRanges(text: string): Promise<FoldingRange[]>;
|
|
38
|
+
/**
|
|
39
|
+
* 提供链接
|
|
40
|
+
* @param text 源代码
|
|
41
|
+
*/
|
|
42
|
+
provideLinks(text: string): Promise<DocumentLink[]>;
|
|
43
|
+
/**
|
|
44
|
+
* 提供引用
|
|
45
|
+
* @param text 源代码
|
|
46
|
+
* @param position 位置
|
|
47
|
+
*/
|
|
48
|
+
provideReferences(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* 提供定义
|
|
51
|
+
* @param text 源代码
|
|
52
|
+
* @param position 位置
|
|
53
|
+
*/
|
|
54
|
+
provideDefinition(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* 提供变量更名准备
|
|
57
|
+
* @param text 源代码
|
|
58
|
+
* @param position 位置
|
|
59
|
+
*/
|
|
60
|
+
resolveRenameLocation(text: string, position: Position): Promise<Range | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* 变量更名
|
|
63
|
+
* @param text 源代码
|
|
64
|
+
* @param position 位置
|
|
65
|
+
* @param newName 新名称
|
|
66
|
+
*/
|
|
67
|
+
provideRenameEdits(text: string, position: Position, newName: string): Promise<WorkspaceEdit | undefined>;
|
|
68
|
+
/**
|
|
69
|
+
* 提供悬停信息
|
|
70
|
+
* @param text 源代码
|
|
71
|
+
* @param position 位置
|
|
72
|
+
*/
|
|
73
|
+
provideHover(text: string, position: Position): Promise<Hover | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* 提供魔术字帮助
|
|
76
|
+
* @param text 源代码
|
|
77
|
+
* @param position 位置
|
|
78
|
+
*/
|
|
79
|
+
provideSignatureHelp(text: string, position: Position): Promise<SignatureHelp | undefined>;
|
|
80
|
+
/** @implements */
|
|
81
|
+
provideCodeAction(diagnostics: Diagnostic[]): CodeAction[];
|
|
82
|
+
/**
|
|
83
|
+
* 提供章节
|
|
84
|
+
* @param text 源代码
|
|
85
|
+
*/
|
|
86
|
+
provideDocumentSymbols(text: string): Promise<DocumentSymbol[]>;
|
|
87
|
+
}
|