Skip to content

Commit 7cef47d

Browse files
committed
fix: accomodate for dynamic compile options
sveltejs/svelte#17801 introduced dynamic compile options; had to adjust one occurence as a result
1 parent 2c2afcd commit 7cef47d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/language-server/src/plugins/typescript/DocumentSnapshot.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ function preprocessSvelteFile(document: Document, options: SvelteSnapshotOptions
248248
namespace: document.config?.compilerOptions?.namespace,
249249
accessors:
250250
document.config?.compilerOptions?.accessors ??
251-
document.config?.compilerOptions?.customElement,
251+
(typeof document.config?.compilerOptions?.customElement === 'function'
252+
? document.config.compilerOptions.customElement({
253+
filename: document.getFilePath() ?? ''
254+
})
255+
: document.config?.compilerOptions?.customElement),
252256
emitJsDoc: options.emitJsDoc,
253257
rewriteExternalImports: options.rewriteExternalImports
254258
});

0 commit comments

Comments
 (0)