-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement LSP / Language Server #7763
Comments
After reading somewhat into the official specification, I'd say this ticket first is not about fully implementing it but about having it started and got some initial support done. Here are the steps I'd propose:
My proposal would be to start with the following features:
|
moved back to |
hey I was just curious if there are any updates on this or if this is an area that would be a good candidate for contribution? |
We have a prototype and it would be great if you could test it out! @christianparpart can you write a small text about how to use the LSP? |
i'd also be happy to test this out, let me know if that's possible |
Yea please do let me know I would love to test it! |
Hey guys. Many thanks for your interest in this. I will be writing a guide on how to test and future work next Tuesday and share the link in here. @nassredean, @elee1766 |
Amazing! Thank you for doing this! I am using NVIM v0.5.0-dev+1191-gf89bfa686. nvim v0.5 supports lsp using https://github.com/neovim/nvim-lspconfig and then I use deoplete for completion. Running on ubuntu 20.04.1 LTS |
the feature set is still minimal, but surely I want to improve on that. Code completion will however have a lower priority as I first want to finish the lower hanging fruits (code completion actually means to properly deal with compilation errors and our the code base wasn't designed for that, but I am still confident that we can do that :) ) |
@nassredean @elee1766 @chriseth bare with me, it's a very long time ago I was writing textual stuff like that. I have put it into my own blog site for now to get it up ASAP, but i can move that over to our own solidity blog site at any time. https://dev.to/christianparpart/builtin-solidity-language-server-267n |
amazing! I will try sometime this week as soon as I have a little more time. Thanks again! |
@christianparpart cool! ill try this today and let you know. if i don't reply today it means i died of frustration edit: just wrote a contract with it. i haven't encountered any major issues so far, and it seems to be correct as far as I see. |
This looks exciting, very nice job @chriseth & @christianparpart! |
Hey @Tomburgs many thanks for your interest. Please give me some time before doing that. I want to tidy up a few things first, then I'll release a new VScode extension (if that is what you have been requesting for). Also, please keep in mind that it is not officially supported nor feature-complete yet, see it more as an early beta with any feedback very welcome. :) |
Hey @christianparpart ! I've been using your LSP with coc.nvim for a month now! It's been pretty nice to me so far. The biggest issue I'm having is support for the path mapping that truffle has for importing .sol files. I attempted to launch the LSP with the same flags as truffle, locating the correct folders in node_modules/@xyzzy, however never got that working, and haven't had the time to look through solc and find out why Am I just configuring something incorrectly, or is this something that support would need to be added for? |
@elee1766 Truffle has its own resolver for locating directories that you can import files from. For example, if you're running solc my_contract.sol @xyzzy=node_modules/@xyzzy
Remappings should be enough but they have downsides: you have to remap every library explicitly and also they end up in contract metadata (because they were really meant for a different use case). Actually, I've been working recently on making the path-related behavior in Solidity less quirky and one of the ideas would be to let you specify a list of directories where importable libraries are located. So you could say that |
this sounds super exciting!!! woohoooo i was trying to run solc --lsp with the @xcxyzyyz syntax, but it throws an angry message at me saying that input-file and lsp are mutually exclusive. seems like what ur planning will make that a non-issue |
stupid question: will this be "backwards compatible" for previous Solidity versions? |
@hacker-DOM unfortunately not. |
Will this handle symlinks? |
I don't see why it wouldn't. The compiler follows symlinks and the LSP uses the same code for loading files. |
Any Updates? |
Hey @UltiRequiem - I mean, I'm currently on "vacation" and back to work next Monday, we however have put this on hold (read: not rejected, just re-prioritized), this is why it's currently looking like it's not active. I though can't await resuming working on it, given enough resources :-) p.s.: I think the goal was to have something in 2021, so we still have some months left :) |
How can I help with that? |
@EduardoBorsa thanks for your offer! The best way you can help currently is to try out our prototype. It should be explained here: https://dev.to/christianparpart/builtin-solidity-language-server-267n |
Happy to be an early tester on mac if that's useful. Excited to see this ticket and would love to see it finished but understand there are lots of priorities. |
@joshuavial which IDE would you use together with the lsp? |
I'm very interested in this issue and would like to make a contribution to it. I usually use vim but there seems to be no LSP for Solidity in vim. I feel the inconvenience much, so I would like to improve this condition. |
@chriseth is anybody actively working on this? This is quite important and if not, it would be nice if we can find somebody to get it over the line. Is the issue funding? Documentation about Solidity internals? Would love to help in any way possible. There seems to be another old project on this here as well. |
Thanks for offering your help! We plan to release the LSP by the end of the year. What we mostly need is testing in various different IDEs and feedback about it. It is being worked on at #11350 |
The main task in this issue is probably identifying the steps towards full LSP support.
Features for first release (mainly related to file lookup):
file://
prefix due to absolute / direct imports, so we need translation functionsFeatures for subsequent releases (probably implemented in the client, but we should support it as much as possible):
node_modules
should be auto-detected as an include path as much as possibleThe text was updated successfully, but these errors were encountered: