-
Notifications
You must be signed in to change notification settings - Fork 286
Support YARD type annotations #118
Comments
Hey @perlun, I'm working on a Ruby Language Server at the moment. Not as part of this repo though. I'll be (eventually) releasing it as a ruby2 extension. Been quite busy lately though. I'll be (trying to) use as much stuff that's already out there as I can. The server side is written in ruby this time, so that will be easier. |
@HookyQR Sounds great! If possible, try to coordinate your efforts with the |
Most of the code here is mine. It will effectively be an upgrade. 😉 |
OK, cool. 😄 Looking forward to see that effort being launched, please keep us posted! |
@HookyQR Any updates on your Ruby language server? Very eager to see it. 😄 |
@didacusAbella looks promising. Have you tried it? |
a little but lacks encore in some features. When i tried it, the server wasn't able to autocomplete inside methods and when i require some external ruby file apart from stdlib. Compared to rcodetools I can affirm that are to same level now. |
Hey guys, I'm sorry to say I don't contribute here anymore, mainly due to a recent podcast by @rebornix about it - which was somewhat misleading and self serving. I'm not actively working on a language server either, although I did see one somewhere on GitHub, albeit (unnecessarily) forcibly wrapped in a Docker instance. Try searching for that and pull the LSP out of the Docker as a start. I still use it myself, and welcome any improvements that come. Please don't make it worse while you're making it better. 😉 Good luck. |
Hi, I'm the author of language_server gem. It has a lot of todos! If you want to write your own language server, you can use language_server-protocol gem Anyway, this issue isn't suitable place to have a discussion about my gem so please move mtsmfm/language_server-ruby#19 or create a new issue on my repo🙏
If you mentioned my gem, it can run without docker 😄 https://github.com/mtsmfm/language_server-ruby#ruby-gem-1 |
Awesome, thanks @mtsmfm. Looks like that's the place to go. |
Closing for issue cleanup. Apologies if this is still an issue. We are working to improve the core extension experience. |
What? Where can I see the progress with YARD syntax? |
Right now there isn't/won't be progress on YARD syntax. There are more core issues with the extension than this functionality. If you need completion support, there are a few other options such as using Sorry, trying to get a handle on things and get this extension in a happy place |
Your environment
vscode-ruby
version:Make sure you have
ruby
,ruby-debug-ide
andruby-debug-basex19
installed before submitting your issue -- thank you !Expected behavior
Being able for "go to definition" to know the types of parameters and variables.
Actual behavior
It does its best, but sometimes guesses wildly (finds a symbol with the same name in some other file).
Steps to reproduce the problem
N/A
Visual Studio Code is one of the better editors available these days, especially because of its Language Server support. It works well for statically typed languages like TypeScript and C#; you can get an awesome editing experience. Work is also ongoing with doing the same for Rust: https://github.com/jonathandturner/rls_vscode
However, the Ruby experience is still not as great as with these languages. You have done an awesome job given the preconditions (a dynamically typed language with very little type annotations etc). I still think that we could (and should) find ways to make it even better.
There are in fact type annotations in Ruby, https://github.com/lsegal/yard. So maybe we should just add support for parsing the YARD comments and using them to provide an even richer editing experience: if they are available, they should be assumed to be reliable.
What do you think? Getting proper "optional typing" in Ruby seems unlikely (https://bugs.ruby-lang.org/issues/9999, https://tonyarcieri.com/an-open-letter-to-matz-on-ruby-type-systems), even though I sincerely hope I'm wrong here - adding optional typing would be the single most important improvement to the language as it stands right now IMHO. Anyway, that's not the scope for this GH issue. 😄
The point here is to rather use whatever we have right now (= YARD comments) and try to utilize them. What do you think of this? (Note: I'm not saying that it's an easy task, I have no idea on how much work it is. I just want to put forward the idea here and start a discussion around it.)
The text was updated successfully, but these errors were encountered: