I'm working on an intellisense or code-completion capability for C#.
So far, so good. Right now I have basic completion working. There are 2 ways to request completion. The first cycles through all the potential matches. The second presents a popup menu of the matches. It works for types:
And also for local and instance variables:
I'm confronting two problems with x-popup-menu:
Addendum: Doc for x-popup-menu
x-popup-menu is a built-in function in `C source code'. (x-popup-menu POSITION MENU)
Pop up a deck-of-cards menu and return user's selection. PO SITION is a position specification. This is either a mouse button event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET are positions in pixels from the top left corner of WINDOW's frame (WINDOW may be a frame object instead of a window). This controls the position of the center of the first line in the first pane of the menu, not the top left of the menu as a whole. If POSITION is t, it means to use the current mouse position.
Some people like Emacs because it doesn't provide popup windows (see e.g. this blog entry). The more "emacsy" way of presenting your list of possible completions is to show them in a split buffer. That way you would automatically avoid all of the above issues (screen real estate & scrolling) and would probably attract more of the die-hard Emacs users.
But that's pure speculation :-)
You can base your autocompletion backend on company or autocomplete where display of suggestions is handled for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With