Add text overlay to simplify code reading in visual studio code
While coding compute shaders in Godot with lots of vec4[] buffer , because of the maximum channel is 4 , I have to define more and more buffers, like :
layout(set = 0, binding = 3, std430) restrict buffer b_biomes_define { vec4 biomes_define[]; };
layout(set = 0, binding = 4, std430) restrict buffer b_details_define { vec4 details_define[]; };
layout(set = 0, binding = 5, std430) restrict buffer b_flags_int { ivec4 flags_int[];
// ……As a result , the shader code become more and more messy: fabiospampinato/vscode-highlight#172
And I tend to forget the real parameter name.
I need to display text overlay as a decoration like : fabiospampinato/vscode-highlight#172
Notice how the original text is covered with "hello" as a hint.
css (by grok) :
span.ced-1-TextEditorDecorationType702-1::after {
content: "hello";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
white-space: nowrap;
font-size: inherit;
font-weight: inherit;
color: rgb(255 171 0);
text-shadow: 0 0 20px rgb(0 0 0 / 80%);
z-index: 10;
opacity: 1;
}
span.ced-1-TextEditorDecorationType702-1 {
position: relative;
opacity: 1;
color: #9d0000!important;
}
the class of decorated text changes every time, and there is no obvious pattern , make it hard to customize using the Custom Css plugin
- using the before option to insert unique identifier
- use identifier to modify style sheet
fabiospampinato/vscode-highlight#173
loaded by the custom css/js plugin, it checks changes in decoration style continuously.
fetched and expanded by custom.js, lt's basicly a style template .
add per-workspace config
"(biomes_define\\[.{1,15}\\]\\.x)": {
"filterFileRegex": ".*\\.glsl|.*\\.gdshaderinc|.*\\.gdshader",
"regexFlags": "g", "decorations": [ {
"overviewRulerColor": "#b39211", "backgroundColor": "#cca71400", "color": "#1f1f1f", "fontWeight": "bold", "contentText":"hello"
, "before" : {"contentText" : "旋转", "color": "gray"}
} ]
},
"(biomes_define\\[.{1,15}\\]\\.y)": {
"filterFileRegex": ".*\\.glsl|.*\\.gdshaderinc|.*\\.gdshader",
"regexFlags": "g", "decorations": [ {
"overviewRulerColor": "#b39211", "backgroundColor": "#cca71400", "color": "#1f1f1f", "fontWeight": "bold", "contentText":"hello"
, "before" : {"contentText" : "elevation", "color": "gray"}
} ]
},
"(biomes_define\\[.{1,15}\\]\\.z)": {
"filterFileRegex": ".*\\.glsl|.*\\.gdshaderinc|.*\\.gdshader",
"regexFlags": "g", "decorations": [ {
"overviewRulerColor": "#b39211", "backgroundColor": "#cca71400", "color": "#1f1f1f", "fontWeight": "bold", "contentText":"hello"
, "before" : {"contentText" : "缩放_Z", "color": "gray"}
} ]
},
"(biomes_define\\[.{1,15}\\]\\.w)": {
"filterFileRegex": ".*\\.glsl|.*\\.gdshaderinc|.*\\.gdshader",
"regexFlags": "g", "decorations": [ {
"overviewRulerColor": "#b39211", "backgroundColor": "#cca71400", "color": "#1f1f1f", "fontWeight": "bold", "contentText":"hello"
, "before" : {"contentText" : "淡出距离", "color": "gray"}
} ]
},
warning : it's for vscode Version: 1.64.0