File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/providers/FileSystemProvider Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,19 @@ export function generateFileContent(
45
45
// Replace that with one to match fileName.
46
46
while ( sourceLines . length > 0 ) {
47
47
const nextLine = sourceLines . shift ( ) ;
48
- if ( nextLine . startsWith ( "Class " ) ) {
48
+ if ( nextLine . toLowerCase ( ) . startsWith ( "class " ) ) {
49
49
const classLine = nextLine . split ( " " ) ;
50
+ classLine [ 0 ] = "Class" ;
50
51
classLine [ 1 ] = className ;
51
52
content . push ( ...preamble , classLine . join ( " " ) , ...sourceLines ) ;
52
53
break ;
53
54
}
54
55
preamble . push ( nextLine ) ;
55
56
}
57
+ if ( ! content . length ) {
58
+ // Transfer sourceLines verbatim in cases where no class header line is found
59
+ content . push ( ...preamble ) ;
60
+ }
56
61
}
57
62
} else {
58
63
content = [ `Class ${ className } Extends %RegisteredObject` , "{" , "}" ] ;
You can’t perform that action at this time.
0 commit comments