File tree 1 file changed +18
-6
lines changed
arduino-ide-extension/src/common/protocol
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ 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 * as path from 'path' ;
15
+ import {
16
+ ARDUINO_CLOUD_FOLDER ,
17
+ REMOTE_SKETCHBOOK_FOLDER ,
18
+ } from '../../browser/utils/constants' ;
14
19
15
- const READ_ONLY_FILES = [
16
- 'thingProperties.h' ,
17
- 'thingsProperties.h' ,
18
- 'sketch.json' ,
19
- ] ;
20
+ const READ_ONLY_FILES = [ 'sketch.json' ] ;
21
+ const READ_ONLY_FILES_REMOTE = [ 'thingProperties.h' , 'thingsProperties.h' ] ;
20
22
21
23
@injectable ( )
22
24
export class SketchesServiceClientImpl
@@ -178,7 +180,17 @@ export class SketchesServiceClientImpl
178
180
if ( toCheck . scheme === 'user-storage' ) {
179
181
return false ;
180
182
}
181
- if ( READ_ONLY_FILES . includes ( toCheck ?. path ?. base ) ) {
183
+
184
+ const isCloudSketch = toCheck
185
+ . toString ( )
186
+ . includes ( path . join ( REMOTE_SKETCHBOOK_FOLDER , ARDUINO_CLOUD_FOLDER ) ) ;
187
+
188
+ const filesToCheck = [
189
+ ...READ_ONLY_FILES ,
190
+ ...( isCloudSketch ? READ_ONLY_FILES_REMOTE : [ ] ) ,
191
+ ] ;
192
+
193
+ if ( filesToCheck . includes ( toCheck ?. path ?. base ) ) {
182
194
return true ;
183
195
}
184
196
const readOnly = ! this . workspaceService
You can’t perform that action at this time.
0 commit comments