@@ -9,27 +9,43 @@ import { Marker } from '@theia/markers/lib/common/marker';
9
9
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser/problem/problem-manager' ;
10
10
import { ConfigServiceClient } from '../../config/config-service-client' ;
11
11
import debounce from 'lodash.debounce' ;
12
+ import {
13
+ ARDUINO_CLOUD_FOLDER ,
14
+ REMOTE_SKETCHBOOK_FOLDER ,
15
+ } from '../../utils/constants' ;
12
16
13
17
@injectable ( )
14
18
export class ProblemManager extends TheiaProblemManager {
15
19
@inject ( ConfigServiceClient )
16
20
private readonly configService : ConfigServiceClient ;
17
21
18
22
private dataDirUri : URI | undefined ;
23
+ private cloudCacheDirUri : URI | undefined ;
19
24
20
25
@postConstruct ( )
21
26
protected override init ( ) : void {
22
27
super . init ( ) ;
23
28
this . dataDirUri = this . configService . tryGetDataDirUri ( ) ;
24
- this . configService . onDidChangeDataDirUri ( ( uri ) => ( this . dataDirUri = uri ) ) ;
29
+ this . configService . onDidChangeDataDirUri ( ( uri ) => {
30
+ this . dataDirUri = uri ;
31
+ this . cloudCacheDirUri = this . dataDirUri
32
+ ?. resolve ( REMOTE_SKETCHBOOK_FOLDER )
33
+ . resolve ( ARDUINO_CLOUD_FOLDER ) ;
34
+ } ) ;
25
35
}
26
36
27
37
override setMarkers (
28
38
uri : URI ,
29
39
owner : string ,
30
40
data : Diagnostic [ ]
31
41
) : Marker < Diagnostic > [ ] {
32
- if ( this . dataDirUri && this . dataDirUri . isEqualOrParent ( uri ) ) {
42
+ if (
43
+ this . dataDirUri &&
44
+ this . dataDirUri . isEqualOrParent ( uri ) &&
45
+ this . cloudCacheDirUri && // Do not disable the diagnostics for cloud sketches https://github.com/arduino/arduino-ide/issues/669
46
+ ! this . cloudCacheDirUri . isEqualOrParent ( uri )
47
+ ) {
48
+ // If in directories.data folder but not in the cloud sketchbook cache folder.
33
49
return [ ] ;
34
50
}
35
51
return super . setMarkers ( uri , owner , data ) ;
0 commit comments