vscode-objectscript icon indicating copy to clipboard operation
vscode-objectscript copied to clipboard

Custom background color for Generated

Open daimor opened this issue 3 years ago • 3 comments

The proposed realization for the discussed topic #987

daimor avatar Sep 27 '22 12:09 daimor

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 avatar Sep 27 '22 14:09 daimor

@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.

isc-bsaviano avatar Sep 27 '22 19:09 isc-bsaviano

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.

gjsjohnmurray avatar Sep 27 '22 23:09 gjsjohnmurray

Closing in favor of #1035

isc-bsaviano avatar Dec 27 '22 14:12 isc-bsaviano