@astrojs/ts-plugin 1.1.2 → 1.1.3

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/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,11 +10,13 @@ const init = (modules) => {
10
10
  const virtualFiles = (0, language_core_1.createVirtualFiles)([(0, language_js_1.getLanguageModule)(ts)]);
11
11
  (0, typescript_1.decorateLanguageService)(virtualFiles, info.languageService, true);
12
12
  (0, typescript_1.decorateLanguageServiceHost)(virtualFiles, info.languageServiceHost, ts, ['.astro']);
13
+ // HACK: AutoImportProviderProject's script kind does not match the one of the language service host here
14
+ // this causes TypeScript to throw and crash. So, we'll fake being a TS file here for now until they fix it
13
15
  const getScriptKind = info.languageServiceHost.getScriptKind?.bind(info.languageServiceHost.getScriptKind);
14
16
  if (getScriptKind) {
15
17
  info.languageServiceHost.getScriptKind = (fileName) => {
16
18
  if (fileName.endsWith('.astro')) {
17
- return ts.ScriptKind.TSX;
19
+ return ts.ScriptKind.TS;
18
20
  }
19
21
  return getScriptKind(fileName);
20
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/ts-plugin",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A TypeScript Plugin providing Astro intellisense",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",