Skip to content

Commit 75f2595

Browse files
Fix component transpiling
1 parent 7a7ca31 commit 75f2595

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/bscPlugin/fileProviders/ComponentStatementProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class ComponentStatementProvider {
7979
private registerCodebehind(name: string, statement: ComponentStatement, destDir: string) {
8080
//create the codebehind file
8181
const file = this.event.fileFactory.BrsFile({
82-
srcPath: `virtual:/${destDir}/${name}.codebehind.brs`,
82+
srcPath: `virtual:/${destDir}/${name}.codebehind.bs`,
8383
destPath: `${destDir}/${name}.codebehind.brs`
8484
});
8585
const initStatements: Statement[] = [];

src/bscPlugin/fileProviders/FileProvider.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import type { ProvideFileEvent } from '../../interfaces';
22
import chalk from 'chalk';
33
import { LogLevel } from '../../Logger';
4+
import { ComponentStatementProvider } from './ComponentStatementProvider';
45

56
export class FileProvider {
67
constructor(
78
private event: ProvideFileEvent
8-
) { }
9+
) {
10+
this.componentStatementProvider = new ComponentStatementProvider(event);
11+
}
12+
13+
private componentStatementProvider: ComponentStatementProvider;
914

1015
public process() {
1116
//if the event already has a file for this path, assume some other plugin has processed this event already
@@ -37,6 +42,9 @@ export class FileProvider {
3742
});
3843

3944
this.event.files.push(file);
45+
46+
//emit virtual files for each component statement
47+
this.componentStatementProvider.process(file);
4048
}
4149

4250
private handleXmlFile() {

0 commit comments

Comments
 (0)