wikilint 2.47.0 → 2.48.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/README.md +1 -1
- package/config/.schema.json +1 -1
- package/config/default.json +1 -0
- package/config/enwiki.json +1 -0
- package/config/jawiki.json +1 -0
- package/config/zhwiki.json +1 -0
- package/data/signatures.json +20 -0
- package/dist/base.d.mts +16 -1
- package/dist/base.d.ts +16 -1
- package/dist/bin/cli.js +6 -7
- package/dist/bin/config.js +2 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -2
- package/dist/lib/document.d.ts +8 -8
- package/dist/lib/document.js +2 -4
- package/dist/lib/lsp.d.ts +9 -1
- package/dist/lib/lsp.js +106 -100
- package/dist/lib/node.js +1 -1
- package/dist/lib/text.d.ts +2 -3
- package/dist/lib/text.js +4 -5
- package/dist/parser/braces.js +3 -4
- package/dist/src/attribute.js +13 -13
- package/dist/src/converterFlags.js +14 -13
- package/dist/src/converterRule.js +1 -1
- package/dist/src/extLink.js +1 -0
- package/dist/src/index.js +3 -2
- package/dist/src/link/base.js +3 -3
- package/dist/src/link/categorytree.js +3 -4
- package/dist/src/link/file.js +8 -7
- package/dist/src/multiLine/gallery.js +1 -1
- package/dist/src/table/index.d.ts +1 -1
- package/dist/src/table/td.js +2 -2
- package/dist/src/transclude.d.ts +2 -1
- package/dist/src/transclude.js +11 -7
- package/dist/util/ajv.js +26 -0
- package/dist/util/constants.js +1 -6
- package/dist/util/string.js +1 -0
- package/package.json +18 -18
package/README.md
CHANGED
package/config/.schema.json
CHANGED
package/config/default.json
CHANGED
|
@@ -1023,6 +1023,7 @@
|
|
|
1023
1023
|
"DEFAULTSORT": "defaultsort",
|
|
1024
1024
|
"DEFAULTSORTKEY": "defaultsort",
|
|
1025
1025
|
"DEFAULTCATEGORYSORT": "defaultsort",
|
|
1026
|
+
"CATEGORYSORT": "categorysort",
|
|
1026
1027
|
"分类中页面数": "pagesincategory",
|
|
1027
1028
|
"カテゴリ内ページ数": "pagesincategory",
|
|
1028
1029
|
"PAGESINCATEGORY": "pagesincategory",
|
package/config/enwiki.json
CHANGED
|
@@ -456,6 +456,7 @@
|
|
|
456
456
|
"DEFAULTSORT": "defaultsort",
|
|
457
457
|
"DEFAULTSORTKEY": "defaultsort",
|
|
458
458
|
"DEFAULTCATEGORYSORT": "defaultsort",
|
|
459
|
+
"CATEGORYSORT": "categorysort",
|
|
459
460
|
"PAGESINCATEGORY": "pagesincategory",
|
|
460
461
|
"PAGESINCAT": "pagesincategory",
|
|
461
462
|
"PAGESIZE": "pagesize",
|
package/config/jawiki.json
CHANGED
|
@@ -546,6 +546,7 @@
|
|
|
546
546
|
"DEFAULTSORT": "defaultsort",
|
|
547
547
|
"DEFAULTSORTKEY": "defaultsort",
|
|
548
548
|
"DEFAULTCATEGORYSORT": "defaultsort",
|
|
549
|
+
"CATEGORYSORT": "categorysort",
|
|
549
550
|
"カテゴリ内ページ数": "pagesincategory",
|
|
550
551
|
"PAGESINCATEGORY": "pagesincategory",
|
|
551
552
|
"PAGESINCAT": "pagesincategory",
|
package/config/zhwiki.json
CHANGED
package/data/signatures.json
CHANGED
|
@@ -2158,6 +2158,26 @@
|
|
|
2158
2158
|
],
|
|
2159
2159
|
"description": "Used for categorizing pages, sets a default [category sort key](https://www.mediawiki.org/wiki/Help:Categories). It can take a second argument of *noerror* or *noreplace* to suppress error messages when multiple defaultsortkeys are used on one page or to make this `defaultsort` do nothing if a `defaultsort` was already specified earlier in the page."
|
|
2160
2160
|
},
|
|
2161
|
+
{
|
|
2162
|
+
"aliases": [
|
|
2163
|
+
"categorysort"
|
|
2164
|
+
],
|
|
2165
|
+
"signatures": [
|
|
2166
|
+
[
|
|
2167
|
+
{
|
|
2168
|
+
"label": "TIMESTAMP",
|
|
2169
|
+
"const": true
|
|
2170
|
+
}
|
|
2171
|
+
],
|
|
2172
|
+
[
|
|
2173
|
+
{
|
|
2174
|
+
"label": "RTIMESTAMP",
|
|
2175
|
+
"const": true
|
|
2176
|
+
}
|
|
2177
|
+
]
|
|
2178
|
+
],
|
|
2179
|
+
"description": "When placed on a category page, the category will be sorted based on timestamp of categorization. `{{CATEGORYSORT:TIMESTAMP}}` lists members by the time they were added to the category, oldest first, and `{{CATEGORYSORT:RTIMESTAMP}}` lists the most recently added members first. Readers can still override this with the `cldsort` URL parameter, and the new `cldorder=desc` URL parameter reverses a `cldsort=timestamp` listing."
|
|
2180
|
+
},
|
|
2161
2181
|
{
|
|
2162
2182
|
"aliases": [
|
|
2163
2183
|
"numberofpages"
|
package/dist/base.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Range, Position, ColorInformation, ColorPresentation, CompletionIt
|
|
|
2
2
|
export interface Config {
|
|
3
3
|
ext: string[];
|
|
4
4
|
readonly html: [string[], string[], string[]];
|
|
5
|
-
readonly namespaces: Record<
|
|
5
|
+
readonly namespaces: Record<number, string>;
|
|
6
6
|
readonly nsid: Record<string, number>;
|
|
7
7
|
readonly parserFunction: [Record<string, string>, Record<string, string>, string[], string[]];
|
|
8
8
|
readonly doubleUnderscore: [string[], string[], Record<string, string>, Record<string, string>];
|
|
@@ -117,6 +117,7 @@ export type CompletionItem = Omit<CompletionItemBase, 'kind'> & {
|
|
|
117
117
|
kind?: CompletionItemKind | keyof typeof CompletionItemKind;
|
|
118
118
|
};
|
|
119
119
|
export interface LanguageService {
|
|
120
|
+
/** @since v1.17.1 */
|
|
120
121
|
include: boolean;
|
|
121
122
|
/**
|
|
122
123
|
* Destroy the instance
|
|
@@ -147,6 +148,14 @@ export interface LanguageService {
|
|
|
147
148
|
* @param position position / 位置
|
|
148
149
|
*/
|
|
149
150
|
provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* Add additional information to a completion item
|
|
153
|
+
*
|
|
154
|
+
* 为自动补全项添加额外信息
|
|
155
|
+
* @param item completion item / 自动补全项
|
|
156
|
+
* @since v1.48.0
|
|
157
|
+
*/
|
|
158
|
+
resolveCompletionItem(item: CompletionItem): CompletionItem;
|
|
150
159
|
/**
|
|
151
160
|
* Provide grammar check
|
|
152
161
|
*
|
|
@@ -160,6 +169,7 @@ export interface LanguageService {
|
|
|
160
169
|
*
|
|
161
170
|
* 实现修复全部代码的操作
|
|
162
171
|
* @param action code action / 代码操作
|
|
172
|
+
* @since v1.24.1
|
|
163
173
|
*/
|
|
164
174
|
resolveCodeAction(action: CodeAction): CodeAction;
|
|
165
175
|
/**
|
|
@@ -182,6 +192,7 @@ export interface LanguageService {
|
|
|
182
192
|
* 提供文档高亮
|
|
183
193
|
* @param text source Wikitext / 源代码
|
|
184
194
|
* @param position position / 位置
|
|
195
|
+
* @since v1.46.1
|
|
185
196
|
*/
|
|
186
197
|
provideDocumentHighlights(text: string, position: Position): Promise<DocumentHighlight[] | undefined>;
|
|
187
198
|
/**
|
|
@@ -238,6 +249,7 @@ export interface LanguageService {
|
|
|
238
249
|
*
|
|
239
250
|
* 提供 CodeLens
|
|
240
251
|
* @param text source Wikitext / 源代码
|
|
252
|
+
* @since v1.16.3
|
|
241
253
|
*/
|
|
242
254
|
provideInlayHints(text: string): Promise<InlayHint[]>;
|
|
243
255
|
/**
|
|
@@ -246,6 +258,7 @@ export interface LanguageService {
|
|
|
246
258
|
* 提供重构操作
|
|
247
259
|
* @param text source Wikitext / 源代码
|
|
248
260
|
* @param range range of the refactoring / 重构范围
|
|
261
|
+
* @since v1.24.1
|
|
249
262
|
*/
|
|
250
263
|
provideRefactoringAction(text: string, range?: Range): Promise<CodeAction[]>;
|
|
251
264
|
/**
|
|
@@ -268,6 +281,7 @@ export interface LanguageService {
|
|
|
268
281
|
* 设置目标维基百科
|
|
269
282
|
* @param wiki Wikipedia URL / 维基百科网址
|
|
270
283
|
* @param user URI for wiki userpage or email address of the user / 维基用户页面地址或用户的电子邮件地址
|
|
284
|
+
* @since v1.18.1
|
|
271
285
|
*/
|
|
272
286
|
setTargetWikipedia(wiki: string, user: string): Promise<void>;
|
|
273
287
|
[Symbol.dispose](): void;
|
|
@@ -302,6 +316,7 @@ export interface Parser {
|
|
|
302
316
|
*
|
|
303
317
|
* 获取当前的解析设置
|
|
304
318
|
* @param config unprocessed parser configuration / 未处理的解析设置
|
|
319
|
+
* @throws `RangeError` if the configuration file path or file name is invalid
|
|
305
320
|
*/
|
|
306
321
|
getConfig(config?: ConfigData): Config;
|
|
307
322
|
/**
|
package/dist/base.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Range, Position, ColorInformation, ColorPresentation, CompletionIt
|
|
|
2
2
|
export interface Config {
|
|
3
3
|
ext: string[];
|
|
4
4
|
readonly html: [string[], string[], string[]];
|
|
5
|
-
readonly namespaces: Record<
|
|
5
|
+
readonly namespaces: Record<number, string>;
|
|
6
6
|
readonly nsid: Record<string, number>;
|
|
7
7
|
readonly parserFunction: [Record<string, string>, Record<string, string>, string[], string[]];
|
|
8
8
|
readonly doubleUnderscore: [string[], string[], Record<string, string>, Record<string, string>];
|
|
@@ -117,6 +117,7 @@ export type CompletionItem = Omit<CompletionItemBase, 'kind'> & {
|
|
|
117
117
|
kind?: CompletionItemKind | keyof typeof CompletionItemKind;
|
|
118
118
|
};
|
|
119
119
|
export interface LanguageService {
|
|
120
|
+
/** @since v1.17.1 */
|
|
120
121
|
include: boolean;
|
|
121
122
|
/**
|
|
122
123
|
* Destroy the instance
|
|
@@ -147,6 +148,14 @@ export interface LanguageService {
|
|
|
147
148
|
* @param position position / 位置
|
|
148
149
|
*/
|
|
149
150
|
provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* Add additional information to a completion item
|
|
153
|
+
*
|
|
154
|
+
* 为自动补全项添加额外信息
|
|
155
|
+
* @param item completion item / 自动补全项
|
|
156
|
+
* @since v1.48.0
|
|
157
|
+
*/
|
|
158
|
+
resolveCompletionItem(item: CompletionItem): CompletionItem;
|
|
150
159
|
/**
|
|
151
160
|
* Provide grammar check
|
|
152
161
|
*
|
|
@@ -160,6 +169,7 @@ export interface LanguageService {
|
|
|
160
169
|
*
|
|
161
170
|
* 实现修复全部代码的操作
|
|
162
171
|
* @param action code action / 代码操作
|
|
172
|
+
* @since v1.24.1
|
|
163
173
|
*/
|
|
164
174
|
resolveCodeAction(action: CodeAction): CodeAction;
|
|
165
175
|
/**
|
|
@@ -182,6 +192,7 @@ export interface LanguageService {
|
|
|
182
192
|
* 提供文档高亮
|
|
183
193
|
* @param text source Wikitext / 源代码
|
|
184
194
|
* @param position position / 位置
|
|
195
|
+
* @since v1.46.1
|
|
185
196
|
*/
|
|
186
197
|
provideDocumentHighlights(text: string, position: Position): Promise<DocumentHighlight[] | undefined>;
|
|
187
198
|
/**
|
|
@@ -238,6 +249,7 @@ export interface LanguageService {
|
|
|
238
249
|
*
|
|
239
250
|
* 提供 CodeLens
|
|
240
251
|
* @param text source Wikitext / 源代码
|
|
252
|
+
* @since v1.16.3
|
|
241
253
|
*/
|
|
242
254
|
provideInlayHints(text: string): Promise<InlayHint[]>;
|
|
243
255
|
/**
|
|
@@ -246,6 +258,7 @@ export interface LanguageService {
|
|
|
246
258
|
* 提供重构操作
|
|
247
259
|
* @param text source Wikitext / 源代码
|
|
248
260
|
* @param range range of the refactoring / 重构范围
|
|
261
|
+
* @since v1.24.1
|
|
249
262
|
*/
|
|
250
263
|
provideRefactoringAction(text: string, range?: Range): Promise<CodeAction[]>;
|
|
251
264
|
/**
|
|
@@ -268,6 +281,7 @@ export interface LanguageService {
|
|
|
268
281
|
* 设置目标维基百科
|
|
269
282
|
* @param wiki Wikipedia URL / 维基百科网址
|
|
270
283
|
* @param user URI for wiki userpage or email address of the user / 维基用户页面地址或用户的电子邮件地址
|
|
284
|
+
* @since v1.18.1
|
|
271
285
|
*/
|
|
272
286
|
setTargetWikipedia(wiki: string, user: string): Promise<void>;
|
|
273
287
|
[Symbol.dispose](): void;
|
|
@@ -302,6 +316,7 @@ export interface Parser {
|
|
|
302
316
|
*
|
|
303
317
|
* 获取当前的解析设置
|
|
304
318
|
* @param config unprocessed parser configuration / 未处理的解析设置
|
|
319
|
+
* @throws `RangeError` if the configuration file path or file name is invalid
|
|
305
320
|
*/
|
|
306
321
|
getConfig(config?: ConfigData): Config;
|
|
307
322
|
/**
|
package/dist/bin/cli.js
CHANGED
|
@@ -285,11 +285,10 @@ if (recursive) {
|
|
|
285
285
|
if (!fs_1.default.existsSync(file)) {
|
|
286
286
|
return [];
|
|
287
287
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
.map(dir => path_1.default.join(dir.parentPath, dir.name));
|
|
288
|
+
return fs_1.default.statSync(file).isFile()
|
|
289
|
+
? file
|
|
290
|
+
: fs_1.default.readdirSync(file, { recursive: true, withFileTypes: true }).filter(dir => dir.isFile())
|
|
291
|
+
.map(dir => path_1.default.join(dir.parentPath, dir.name));
|
|
293
292
|
});
|
|
294
293
|
}
|
|
295
294
|
if (exts.length > 0) {
|
|
@@ -405,9 +404,9 @@ const { mtimeMs } = fs_1.default.statSync(config), obj = cache?.[include ? 'incl
|
|
|
405
404
|
exiting ||= Boolean(nLocalErr || strict && nLocalWarn);
|
|
406
405
|
}
|
|
407
406
|
if (nErr || nWarn) {
|
|
408
|
-
console.error(styleText(['red', 'bold'], '%s'),
|
|
407
|
+
console.error(styleText(['red', 'bold'], '\n✖ %s (%s, %s)'), plural(nErr + nWarn, 'problem'), plural(nErr, 'error'), plural(nWarn, 'warning'));
|
|
409
408
|
if (nFixableErr || nFixableWarn) {
|
|
410
|
-
console.error(styleText(['red', 'bold'], '%s'),
|
|
409
|
+
console.error(styleText(['red', 'bold'], ' %s and %s potentially fixable with the `--fix` option.'), plural(nFixableErr, 'error'), plural(nFixableWarn, 'warning'));
|
|
411
410
|
}
|
|
412
411
|
console.error();
|
|
413
412
|
}
|
package/dist/bin/config.js
CHANGED
|
@@ -41,7 +41,7 @@ const filterGadget = (id) => {
|
|
|
41
41
|
const n = Number(id);
|
|
42
42
|
return n < 2300 || n > 2303; // Gadget, Gadget talk, Gadget definition, Gadget definition talk
|
|
43
43
|
};
|
|
44
|
-
const pkg = 'wikilint', version = '2.
|
|
44
|
+
const pkg = 'wikilint', version = '2.48.1';
|
|
45
45
|
/**
|
|
46
46
|
* Get the parser configuration for a Wikimedia Foundation project.
|
|
47
47
|
* @param site site nickname
|
|
@@ -49,6 +49,7 @@ const pkg = 'wikilint', version = '2.47.0';
|
|
|
49
49
|
* @param user URI for wiki userpage or email address of the user
|
|
50
50
|
* @param force whether to overwrite the existing configuration
|
|
51
51
|
* @param internal for internal use
|
|
52
|
+
* @throws `RangeError` if the site nickname or script path is missing, or Extension:CodeMirror is not installed
|
|
52
53
|
*/
|
|
53
54
|
exports.default = async (site, url, user, force, internal) => {
|
|
54
55
|
// wrong calls
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { TitleOptions } from './lib/title';
|
|
|
5
5
|
import type { LanguageService, QuickFixData } from './lib/lsp';
|
|
6
6
|
import type { Token } from './internal';
|
|
7
7
|
declare interface Parser extends ParserBase {
|
|
8
|
-
default:
|
|
8
|
+
default: this;
|
|
9
9
|
/** @since v1.5.1 */
|
|
10
10
|
readonly rules: readonly LintError.Rule[];
|
|
11
11
|
configPaths: string[];
|
|
@@ -33,6 +33,7 @@ declare interface Parser extends ParserBase {
|
|
|
33
33
|
*
|
|
34
34
|
* 获取一个WMF网站的名称
|
|
35
35
|
* @param url script path
|
|
36
|
+
* @throws `RangeError` if the URL is not a recognizable WMF site
|
|
36
37
|
* @since v1.22.0
|
|
37
38
|
*/
|
|
38
39
|
getWMFSite(url: string): [string, string];
|
|
@@ -43,6 +44,7 @@ declare interface Parser extends ParserBase {
|
|
|
43
44
|
* @param site site nickname / 网站别名
|
|
44
45
|
* @param url script path / 脚本路径
|
|
45
46
|
* @param user URI for wiki userpage or email address of the user / 维基用户页面地址或用户的电子邮件地址
|
|
47
|
+
* @throws `RangeError` if Extension:CodeMirror is not installed
|
|
46
48
|
* @since v1.18.4
|
|
47
49
|
*/
|
|
48
50
|
fetchConfig(site: string, url: string, user?: string): Promise<Config>;
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const re = new RegExp(String.raw `^https?:\/\/([^./]+)\.(${common_1.wmf})\.org`,
|
|
|
20
20
|
/**
|
|
21
21
|
* require一个JSON文件
|
|
22
22
|
* @param file 文件名
|
|
23
|
-
* @throws
|
|
23
|
+
* @throws `RangeError` 仅支持JSON文件
|
|
24
24
|
*/
|
|
25
25
|
const jsonRequire = (file) => {
|
|
26
26
|
const fullPath = require.resolve(file);
|
|
@@ -159,7 +159,7 @@ const Parser = {
|
|
|
159
159
|
for (const key of keys) {
|
|
160
160
|
const str = t[key];
|
|
161
161
|
if (str?.includes('\0')) {
|
|
162
|
-
const s = root.buildFromStr(str,
|
|
162
|
+
const s = root.buildFromStr(str, 1 /* BuildMethod.Text */);
|
|
163
163
|
if (key === 'main') {
|
|
164
164
|
t.main = s;
|
|
165
165
|
}
|
package/dist/lib/document.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Position } from 'vscode-languageserver-types';
|
|
2
2
|
import type { TextDocument, Range } from 'vscode-languageserver-textdocument';
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
3
|
+
import type * as JsonLanguageService from 'vscode-json-languageservice';
|
|
4
|
+
import type * as CssLanguageService from 'vscode-css-languageservice';
|
|
5
|
+
import type * as HtmlLanguageService from 'vscode-html-languageservice';
|
|
6
6
|
import type { PublicApi } from 'stylelint';
|
|
7
7
|
import type { Token } from '../internal';
|
|
8
8
|
export interface TexvcLocation {
|
|
@@ -32,9 +32,9 @@ declare interface Texvcjs {
|
|
|
32
32
|
}): TexvcReport;
|
|
33
33
|
}
|
|
34
34
|
export declare const loadTexvcjs: () => Texvcjs | null;
|
|
35
|
-
export declare const loadJsonLSP: () =>
|
|
36
|
-
export declare const loadCssLSP: () =>
|
|
37
|
-
export declare const loadHtmlData: () => IHTMLDataProvider | null;
|
|
35
|
+
export declare const loadJsonLSP: () => JsonLanguageService.LanguageService | null;
|
|
36
|
+
export declare const loadCssLSP: () => CssLanguageService.LanguageService | null;
|
|
37
|
+
export declare const loadHtmlData: () => HtmlLanguageService.IHTMLDataProvider | null;
|
|
38
38
|
export declare const loadStylelint: () => PublicApi | null;
|
|
39
39
|
/** embedded document */
|
|
40
40
|
declare abstract class EmbeddedDocument implements TextDocument {
|
|
@@ -65,7 +65,7 @@ declare abstract class EmbeddedDocument implements TextDocument {
|
|
|
65
65
|
}
|
|
66
66
|
/** embedded JSON document */
|
|
67
67
|
export declare class EmbeddedJSONDocument extends EmbeddedDocument {
|
|
68
|
-
jsonDoc: JSONDocument;
|
|
68
|
+
jsonDoc: JsonLanguageService.JSONDocument;
|
|
69
69
|
abstract getLineRange(): Range;
|
|
70
70
|
abstract getEOLCharacters(): string;
|
|
71
71
|
/**
|
|
@@ -76,7 +76,7 @@ export declare class EmbeddedJSONDocument extends EmbeddedDocument {
|
|
|
76
76
|
}
|
|
77
77
|
/** embedded CSS document */
|
|
78
78
|
export declare class EmbeddedCSSDocument extends EmbeddedDocument {
|
|
79
|
-
styleSheet: Stylesheet;
|
|
79
|
+
styleSheet: CssLanguageService.Stylesheet;
|
|
80
80
|
abstract getLineRange(): Range;
|
|
81
81
|
abstract getEOLCharacters(): string;
|
|
82
82
|
/**
|
package/dist/lib/document.js
CHANGED
|
@@ -27,8 +27,7 @@ let jsonLSP;
|
|
|
27
27
|
const loadJsonLSP = () => {
|
|
28
28
|
if (jsonLSP === undefined) {
|
|
29
29
|
try {
|
|
30
|
-
jsonLSP = require('vscode-json-languageservice')
|
|
31
|
-
.getLanguageService({
|
|
30
|
+
jsonLSP = require('vscode-json-languageservice').getLanguageService({
|
|
32
31
|
/* c8 ignore start */
|
|
33
32
|
/** @implements */
|
|
34
33
|
async schemaRequestService(uri) {
|
|
@@ -67,8 +66,7 @@ let cssLSP;
|
|
|
67
66
|
const loadCssLSP = () => {
|
|
68
67
|
if (cssLSP === undefined) {
|
|
69
68
|
try {
|
|
70
|
-
cssLSP = require('vscode-css-languageservice')
|
|
71
|
-
.getCSSLanguageService();
|
|
69
|
+
cssLSP = require('vscode-css-languageservice').getCSSLanguageService();
|
|
72
70
|
}
|
|
73
71
|
catch /* c8 ignore start */ {
|
|
74
72
|
cssLSP = null;
|
package/dist/lib/lsp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Parser from '../index';
|
|
2
2
|
import { Token } from '../src/index';
|
|
3
|
-
import type { Range, Position, ColorInformation, ColorPresentation, FoldingRange, DocumentLink, Location, DocumentHighlight, WorkspaceEdit, Diagnostic as DiagnosticBase, TextEdit, Hover, SignatureHelp, InlayHint, CodeAction, DocumentSymbol } from 'vscode-languageserver-types';
|
|
3
|
+
import type { Range, Position, ColorInformation, ColorPresentation, CompletionItem as CompletionItemBase, FoldingRange, DocumentLink, Location, DocumentHighlight, WorkspaceEdit, Diagnostic as DiagnosticBase, TextEdit, Hover, SignatureHelp, InlayHint, CodeAction, DocumentSymbol } from 'vscode-languageserver-types';
|
|
4
4
|
import type { Config, LanguageService as LanguageServiceBase, CompletionItem, SignatureData } from '../base';
|
|
5
5
|
import type { AttributeToken } from '../internal';
|
|
6
6
|
import type { TokenTypeMap, SelectedTokenTypes } from '../map';
|
|
@@ -41,6 +41,14 @@ export declare class LanguageService implements LanguageServiceBase {
|
|
|
41
41
|
* @param position position / 位置
|
|
42
42
|
*/
|
|
43
43
|
provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Add additional information to a completion item
|
|
46
|
+
*
|
|
47
|
+
* 为自动补全项添加额外信息
|
|
48
|
+
* @param item completion item / 自动补全项
|
|
49
|
+
* @since v1.48.0
|
|
50
|
+
*/
|
|
51
|
+
resolveCompletionItem<T extends CompletionItem | CompletionItemBase>(item: T): T;
|
|
44
52
|
/**
|
|
45
53
|
* Provide grammar check
|
|
46
54
|
*
|