Skip to content

Commit 684aba7

Browse files
authored
Merge pull request #97 from RomiRand/master
added pink border for immutables
2 parents 477eb0b + 510aec3 commit 684aba7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/features/deco.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ const decoStyleStateVar = vscode.window.createTextEditorDecorationType({
4141
},
4242
});
4343

44+
const decoStyleStateVarImmutable = vscode.window.createTextEditorDecorationType({
45+
borderWidth: '1px',
46+
borderStyle: 'dotted',
47+
//overviewRulerColor: 'blue',
48+
overviewRulerLane: vscode.OverviewRulerLane.Right,
49+
light: {
50+
// this color will be used in light color themes
51+
borderColor: 'DarkOrchid'
52+
},
53+
dark: {
54+
// this color will be used in dark color themes
55+
borderColor: 'Orchid'
56+
},
57+
});
58+
4459
const decoStyleLightGreen = vscode.window.createTextEditorDecorationType({
4560
borderWidth: '1px',
4661
borderStyle: 'dotted',
@@ -115,6 +130,7 @@ const decoStyleBlueBoldForeground = vscode.window.createTextEditorDecorationType
115130

116131
var styles = {
117132
decoStyleStateVar: decoStyleStateVar,
133+
decoStyleStateVarImmutable: decoStyleStateVarImmutable,
118134
decoStyleLightGreen: decoStyleLightGreen,
119135
decoStyleLightOrange: decoStyleLightOrange,
120136
decoStyleLightBlue: decoStyleLightBlue,
@@ -473,6 +489,11 @@ class CreateDecoStyle {
473489
knownValue = knownValue ? ` = **${knownValue}** ` : '';
474490
}
475491

492+
if (node.hasOwnProperty('isImmutable') && node.isImmutable) {
493+
prefix = "**IMMUTABLE** ";
494+
decoStyle = "decoStyleStateVarImmutable";
495+
}
496+
476497
return {
477498
range: new vscode.Range(
478499
new vscode.Position(node.identifier.loc.start.line - 1, node.identifier.loc.start.column),
@@ -496,6 +517,11 @@ class CreateDecoStyle {
496517
knownValue = knownValue ? ` = **${knownValue}** ` : '';
497518
}
498519

520+
if (svar.hasOwnProperty('isImmutable') && svar.isImmutable) {
521+
prefix = "**IMMUTABLE** ";
522+
decoStyle = "decoStyleStateVarImmutable";
523+
}
524+
499525
return {
500526
range: new vscode.Range(
501527
new vscode.Position(node.loc.start.line - 1, node.loc.start.column),

0 commit comments

Comments
 (0)