Skip to content

Commit 8b941a9

Browse files
committed
merge main
1 parent fe3cc6a commit 8b941a9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: "https://www.omo.so/praneshasp"

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.4.0",
5+
"version": "1.4.1",
66
"engines": {
77
"vscode": "^1.72.0"
88
},

src/commands/contract-size.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ function getContractSizes(fileName) {
130130
const foundryJsonPath = path.join(workspaceRoot, foundryOutDir, `${path.basename(fileName)}`, `${contractName}.json`);
131131
let hardhatJsonPath = null;
132132
if (hardhatOutDir) {
133-
const relativePath = path.relative(path.join(workspaceRoot, 'contracts'), fileName);
133+
const relativePath = path.relative(workspaceRoot, fileName);
134134
hardhatJsonPath = path.join(hardhatOutDir, relativePath, `${contractName}.json`);
135135
}
136136

137137
const jsonPaths = [foundryJsonPath, hardhatJsonPath].filter(Boolean);
138-
139-
for (const jsonPath of jsonPaths) {
138+
for (const jsonPath of jsonPaths) {
140139
try {
141140
if (fs.existsSync(jsonPath)) {
142141
const jsonContent = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));

src/completionItems.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ async function loadRemappings(rootPath) {
103103
}
104104

105105
const completionItem = new vscode.CompletionItem(`${name} from "${finalPath}"`, vscode.CompletionItemKind.File);
106-
completionItem.insertText = `{ ${name} } from "${finalPath}";`;
107-
106+
const currentLineRange = document.lineAt(position.line).text.length;
107+
const rangeToRemove = new vscode.Range(position.line, 0, position.line, position.character + currentLineRange);
108+
completionItem.insertText = `import { ${name} } from "${finalPath}";`;
109+
completionItem.additionalTextEdits = [vscode.TextEdit.delete(rangeToRemove)];
108110
return completionItem;
109111
});
110112
});

0 commit comments

Comments
 (0)