Commit 031625b 1 parent 59a251c commit 031625b Copy full SHA for 031625b
File tree 1 file changed +8
-4
lines changed
packages/file-tree-next/src/browser
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -628,7 +628,11 @@ export class FileTreeService extends Tree implements IFileTreeService {
628
628
if ( rootUri . isEqualOrParent ( pathURI ) ) {
629
629
const relativePath = rootUri . relative ( pathURI ) ;
630
630
if ( relativePath ) {
631
- path = new Path ( this . root . path ) . join ( relativePath . toString ( ) ) . toString ( ) ;
631
+ if ( this . isMultipleWorkspace ) {
632
+ path = new Path ( this . root . path ) . join ( rootUri . displayName ) . join ( relativePath . toString ( ) ) . toString ( ) ;
633
+ } else {
634
+ path = new Path ( this . root . path ) . join ( relativePath . toString ( ) ) . toString ( ) ;
635
+ }
632
636
}
633
637
}
634
638
}
@@ -726,16 +730,16 @@ export class FileTreeService extends Tree implements IFileTreeService {
726
730
/**
727
731
* 将文件排序并删除多余文件(指已有父文件夹将被删除)
728
732
*/
729
- public sortPaths ( _paths : ( string | URI ) [ ] ) {
730
- const paths = _paths . slice ( ) ;
733
+ public sortPaths ( pathOrUri : ( string | URI ) [ ] ) {
734
+ const paths = pathOrUri . slice ( ) ;
731
735
const nodes = paths
732
736
. map ( ( path ) => ( {
733
737
node : this . getNodeByPathOrUri ( path ) ,
734
738
path,
735
739
} ) )
736
740
. filter ( ( node ) => node && ! ! node . node ) as ISortNode [ ] ;
737
741
738
- if ( _paths . length > 1 ) {
742
+ if ( pathOrUri . length > 1 ) {
739
743
nodes . sort ( ( pathA , pathB ) => {
740
744
// 直接获取节点深度比通过path取深度更可靠
741
745
const pathADepth = pathA . node ?. depth || 0 ;
You can’t perform that action at this time.
0 commit comments