@volar/kit 1.6.5 → 1.6.7
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/out/createFormatter.js +2 -2
- package/out/createLinter.js +4 -4
- package/package.json +3 -3
package/out/createFormatter.js
CHANGED
|
@@ -43,7 +43,7 @@ function createFormatter(config, compilerOptions = utils_1.defaultCompilerOption
|
|
|
43
43
|
const document = service.context.getTextDocument(uri);
|
|
44
44
|
if (!document)
|
|
45
45
|
throw `file not found: ${fileName}`;
|
|
46
|
-
const edits = await service.format(uri, options, undefined, undefined
|
|
46
|
+
const edits = await service.format(uri, options, undefined, undefined);
|
|
47
47
|
if (edits?.length) {
|
|
48
48
|
const newString = vscode_languageserver_textdocument_1.TextDocument.applyEdits(document, edits);
|
|
49
49
|
return newString;
|
|
@@ -55,7 +55,7 @@ function createFormatter(config, compilerOptions = utils_1.defaultCompilerOption
|
|
|
55
55
|
dummyScriptLanguageId = languageId;
|
|
56
56
|
dummyScriptVersion++;
|
|
57
57
|
const document = service.context.getTextDocument(dummyScriptUri);
|
|
58
|
-
const edits = await service.format(dummyScriptUri, options, undefined, undefined
|
|
58
|
+
const edits = await service.format(dummyScriptUri, options, undefined, undefined);
|
|
59
59
|
if (edits?.length) {
|
|
60
60
|
const newString = vscode_languageserver_textdocument_1.TextDocument.applyEdits(document, edits);
|
|
61
61
|
return newString;
|
package/out/createLinter.js
CHANGED
|
@@ -41,10 +41,10 @@ function createLinter(config, host) {
|
|
|
41
41
|
const document = service.context.getTextDocument(uri);
|
|
42
42
|
if (document) {
|
|
43
43
|
const range = { start: document.positionAt(0), end: document.positionAt(document.getText().length) };
|
|
44
|
-
const codeActions = await service.doCodeActions(uri, range, { diagnostics, only, triggerKind:
|
|
44
|
+
const codeActions = await service.doCodeActions(uri, range, { diagnostics, only, triggerKind: 1 });
|
|
45
45
|
if (codeActions) {
|
|
46
46
|
for (let i = 0; i < codeActions.length; i++) {
|
|
47
|
-
codeActions[i] = await service.doCodeActionResolve(codeActions[i]
|
|
47
|
+
codeActions[i] = await service.doCodeActionResolve(codeActions[i]);
|
|
48
48
|
}
|
|
49
49
|
const edits = codeActions.map(codeAction => codeAction.edit).filter((edit) => !!edit);
|
|
50
50
|
if (edits.length) {
|
|
@@ -61,7 +61,7 @@ function createLinter(config, host) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
for (const change of rootEdit.documentChanges ?? []) {
|
|
64
|
-
if (
|
|
64
|
+
if ('textDocument' in change) {
|
|
65
65
|
const editDocument = service.context.getTextDocument(change.textDocument.uri);
|
|
66
66
|
if (editDocument) {
|
|
67
67
|
const newString = vscode_languageserver_textdocument_1.TextDocument.applyEdits(editDocument, change.edits);
|
|
@@ -88,7 +88,7 @@ function createLinter(config, host) {
|
|
|
88
88
|
const uri = (0, utils_1.fileNameToUri)(fileName);
|
|
89
89
|
const document = service.context.getTextDocument(uri);
|
|
90
90
|
const errors = diagnostics.map(diagnostic => ({
|
|
91
|
-
category: diagnostic.severity ===
|
|
91
|
+
category: diagnostic.severity === 1 ? ts.DiagnosticCategory.Error : ts.DiagnosticCategory.Warning,
|
|
92
92
|
code: diagnostic.code,
|
|
93
93
|
file: ts.createSourceFile(fileName, document.getText(), ts.ScriptTarget.JSON),
|
|
94
94
|
start: document.offsetAt(diagnostic.range.start),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/kit",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/kit"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-service": "1.6.
|
|
16
|
+
"@volar/language-service": "1.6.7",
|
|
17
17
|
"typesafe-path": "^0.2.2",
|
|
18
18
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
19
19
|
"vscode-uri": "^3.0.7"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "17154cd7d468c5b45baf50ea4b2e0f83406b6c03"
|
|
25
25
|
}
|