File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 3333 " onLanguage:tree"
3434 ],
3535 "contributes" : {
36+
3637 "commands" : [
3738 {
3839 "command" : " vscode-solidity-inspector.activeFile.irOptimizer" ,
103104 "configuration" : {
104105 "type" : " object" ,
105106 "title" : " Solidity Inspector" ,
106- "properties" : {}
107+ "properties" : {
108+ "solidityInspector.showContractSize" : {
109+ "type" : " boolean" ,
110+ "default" : true ,
111+ "description" : " Show contract size information in the editor"
112+ }
113+ }
107114 },
108115 "keybindings" : [
109116 {
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ function findArtifactsDir(dir) {
8181}
8282
8383function updateDecorations ( document ) {
84+ const config = vscode . workspace . getConfiguration ( 'solidityInspector' ) ;
85+ const showContractSize = config . get ( 'showContractSize' ) ;
86+
87+ if ( ! showContractSize ) {
88+ // Clear decorations if the feature is disabled
89+ vscode . window . activeTextEditor ?. setDecorations ( decorationType , [ ] ) ;
90+ return ;
91+ }
8492 const text = document . getText ( ) ;
8593 const contractSizes = getContractSizes ( document . fileName ) ;
8694 const decorations = [ ] ;
@@ -97,7 +105,7 @@ function updateDecorations(document) {
97105 range,
98106 renderOptions : {
99107 after : {
100- contentText : ` ( ${ formatSize ( size ) } ) ` ,
108+ contentText : ` [ ${ formatSize ( size ) } ] ` ,
101109 color : getSizeColor ( size ) ,
102110 }
103111 }
You can’t perform that action at this time.
0 commit comments