File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -296,10 +296,13 @@ export const createTypeScriptSandbox = (
296
296
}
297
297
298
298
/** Gets the results of compiling your editor's code */
299
- const getEmitResult = async ( ) => {
299
+ const getEmitResult = async (
300
+ emitOnlyDtsFiles ?: boolean ,
301
+ forceDtsEmit ?: boolean
302
+ ) => {
300
303
const model = editor . getModel ( ) !
301
304
const client = await getWorkerProcess ( )
302
- return await client . getEmitOutput ( model . uri . toString ( ) )
305
+ return await client . getEmitOutput ( model . uri . toString ( ) , emitOnlyDtsFiles , forceDtsEmit )
303
306
}
304
307
305
308
/** Gets the JS of compiling your editor's code */
@@ -318,7 +321,7 @@ export const createTypeScriptSandbox = (
318
321
319
322
/** Gets the DTS for the JS/TS of compiling your editor's code */
320
323
const getDTSForCode = async ( ) => {
321
- const result = await getEmitResult ( )
324
+ const result = await getEmitResult ( /*emitOnlyDtsFiles*/ undefined , /*forceDtsEmit*/ true )
322
325
return result . outputFiles . find ( ( o : any ) => o . name . endsWith ( ".d.ts" ) ) ?. text || ""
323
326
}
324
327
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export declare class TypeScriptWorker implements ts.LanguageServiceHost {
53
53
providePrefixAndSuffixTextForRename : boolean
54
54
) : Promise < readonly ts . RenameLocation [ ] | undefined >
55
55
getRenameInfo ( fileName : string , position : number , options : ts . RenameInfoOptions ) : Promise < ts . RenameInfo >
56
- getEmitOutput ( fileName : string ) : Promise < ts . EmitOutput >
56
+ getEmitOutput ( fileName : string , emitOnlyDtsFiles ?: boolean , forceDtsEmit ?: boolean ) : Promise < ts . EmitOutput >
57
57
getCodeFixesAtPosition (
58
58
fileName : string ,
59
59
start : number ,
You can’t perform that action at this time.
0 commit comments