File tree Expand file tree Collapse file tree 1 file changed +13
-16
lines changed
packages/language-server/src/plugins/svelte Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -166,24 +166,21 @@ export class SveltePlugin
166166 }
167167
168168 private useFallbackPreprocessor ( document : Document , foundConfig : boolean ) {
169- if (
169+ const needsConfig =
170170 document . styleInfo ?. attributes . lang ||
171171 document . styleInfo ?. attributes . type ||
172172 document . scriptInfo ?. attributes . lang ||
173- document . scriptInfo ?. attributes . type
174- ) {
175- Logger . log (
176- ( foundConfig
177- ? 'Found svelte.config.js but there was an error loading it. '
178- : 'No svelte.config.js found but one is needed. ' ) +
179- 'Using https://github.com/sveltejs/svelte-preprocess as fallback' ,
180- ) ;
181- return {
182- preprocess : importSveltePreprocess ( document . getFilePath ( ) || '' ) ( {
183- typescript : { transpileOnly : true } ,
184- } ) ,
185- } ;
186- }
187- return { } ;
173+ document . scriptInfo ?. attributes . type ;
174+ Logger . log (
175+ ( foundConfig
176+ ? 'Found svelte.config.js but there was an error loading it. '
177+ : 'No svelte.config.js found' + ( needsConfig ? ' but one is needed. ' : '. ' ) ) +
178+ 'Using https://github.com/sveltejs/svelte-preprocess as fallback' ,
179+ ) ;
180+ return {
181+ preprocess : importSveltePreprocess ( document . getFilePath ( ) || '' ) ( {
182+ typescript : { transpileOnly : true } ,
183+ } ) ,
184+ } ;
188185 }
189186}
You can’t perform that action at this time.
0 commit comments