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(
4545 // Replace that with one to match fileName.
4646 while ( sourceLines . length > 0 ) {
4747 const nextLine = sourceLines . shift ( ) ;
48- if ( nextLine . startsWith ( "Class " ) ) {
48+ if ( nextLine . toLowerCase ( ) . startsWith ( "class " ) ) {
4949 const classLine = nextLine . split ( " " ) ;
50+ classLine [ 0 ] = "Class" ;
5051 classLine [ 1 ] = className ;
5152 content . push ( ...preamble , classLine . join ( " " ) , ...sourceLines ) ;
5253 break ;
5354 }
5455 preamble . push ( nextLine ) ;
5556 }
57+ if ( ! content . length ) {
58+ // Transfer sourceLines verbatim in cases where no class header line is found
59+ content . push ( ...preamble ) ;
60+ }
5661 }
5762 } else {
5863 content = [ `Class ${ className } Extends %RegisteredObject` , "{" , "}" ] ;
You can’t perform that action at this time.
0 commit comments