Hacker News new | ask | show | jobs
by giancarlostoro 2440 days ago
That was one thing I liked about Go as well. I mention Go cause I remember how I felt when I realized I had all the docs available offline. That is a nice to have for Rust too. I wonder when if ever LangServ will support code documentation as part of autocomplete like C# does rather cleanly with Visual Studio. Or is that already the case? In any case I think its powerful to be able to see a summary of a method through the auto complete feature of editors.

I know Rust is working on their own LangServ as well. I hope LangServ matures enough to secretly turn supporting editors into lightweight IDEs.

3 comments

The Rust Language Server definitely serves up documentation beside each item in the completion menu, however it seems to be the raw Markdown source for the documentation, rather than the nicely formatted version you'd see in a browser.
At least in VS Code it's formatted nicely (at least most of the time, there are some ugly edge cases). Might depend on your editor integration though.
Whaaaat are all the godocs available offline? Can I access this via the terminal?

That's amazing

Yes you can! It's one of the first times I even thought about offline docs that are rendered like that:

  godoc -http=:6060

Will do it for you. Then just visit localhost:6060
The current problem though is that it requires all your code + all the dependencies to be under $GOPATH/src. https://github.com/golang/go/issues/33655 starts with: "At this time, the godoc command is only able to display packages that are located in a GOPATH workspace."
With the rust language server if you hover over a symbol you will see the same documentation as what’s available online. I use it daily.