Skip to content

Commit c2d0ef2

Browse files
authored
Merge pull request #18 from PraneshASP/fix/ignore-files-rule
Disable highlighting if there's Solhint rule
2 parents a81d746 + 776b5e7 commit c2d0ef2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-solidity-inspector",
33
"displayName": "Solidity Inspector",
44
"description": "A vscode extension used to inspect Solidity files",
5-
"version": "1.0.1",
5+
"version": "1.0.3",
66
"engines": {
77
"vscode": "^1.72.0"
88
},

src/commands/highlight-unused-imports.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ async function unusedImportsActiveFile(editor) {
3838
editor.setDecorations(decorationType, []);
3939

4040
const text = editor.document.getText();
41+
42+
const solhintRuleString = "solhint-disable no-unused-import"
43+
if (text.includes(solhintRuleString)) return;
44+
4145
const importRegex = /import\s+((?:\{.+?\}\s+from\s+)?(?:\".*?\"|'.*?'));/g;
4246
const imports = text.match(importRegex) || [];
4347
const unusedImportDecorations = [];

0 commit comments

Comments
 (0)