https://github.com/tintinweb/vscode-solidity-flattener
Flatten Solidity Contracts using `truffle-flattener`
https://github.com/tintinweb/vscode-solidity-flattener
Last synced: 11 months ago
JSON representation
Flatten Solidity Contracts using `truffle-flattener`
- Host: GitHub
- URL: https://github.com/tintinweb/vscode-solidity-flattener
- Owner: tintinweb
- Created: 2019-07-05T21:28:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-22T09:29:26.000Z (over 4 years ago)
- Last Synced: 2025-03-02T06:30:37.741Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-solidity-flattener
- Size: 24.4 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[
](https://diligence.consensys.net)
[[ 🌐 ](https://diligence.consensys.net) [ 📩 ](mailto:diligence@consensys.net) [ 🔥 ](https://consensys.github.io/diligence/)]
# VSCode Solidity Contract Flattener
[truffle-flattener](https://www.npmjs.com/package/truffle-flattener) context menu integration for vscode.
Adds a context menu to flatten solidity contracts from truffle projects:
* **NOTE/REQUIRED**: Make sure you've installed truffle and the project's dependencies (`npm install`).
* select files, `right-click` -> `Solidity: flatten selected file(s)`
* or `cmd + shift + p` -> `Solidity Flattener - flatten current file`.

### Developers
`truffle-flattener.contextMenu.flatten` can be called by any other extension as following:
* `files` .. an array of files to flatten
* `callback` .. function to be called as `callback(string:filepath, string:truffle-path, string:flattened_contract)` on flatten success
* `showErrors` .. enable or suppress vscode info/error notifications
```js
vscode.commands.executeCommand("vscode-solidity-flattener.flatten", {files: files, callback:callback, showErrors:showErrors})
.catch(error =>{
// command not available
vscode.window.showWarningMessage("Error running `tintinweb.vscode-solidity-flattener`. Please make sure the extension is installed.\n" + error)
})
```
## Credits
* [truffle-flattener](https://www.npmjs.com/package/truffle-flattener)
## Release Notes
see [CHANGELOG](./CHANGELOG.md)
-----------------------------------------------------------------------------------------------------------