@@ -19,11 +19,7 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
1919 . then ( ( ) => vscode . commands . executeCommand < void > ( "workbench.action.reopenTextEditor" ) ) ;
2020 }
2121
22- async resolveCustomTextEditor (
23- document : vscode . TextDocument ,
24- webviewPanel : vscode . WebviewPanel ,
25- token : vscode . CancellationToken
26- ) : Promise < void > {
22+ async resolveCustomTextEditor ( document : vscode . TextDocument , webviewPanel : vscode . WebviewPanel ) : Promise < void > {
2723 // Check that document is a clean, well-formed class
2824 if ( document . languageId != clsLangId ) {
2925 return this . _errorMessage ( `${ document . fileName } is not a class.` ) ;
@@ -38,12 +34,11 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
3834 if ( ! file ) {
3935 return this . _errorMessage ( `${ document . fileName } is a malformed class definition.` ) ;
4036 }
41- if ( ! vscode . workspace . fs . isWritableFileSystem ( document . uri . scheme ) ) {
37+ const api = new AtelierAPI ( document . uri ) ;
38+ if ( ! vscode . workspace . fs . isWritableFileSystem ( document . uri . scheme ) && lt ( api . config . serverVersion , "2025.3.0" ) ) {
4239 return this . _errorMessage ( `File system '${ document . uri . scheme } ' is read-only.` ) ;
4340 }
44-
4541 const className = file . name . slice ( 0 , - 4 ) ;
46- const api = new AtelierAPI ( document . uri ) ;
4742 if ( ! api . active ) {
4843 return this . _errorMessage ( "Server connection is not active." ) ;
4944 }
@@ -108,7 +103,7 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
108103 </head>
109104 <body>
110105 <div id="content">
111- <iframe id="editor" title="Low-Code Editor" src="${ targetOrigin } ${ api . config . pathPrefix } ${ webApp } /index.html?$NAMESPACE=${ api . config . ns . toUpperCase ( ) } &VSCODE=1&${
106+ <iframe id="editor" title="Low-Code Editor" src="${ targetOrigin } ${ api . config . pathPrefix } ${ webApp } /index.html?$NAMESPACE=${ api . config . ns . toUpperCase ( ) } &VSCODE=1${ ! vscode . workspace . fs . isWritableFileSystem ( document . uri . scheme ) ? "&READONLY=1" : "" } &${
112107 webApp == this . _rule ? "rule" : "DTL"
113108 } =${ className } " width="100%" height="100%" frameborder="0"></iframe>
114109 </div>
0 commit comments