vscode-objectscript
                                
                                
                                
                                    vscode-objectscript copied to clipboard
                            
                            
                            
                        Custom background color for Generated
The proposed realization for the discussed topic #987
This is ugly because it affects other visible editors, not just the one that contains generated code.
There is a better way using TextEditorDecorationType
const readonlyDocumentDecorationType = vscode.window.createTextEditorDecorationType({ isWholeLine: true, backgroundColor: new vscode.ThemeColor('objectscript.generatedCodeBackground') });Then use TextEditor's setDecorations method for every line of an editor containing generated code.
For best results use some transparency on the colors you choose.
Yeah, ugly, but, offered way probably not so better, but, I can try it, thanks
@daimor @gjsjohnmurray Is it possible to add an extra icon to the editor tab instead of changing the background color? That would be less intrusive IMO and would remove the need to coordinate colors with themes and possibly introduce accessibility concerns. Or maybe we could have a warning modal pop up if you edit a generated file (its state changes from clean to dirty). I'm not sure if either of those are definitely better than changing the background color but I don't think we should be restricted to that just because of Studio.
Is it possible to add an extra icon to the editor tab
We could experiment with FileDecorationProvider. Perhaps use 'G' as the badge property of the FileDecoration and 'Generated' as the tooltip. Or even add info to the tooltip to say what it is generated from.
Closing in favor of #1035