@@ -9,6 +9,7 @@ import { MainThreadDiagnosticsShape, MainContext, ExtHostDiagnosticsShape, ExtHo
9
9
import { extHostNamedCustomer , IExtHostContext } from '../../services/extensions/common/extHostCustomers.js' ;
10
10
import { IDisposable } from '../../../base/common/lifecycle.js' ;
11
11
import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js' ;
12
+ import { ResourceMap } from '../../../base/common/map.js' ;
12
13
13
14
@extHostNamedCustomer ( MainContext . MainThreadDiagnostics )
14
15
export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
@@ -35,22 +36,22 @@ export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
35
36
dispose ( ) : void {
36
37
this . _markerListener . dispose ( ) ;
37
38
for ( const owner of this . _activeOwners ) {
38
- const markersData : Map < string , { resource : URI ; local : IMarker [ ] } > = new Map ( ) ;
39
+ const markersData : ResourceMap < IMarker [ ] > = new ResourceMap < IMarker [ ] > ( ) ;
39
40
for ( const marker of this . _markerService . read ( { owner } ) ) {
40
- const resource = marker . resource . toString ( ) ;
41
- let data = markersData . get ( resource ) ;
41
+ let data = markersData . get ( marker . resource ) ;
42
42
if ( data === undefined ) {
43
- data = { resource : marker . resource , local : [ ] } ;
44
- markersData . set ( resource , data ) ;
43
+ data = [ ] ;
44
+ markersData . set ( marker . resource , data ) ;
45
45
}
46
46
if ( marker . origin !== this . extHostId ) {
47
- data . local . push ( marker ) ;
47
+ data . push ( marker ) ;
48
48
}
49
49
}
50
- for ( const { resource, local } of markersData . values ( ) ) {
50
+ for ( const [ resource , local ] of markersData . entries ( ) ) {
51
51
this . _markerService . changeOne ( owner , resource , local ) ;
52
52
}
53
53
}
54
+ this . _activeOwners . clear ( ) ;
54
55
}
55
56
56
57
private _forwardMarkers ( resources : readonly URI [ ] ) : void {
0 commit comments