volar-service-markdown 0.0.65 → 0.0.67
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 +1 -1
- package/index.js +8 -8
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DocumentSelector, type
|
|
1
|
+
import { type DocumentSelector, type LanguageServiceContext, type LanguageServicePlugin, type ProviderResult } from '@volar/language-service';
|
|
2
2
|
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
3
3
|
import type { DiagnosticOptions, IMdLanguageService } from 'vscode-markdown-languageservice';
|
|
4
4
|
export interface Provide {
|
package/index.js
CHANGED
|
@@ -61,13 +61,13 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
61
61
|
level: vscode_markdown_languageservice_1.LogLevel.Off,
|
|
62
62
|
log(_logLevel, message) {
|
|
63
63
|
context.env.console?.log(message);
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
65
|
};
|
|
66
66
|
const parser = {
|
|
67
67
|
slugifier: vscode_markdown_languageservice_1.githubSlugifier,
|
|
68
68
|
async tokenize(document) {
|
|
69
|
-
return
|
|
70
|
-
}
|
|
69
|
+
return md.parse(document.getText(), {});
|
|
70
|
+
},
|
|
71
71
|
};
|
|
72
72
|
const workspace = getMarkdownWorkspace();
|
|
73
73
|
const mdLs = (0, vscode_markdown_languageservice_1.createLanguageService)({
|
|
@@ -90,7 +90,7 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
90
90
|
fileWatcher?.dispose();
|
|
91
91
|
},
|
|
92
92
|
provide: {
|
|
93
|
-
'markdown/languageService': () => mdLs
|
|
93
|
+
'markdown/languageService': () => mdLs,
|
|
94
94
|
},
|
|
95
95
|
provideCodeActions(document, range, context, token) {
|
|
96
96
|
if (prepare(document)) {
|
|
@@ -128,7 +128,7 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
128
128
|
const items = await mdLs.getCompletionItems(document, position, {}, token);
|
|
129
129
|
return {
|
|
130
130
|
isIncomplete: false,
|
|
131
|
-
items
|
|
131
|
+
items,
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
},
|
|
@@ -215,7 +215,7 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
215
215
|
},
|
|
216
216
|
async resolveDocumentLink(link, token) {
|
|
217
217
|
return await mdLs.resolveDocumentLink(link, token) ?? link;
|
|
218
|
-
}
|
|
218
|
+
},
|
|
219
219
|
};
|
|
220
220
|
function prepare(document) {
|
|
221
221
|
if (matchDocument(documentSelector, document)) {
|
|
@@ -280,7 +280,7 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
280
280
|
onDidCreateMarkdownDocument: onDidCreateMarkdownDocument.event,
|
|
281
281
|
onDidDeleteMarkdownDocument: onDidDeleteMarkdownDocument.event,
|
|
282
282
|
async openMarkdownDocument(resource) {
|
|
283
|
-
return
|
|
283
|
+
return getTextDocument(resource);
|
|
284
284
|
},
|
|
285
285
|
async readDirectory(resource) {
|
|
286
286
|
const directory = await fs?.readDirectory(resource) ?? [];
|
|
@@ -288,7 +288,7 @@ function create({ documentSelector = ['markdown'], fileExtensions = [
|
|
|
288
288
|
.filter(file => file[1] !== 0)
|
|
289
289
|
.map(([fileName, fileType]) => [
|
|
290
290
|
fileName,
|
|
291
|
-
{ isDirectory: fileType === 2 }
|
|
291
|
+
{ isDirectory: fileType === 2 },
|
|
292
292
|
]);
|
|
293
293
|
},
|
|
294
294
|
async stat(resource) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volar-service-markdown",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
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",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"optional": true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "7bf732781fe5900fbe0be87e993b5a74bc939aff"
|
|
45
45
|
}
|