volar-service-markdown 0.0.21 → 0.0.23
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/index.d.ts +15 -0
- package/{out/index.js → index.js} +7 -12
- package/package.json +4 -5
- package/out/index.d.ts +0 -7
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ServicePlugin } from '@volar/language-service';
|
|
2
|
+
import type { IMdLanguageService } from 'vscode-markdown-languageservice';
|
|
3
|
+
export interface Provide {
|
|
4
|
+
'markdown/languageService': () => IMdLanguageService;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The section to use for configuring validation options.
|
|
9
|
+
*
|
|
10
|
+
* @example 'markdown.validate'
|
|
11
|
+
*/
|
|
12
|
+
configurationSection: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function create(options: CreateOptions): ServicePlugin;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -15,11 +15,11 @@ function assert(condition, message) {
|
|
|
15
15
|
throw new Error(message);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function create() {
|
|
18
|
+
function create(options) {
|
|
19
19
|
return {
|
|
20
20
|
create(context) {
|
|
21
21
|
let lastProjectVersion;
|
|
22
|
-
const { fs, onDidChangeWatchedFiles } = context.env;
|
|
22
|
+
const { fs, getConfiguration, onDidChangeWatchedFiles } = context.env;
|
|
23
23
|
assert(fs, 'context.env.fs must be defined');
|
|
24
24
|
assert(onDidChangeWatchedFiles, 'context.env.fs.onDidChangeWatchedFiles must be defined');
|
|
25
25
|
const logger = {
|
|
@@ -178,17 +178,12 @@ function create() {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
|
-
provideDiagnostics(document, token) {
|
|
181
|
+
async provideDiagnostics(document, token) {
|
|
182
182
|
if (prepare(document)) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
validateFragmentLinks: vscode_markdown_languageservice_1.DiagnosticLevel.warning,
|
|
188
|
-
validateMarkdownFileLinkFragments: vscode_markdown_languageservice_1.DiagnosticLevel.warning,
|
|
189
|
-
validateReferences: vscode_markdown_languageservice_1.DiagnosticLevel.warning,
|
|
190
|
-
validateUnusedLinkDefinitions: vscode_markdown_languageservice_1.DiagnosticLevel.warning
|
|
191
|
-
}, token);
|
|
183
|
+
const configuration = await getConfiguration?.(options.configurationSection, document.uri);
|
|
184
|
+
if (configuration) {
|
|
185
|
+
return ls.computeDiagnostics(document, configuration, token);
|
|
186
|
+
}
|
|
192
187
|
}
|
|
193
188
|
},
|
|
194
189
|
provideDocumentHighlights(document, position, token) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volar-service-markdown",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "Integrate vscode-markdown-languageservice into Volar",
|
|
5
5
|
"homepage": "https://github.com/volarjs/services/tree/master/packages/markdown",
|
|
6
6
|
"bugs": "https://github.com/volarjs/services/issues",
|
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
"keywords": [
|
|
9
9
|
"volar-service"
|
|
10
10
|
],
|
|
11
|
-
"main": "out/index.js",
|
|
12
11
|
"license": "MIT",
|
|
13
12
|
"files": [
|
|
14
|
-
"
|
|
15
|
-
"
|
|
13
|
+
"**/*.js",
|
|
14
|
+
"**/*.d.ts"
|
|
16
15
|
],
|
|
17
16
|
"repository": {
|
|
18
17
|
"type": "git",
|
|
@@ -42,5 +41,5 @@
|
|
|
42
41
|
"optional": true
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0090e6286c521d185e52e0f02c8eeb237ea4e54d"
|
|
46
45
|
}
|
package/out/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ServicePlugin } from '@volar/language-service';
|
|
2
|
-
import type { IMdLanguageService } from 'vscode-markdown-languageservice';
|
|
3
|
-
export interface Provide {
|
|
4
|
-
'markdown/languageService': () => IMdLanguageService;
|
|
5
|
-
}
|
|
6
|
-
export declare function create(): ServicePlugin;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|