solidity icon indicating copy to clipboard operation
solidity copied to clipboard

allow setting remappings on lsp server init

Open chrisfarms opened this issue 2 years ago • 7 comments

What

enables client's of the lsp server to configure remappings during the initialisation command.

we already allow configuring import-paths through the initialisation, so hopefully this is not controversial.

the format expected to be passed in from the initialise json is:

{ 
  "remappings": [
      {context: "", prefix: "foo", target: "bar"},
      ...
  ]
}

Why

Because without being able to set remappings, the lsp-server throws errors for any project that requires them.

Related

  • https://github.com/ethereum/solidity/issues/12603
  • https://github.com/ethereum/solidity/pull/12994

chrisfarms avatar Aug 22 '22 14:08 chrisfarms

Many thanks for your contribution @chrisfarms. We will take a close look at your work. :)

christianparpart avatar Aug 22 '22 14:08 christianparpart

Thanks, addressed your review comments.

Will take a look at the lsp.py tests shortly (had not spotted those tests) 👍

chrisfarms avatar Aug 22 '22 15:08 chrisfarms

added a very basic case to the python lsp tests

chrisfarms avatar Aug 22 '22 22:08 chrisfarms

I rebased the PR to the latest develop branch to fix the pylint CI failure

Marenz avatar Aug 29 '22 12:08 Marenz

@chrisfarms I have been taking over this PR to finish the review, simply applying @leonardoalt's comments & adding a changelog item. I hope you don't mind.

christianparpart avatar Sep 05 '22 10:09 christianparpart

@chrisfarms I have been taking over this PR to finish the review, simply applying @leonardoalt's comments & adding a changelog item. I hope you don't mind.

🙏 don't mind at all, thanks!

chrisfarms avatar Sep 05 '22 11:09 chrisfarms

Adding @cameel for the final review.

christianparpart avatar Sep 19 '22 15:09 christianparpart

Does this fix #12603? If so, please add #Fixes #12603 in the PR description.

Also needs rebase on latest develop and approvals from @christianparpart and @leonardoalt.

cameel avatar Oct 21 '22 20:10 cameel

Rebased and resolved conflicts, should be in a more workable state now.

nikola-matic avatar Nov 04 '22 11:11 nikola-matic

Right now, we're choosing to close this PR as we won't allocate any time to this particular area.

NunoFilipeSantos avatar Dec 05 '22 14:12 NunoFilipeSantos