File tree 2 files changed +19
-6
lines changed
arduino-ide-extension/src
2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change
1
+ export const REMOTE_SKETCHBOOK_FOLDER = 'RemoteSketchbook' ;
2
+ export const ARDUINO_CLOUD_FOLDER = 'ArduinoCloud' ;
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser/fronten
11
11
import { Sketch , SketchesService } from '../../common/protocol' ;
12
12
import { ConfigService } from './config-service' ;
13
13
import { SketchContainer } from './sketches-service' ;
14
+ import {
15
+ ARDUINO_CLOUD_FOLDER ,
16
+ REMOTE_SKETCHBOOK_FOLDER ,
17
+ } from '../../browser/utils/constants' ;
14
18
15
- const READ_ONLY_FILES = [
16
- 'thingProperties.h' ,
17
- 'thingsProperties.h' ,
18
- 'sketch.json' ,
19
- ] ;
19
+ const READ_ONLY_FILES = [ 'sketch.json' ] ;
20
+ const READ_ONLY_FILES_REMOTE = [ 'thingProperties.h' , 'thingsProperties.h' ] ;
20
21
21
22
@injectable ( )
22
23
export class SketchesServiceClientImpl
@@ -178,7 +179,17 @@ export class SketchesServiceClientImpl
178
179
if ( toCheck . scheme === 'user-storage' ) {
179
180
return false ;
180
181
}
181
- if ( READ_ONLY_FILES . includes ( toCheck ?. path ?. base ) ) {
182
+
183
+ const isCloudSketch = toCheck
184
+ . toString ( )
185
+ . includes ( `${ REMOTE_SKETCHBOOK_FOLDER } /${ ARDUINO_CLOUD_FOLDER } ` ) ;
186
+
187
+ const filesToCheck = [
188
+ ...READ_ONLY_FILES ,
189
+ ...( isCloudSketch ? READ_ONLY_FILES_REMOTE : [ ] ) ,
190
+ ] ;
191
+
192
+ if ( filesToCheck . includes ( toCheck ?. path ?. base ) ) {
182
193
return true ;
183
194
}
184
195
const readOnly = ! this . workspaceService
You can’t perform that action at this time.
0 commit comments