@volar/monaco 2.1.0 → 2.1.2

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.
Files changed (2) hide show
  1. package/lib/ata.js +5 -5
  2. package/package.json +4 -4
package/lib/ata.js CHANGED
@@ -32,21 +32,21 @@ export function activateAutomaticTypeAcquisition(env, onFetch) {
32
32
  };
33
33
  }
34
34
  if (fileName.startsWith('/node_modules/')) {
35
- const path = uri.substring('/node_modules/'.length);
35
+ const path = fileName.substring('/node_modules/'.length);
36
36
  return await _stat(path);
37
37
  }
38
38
  },
39
39
  async readFile(uri) {
40
40
  const fileName = env.typescript.uriToFileName(uri);
41
41
  if (fileName.startsWith('/node_modules/')) {
42
- const path = uri.substring('/node_modules/'.length);
42
+ const path = fileName.substring('/node_modules/'.length);
43
43
  return await _readFile(path);
44
44
  }
45
45
  },
46
46
  async readDirectory(uri) {
47
47
  const fileName = env.typescript.uriToFileName(uri);
48
48
  if (fileName.startsWith('/node_modules/')) {
49
- const path = uri.substring('/node_modules/'.length);
49
+ const path = fileName.substring('/node_modules/'.length);
50
50
  return _readDirectory(path);
51
51
  }
52
52
  return [];
@@ -185,10 +185,10 @@ export function activateAutomaticTypeAcquisition(env, onFetch) {
185
185
  const parts = path.split('/');
186
186
  let pkgName = parts[0];
187
187
  if (pkgName.startsWith('@')) {
188
- if (parts.length < 2 || !parts[1]) {
188
+ if (!parts[1]) {
189
189
  return undefined;
190
190
  }
191
- pkgName += '/' + parts[2];
191
+ pkgName += '/' + parts[1];
192
192
  }
193
193
  return pkgName;
194
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/monaco",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -13,8 +13,8 @@
13
13
  "directory": "packages/monaco"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-service": "2.1.0",
17
- "@volar/typescript": "2.1.0",
16
+ "@volar/language-service": "2.1.2",
17
+ "@volar/typescript": "2.1.2",
18
18
  "monaco-languageserver-types": "^0.3.3",
19
19
  "monaco-types": "^0.1.0",
20
20
  "vscode-uri": "^3.0.8"
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "monaco-editor-core": "latest"
24
24
  },
25
- "gitHead": "09e1792f0adafb02caf89a5a45a6fcaaf3177808"
25
+ "gitHead": "12b960d5d524fd5f5521374c579cb139dfc4c365"
26
26
  }