File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/language-server/src/plugins/svelte Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte-language-server ' : patch
3+ ---
4+
5+ fix: support experimental feature in "Show compiled Code"
Original file line number Diff line number Diff line change @@ -110,8 +110,13 @@ export class SveltePlugin
110110 async getCompiledResult ( document : Document ) : Promise < SvelteCompileResult | null > {
111111 try {
112112 const svelteDoc = await this . getSvelteDoc ( document ) ;
113- // @ts -ignore is 'client' in Svelte 5
114- return svelteDoc . getCompiledWith ( { generate : 'dom' } ) ;
113+ const options : any = { generate : 'dom' } ; // 'client' in Svelte 5
114+ // @ts -ignore Svelte 5 only; we gotta write it like this else Svelte 4 fails on unknown key
115+ if ( document . config ?. compilerOptions ?. experimental ) {
116+ // @ts -ignore Svelte 5 only
117+ options . experimental = document . config . compilerOptions . experimental ;
118+ }
119+ return await svelteDoc . getCompiledWith ( options ) ;
115120 } catch ( error ) {
116121 return null ;
117122 }
You can’t perform that action at this time.
0 commit comments