File tree 2 files changed +23
-17
lines changed
2 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -549,21 +549,22 @@ function getRelativePathsInProject(query) {
549
549
var project = getOrCreateProject ( query . filePath ) ;
550
550
var sourceDir = path . dirname ( query . filePath ) ;
551
551
var filePaths = project . projectFile . project . files . filter ( function ( p ) { return p !== query . filePath ; } ) ;
552
- var files = filePaths . map ( function ( p ) {
553
- return {
554
- name : path . basename ( p , '.ts' ) ,
555
- relativePath : tsconfig . removeExt ( tsconfig . makeRelativePath ( sourceDir , p ) ) ,
556
- fullPath : p
557
- } ;
558
- } ) ;
552
+ var files = [ ] ;
559
553
if ( query . includeExternalModules ) {
560
554
var externalModules = getExternalModules_1 . getExternalModuleNames ( project . languageService . getProgram ( ) ) ;
561
555
externalModules . forEach ( function ( e ) { return files . push ( {
562
- name : "module \"" + e + "\"" ,
556
+ name : "" + e ,
563
557
relativePath : e ,
564
558
fullPath : e
565
559
} ) ; } ) ;
566
560
}
561
+ filePaths . forEach ( function ( p ) {
562
+ files . push ( {
563
+ name : path . basename ( p , '.ts' ) ,
564
+ relativePath : tsconfig . removeExt ( tsconfig . makeRelativePath ( sourceDir , p ) ) ,
565
+ fullPath : p
566
+ } ) ;
567
+ } ) ;
567
568
var endsInPunctuation = prefixEndsInPunctuation ( query . prefix ) ;
568
569
if ( ! endsInPunctuation )
569
570
files = fuzzaldrin . filter ( files , query . prefix , { key : 'name' } ) ;
Original file line number Diff line number Diff line change @@ -844,24 +844,29 @@ export function getRelativePathsInProject(query: GetRelativePathsInProjectQuery)
844
844
var project = getOrCreateProject ( query . filePath ) ;
845
845
var sourceDir = path . dirname ( query . filePath ) ;
846
846
var filePaths = project . projectFile . project . files . filter ( p => p !== query . filePath ) ;
847
-
848
- var files = filePaths . map ( p => {
849
- return {
850
- name : path . basename ( p , '.ts' ) ,
851
- relativePath : tsconfig . removeExt ( tsconfig . makeRelativePath ( sourceDir , p ) ) ,
852
- fullPath : p
853
- } ;
854
- } ) ;
847
+ var files : {
848
+ name : string ;
849
+ relativePath : string ;
850
+ fullPath : string ;
851
+ } [ ] = [ ] ;
855
852
856
853
if ( query . includeExternalModules ) {
857
854
var externalModules = getExternalModuleNames ( project . languageService . getProgram ( ) ) ;
858
855
externalModules . forEach ( e => files . push ( {
859
- name : `module " ${ e } " ` ,
856
+ name : `${ e } ` ,
860
857
relativePath : e ,
861
858
fullPath : e
862
859
} ) ) ;
863
860
}
864
861
862
+ filePaths . forEach ( p => {
863
+ files . push ( {
864
+ name : path . basename ( p , '.ts' ) ,
865
+ relativePath : tsconfig . removeExt ( tsconfig . makeRelativePath ( sourceDir , p ) ) ,
866
+ fullPath : p
867
+ } ) ;
868
+ } ) ;
869
+
865
870
var endsInPunctuation : boolean = prefixEndsInPunctuation ( query . prefix ) ;
866
871
867
872
if ( ! endsInPunctuation )
You can’t perform that action at this time.
0 commit comments