File tree Expand file tree Collapse file tree
packages/file-tree-next/src/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -628,7 +628,11 @@ export class FileTreeService extends Tree implements IFileTreeService {
628628 if ( rootUri . isEqualOrParent ( pathURI ) ) {
629629 const relativePath = rootUri . relative ( pathURI ) ;
630630 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+ }
632636 }
633637 }
634638 }
@@ -726,16 +730,16 @@ export class FileTreeService extends Tree implements IFileTreeService {
726730 /**
727731 * 将文件排序并删除多余文件(指已有父文件夹将被删除)
728732 */
729- public sortPaths ( _paths : ( string | URI ) [ ] ) {
730- const paths = _paths . slice ( ) ;
733+ public sortPaths ( pathOrUri : ( string | URI ) [ ] ) {
734+ const paths = pathOrUri . slice ( ) ;
731735 const nodes = paths
732736 . map ( ( path ) => ( {
733737 node : this . getNodeByPathOrUri ( path ) ,
734738 path,
735739 } ) )
736740 . filter ( ( node ) => node && ! ! node . node ) as ISortNode [ ] ;
737741
738- if ( _paths . length > 1 ) {
742+ if ( pathOrUri . length > 1 ) {
739743 nodes . sort ( ( pathA , pathB ) => {
740744 // 直接获取节点深度比通过path取深度更可靠
741745 const pathADepth = pathA . node ?. depth || 0 ;
You can’t perform that action at this time.
0 commit comments