Skip to content

Commit

Permalink
fix: make editor readonly if resource is readonly
Browse files Browse the repository at this point in the history
Closes: #1501
Ref: eclipse-theia/theia#12354
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Sep 29, 2023
1 parent 28e00dd commit 368ea63
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export class MonacoTextModelService extends TheiaMonacoTextModelService {
const factory = this.factories
.getContributions()
.find(({ scheme }) => resource.uri.scheme === scheme);
const readOnly = this.sketchesServiceClient.isReadOnly(resource.uri);
const readOnly =
Boolean(resource.isReadonly) ||
this.sketchesServiceClient.isReadOnly(resource.uri);
return factory
? factory.createModel(resource)
: new MaybeReadonlyMonacoEditorModel(
Expand Down

0 comments on commit 368ea63

Please sign in to comment.