@volar/kit 1.6.7 → 1.6.9

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.
@@ -14,11 +14,6 @@ function createLinter(config, host) {
14
14
  rootUri: vscode_uri_1.URI.file(host.getCurrentDirectory()),
15
15
  getConfiguration: section => (0, utils_1.getConfiguration)(settings, section),
16
16
  }, config, host);
17
- const formatHost = {
18
- getCurrentDirectory: () => host.getCurrentDirectory(),
19
- getCanonicalFileName: (fileName) => host.useCaseSensitiveFileNames?.() ? fileName : fileName.toLowerCase(),
20
- getNewLine: () => host.getNewLine?.() ?? '\n',
21
- };
22
17
  return {
23
18
  check,
24
19
  fixErrors,
@@ -83,7 +78,7 @@ function createLinter(config, host) {
83
78
  }
84
79
  console.log(text);
85
80
  }
86
- function formatErrors(fileName, diagnostics) {
81
+ function formatErrors(fileName, diagnostics, rootPath = process.cwd()) {
87
82
  fileName = (0, utils_1.asPosix)(fileName);
88
83
  const uri = (0, utils_1.fileNameToUri)(fileName);
89
84
  const document = service.context.getTextDocument(uri);
@@ -95,7 +90,11 @@ function createLinter(config, host) {
95
90
  length: document.offsetAt(diagnostic.range.end) - document.offsetAt(diagnostic.range.start),
96
91
  messageText: diagnostic.message,
97
92
  }));
98
- const text = ts.formatDiagnosticsWithColorAndContext(errors, formatHost);
93
+ const text = ts.formatDiagnosticsWithColorAndContext(errors, {
94
+ getCurrentDirectory: () => rootPath ?? host.getCurrentDirectory(),
95
+ getCanonicalFileName: (fileName) => host.useCaseSensitiveFileNames?.() ? fileName : fileName.toLowerCase(),
96
+ getNewLine: () => host.getNewLine?.() ?? '\n',
97
+ });
99
98
  return text;
100
99
  }
101
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/kit",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
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.7",
16
+ "@volar/language-service": "1.6.9",
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": "17154cd7d468c5b45baf50ea4b2e0f83406b6c03"
24
+ "gitHead": "e676fa08e4186bd2f8cc14861ef65f8d8c855ea1"
25
25
  }