question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for remappings

See original GitHub issue

I am using solc’s remapping feature and brownie for my project. Doing either of these cause the vscode-solidity’s plugin to fail loading my imports.

It would be really helpful if there were some sort way to include these remappings in the project’s settings.

https://solidity.readthedocs.io/en/develop/layout-of-source-files.html?#use-in-actual-compilers

For example, if you clone github.com/ethereum/dapp-bin/ locally to /usr/local/dapp-bin, you can use the following in your source file: import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol" as it_mapping; Then run the compiler: solc github.com/ethereum/dapp-bin/=/usr/local/dapp-bin/ source.sol

There’s another plugin that has the feature, but it hasn’t been updated in 2 years.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
juanfranblancocommented, Oct 7, 2021

@merc-0 it is supported now, also @PatrickAlphaC confirmed in another thread it is working now with Brownie.

2reactions
juanfranblancocommented, Sep 28, 2021

@cameel @PatrickAlphaC @merc-0 @WyseNynja just checked in the initial support. Not perfect yet as it is driven by the global / workspace settings. I think going deeper will takes us back to the project file / module or the old dapp project file 😃. Which can contain each remapping, module / context name etc.

Notes:

  • Remapping support included in the workspace / global settings, the remapping base path is relative to the workspace root folder.
  • Issues at the moment, multiple folders in a workspace will use the same remapping (as it is a workspace setting and for that folder)
  • No support for “context”, so mainly this uses the workspace folder for all dependencies. Solution for this and above will be find the current “remappings.txt” (or project file) in each folder and use that as the Package remapping configuration. Context name (package name, could be driven from that).

Edit: “remappings.txt” is not supported yet (just in case is not clear)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support remappings.txt in LSP #12603 - ethereum/solidity
Seems like vscode-solidity supports the remappings.txt format of dapptools now, too. It would make sense to adopt it then for our LSP server ......
Read more >
Remapping Arguments - ROS Wiki
The various ROS libraries provide client support for easily stripping remapping arguments out of your own argument parsing.
Read more >
Improving swift-lldb support for Path Remappings
Background: Xcode assumes absolute paths for everything, which makes it particularly inflexible for distributed and portable builds.
Read more >
Coordinate remapping service - NCBI - NIH
Select the organism for which you wish to remap features. Support Center to request an organism that is not in this list. Select...
Read more >
Remapping Names - ROS 2 Design
Exact FQN Replacement; Exact Relative Name Replacement; Remap via Command Line; Change the Default Namespace; Change the Node Name; Remap Topic and Service...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found