File tree 1 file changed +6
-8
lines changed
packages/foam-vscode/src/core/model
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -104,21 +104,19 @@ export class FoamWorkspace implements IDisposable {
104
104
public getIdentifier ( forResource : URI , exclude ?: URI [ ] ) : string {
105
105
const amongst = [ ] ;
106
106
const basename = forResource . getBasename ( ) ;
107
- for ( const res of this . _resources . values ( ) ) {
108
- // skip elements that cannot possibly match
109
- if ( ! res . uri . path . endsWith ( basename ) ) {
110
- continue ;
111
- }
107
+
108
+ this . listByIdentifier ( basename ) . map ( res => {
112
109
// skip self
113
110
if ( res . uri . isEqual ( forResource ) ) {
114
- continue ;
111
+ return ;
115
112
}
113
+
116
114
// skip exclude list
117
115
if ( exclude && exclude . find ( ex => ex . isEqual ( res . uri ) ) ) {
118
- continue ;
116
+ return ;
119
117
}
120
118
amongst . push ( res . uri ) ;
121
- }
119
+ } ) ;
122
120
123
121
let identifier = FoamWorkspace . getShortestIdentifier (
124
122
forResource . path ,
You can’t perform that action at this time.
0 commit comments