racer-rust / emacs-racer

Racer support for Emacs
399 stars 48 forks source link

Show type hints and argument names. #95

Open iddm opened 6 years ago

iddm commented 6 years ago

I have seen the following image in Idea IDE: Screenshot I'd like to have something like that in my emacs. Personally, I am so interested in it so I am ready to do this by myself. I have already checked that racer provides this information (at least it provides information about argument names), so the idea is the following:

  1. Put a marker after let binding name.
  2. Use insert function to insert text in this place with read-only parameter and custom background/foreground parameters.
  3. Repeat this process the same time we invoke racer. If it is invoked only after . or other characters when it should be done in some amount of time, like, 2 seconds, or it needs more difficult solution: parsing the let binding creation and function usage and doing things after that.

I am new to emacs and emacs lisp, so my solution can be quite bad or not appropriate at all. Anyway, I want this feature in the emacs. If you guys wanna do this, feel free to do that, but if you may just help me doing it, I appreciate any help, like, pointing me how to do this more correctly.

ppham27 commented 6 years ago

I, too, would like to see type hints and argument names, but my preferred implementation would be different. I'd prefer something less intrusive in the minibuffer. I think what tide does for TypeScript is ideal. For functions:

screen shot 2018-03-21 at 10 29 49 am

And for a property or variable:

screen shot 2018-03-21 at 10 32 14 am