typescript-svelte-plugin 0.3.19 → 0.3.21
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.
|
@@ -114,7 +114,7 @@ function getKitDiagnostics(methodName, fileName, info, ts, logger) {
|
|
|
114
114
|
const basename = path_1.default.basename(fileName);
|
|
115
115
|
const validExports = Object.keys(sveltekit_1.kitExports).filter((key) => (0, sveltekit_1.isKitRouteExportAllowedIn)(basename, sveltekit_1.kitExports[key]));
|
|
116
116
|
if (source && basename.startsWith('+')) {
|
|
117
|
-
const exports = svelte2tsx_1.internalHelpers.findExports(source, /* irrelevant */ false);
|
|
117
|
+
const exports = svelte2tsx_1.internalHelpers.findExports(ts, source, /* irrelevant */ false);
|
|
118
118
|
for (const exportName of exports.keys()) {
|
|
119
119
|
if (!validExports.includes(exportName) && !exportName.startsWith('_')) {
|
|
120
120
|
const node = exports.get(exportName).node;
|
|
@@ -554,7 +554,7 @@ function getProxiedLanguageService(info, ts, logger) {
|
|
|
554
554
|
return this.files[fileName];
|
|
555
555
|
}
|
|
556
556
|
upsertKitFile(fileName) {
|
|
557
|
-
const result = svelte2tsx_1.internalHelpers.upsertKitFile(fileName, {
|
|
557
|
+
const result = svelte2tsx_1.internalHelpers.upsertKitFile(ts, fileName, {
|
|
558
558
|
clientHooksPath: this.clientHooksPath,
|
|
559
559
|
paramsPath: this.paramsPath,
|
|
560
560
|
serverHooksPath: this.serverHooksPath
|
|
@@ -596,23 +596,79 @@ function getProxiedLanguageService(info, ts, logger) {
|
|
|
596
596
|
function createProxyRegistry(ts, originalLanguageServiceHost, options) {
|
|
597
597
|
// Don't destructure options param, as the value may be mutated through a svelte.config.js later
|
|
598
598
|
const registry = ts.createDocumentRegistry();
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return
|
|
599
|
+
return registry;
|
|
600
|
+
// TODO check why this fails on linux and reenable later
|
|
601
|
+
// const originalRegistry = (originalLanguageServiceHost as any).documentRegistry;
|
|
602
|
+
// const proxyRegistry: ts.DocumentRegistry = {
|
|
603
|
+
// ...originalRegistry,
|
|
604
|
+
// acquireDocumentWithKey(
|
|
605
|
+
// fileName,
|
|
606
|
+
// tsPath,
|
|
607
|
+
// compilationSettingsOrHost,
|
|
608
|
+
// key,
|
|
609
|
+
// scriptSnapshot,
|
|
610
|
+
// version,
|
|
611
|
+
// scriptKind,
|
|
612
|
+
// sourceFileOptions
|
|
613
|
+
// ) {
|
|
614
|
+
// if (internalHelpers.isKitFile(fileName, options)) {
|
|
615
|
+
// return registry.acquireDocumentWithKey(
|
|
616
|
+
// fileName,
|
|
617
|
+
// tsPath,
|
|
618
|
+
// compilationSettingsOrHost,
|
|
619
|
+
// key,
|
|
620
|
+
// scriptSnapshot,
|
|
621
|
+
// version,
|
|
622
|
+
// scriptKind,
|
|
623
|
+
// sourceFileOptions
|
|
624
|
+
// );
|
|
625
|
+
// }
|
|
626
|
+
// return originalRegistry.acquireDocumentWithKey(
|
|
627
|
+
// fileName,
|
|
628
|
+
// tsPath,
|
|
629
|
+
// compilationSettingsOrHost,
|
|
630
|
+
// key,
|
|
631
|
+
// scriptSnapshot,
|
|
632
|
+
// version,
|
|
633
|
+
// scriptKind,
|
|
634
|
+
// sourceFileOptions
|
|
635
|
+
// );
|
|
636
|
+
// },
|
|
637
|
+
// updateDocumentWithKey(
|
|
638
|
+
// fileName,
|
|
639
|
+
// tsPath,
|
|
640
|
+
// compilationSettingsOrHost,
|
|
641
|
+
// key,
|
|
642
|
+
// scriptSnapshot,
|
|
643
|
+
// version,
|
|
644
|
+
// scriptKind,
|
|
645
|
+
// sourceFileOptions
|
|
646
|
+
// ) {
|
|
647
|
+
// if (internalHelpers.isKitFile(fileName, options)) {
|
|
648
|
+
// return registry.updateDocumentWithKey(
|
|
649
|
+
// fileName,
|
|
650
|
+
// tsPath,
|
|
651
|
+
// compilationSettingsOrHost,
|
|
652
|
+
// key,
|
|
653
|
+
// scriptSnapshot,
|
|
654
|
+
// version,
|
|
655
|
+
// scriptKind,
|
|
656
|
+
// sourceFileOptions
|
|
657
|
+
// );
|
|
658
|
+
// }
|
|
659
|
+
// return originalRegistry.updateDocumentWithKey(
|
|
660
|
+
// fileName,
|
|
661
|
+
// tsPath,
|
|
662
|
+
// compilationSettingsOrHost,
|
|
663
|
+
// key,
|
|
664
|
+
// scriptSnapshot,
|
|
665
|
+
// version,
|
|
666
|
+
// scriptKind,
|
|
667
|
+
// sourceFileOptions
|
|
668
|
+
// );
|
|
669
|
+
// }
|
|
670
|
+
// };
|
|
671
|
+
// return proxyRegistry;
|
|
616
672
|
}
|
|
617
673
|
function getVirtualLS(fileName, info, ts, logger) {
|
|
618
674
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-svelte-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "A TypeScript Plugin providing Svelte intellisense",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@jridgewell/sourcemap-codec": "^1.4.14",
|
|
27
|
-
"svelte2tsx": "~0.6.
|
|
27
|
+
"svelte2tsx": "~0.6.8"
|
|
28
28
|
}
|
|
29
29
|
}
|