Skip to content
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

package-local-nicknames support #128

Open
remexre opened this issue Mar 18, 2023 · 9 comments
Open

package-local-nicknames support #128

remexre opened this issue Mar 18, 2023 · 9 comments

Comments

@remexre
Copy link

remexre commented Mar 18, 2023

Right now, I don't get type hints or completion when a symbol uses a p-l-n name.

@kovisoft
Copy link
Owner

Could you please give me an example code snippet? I'd like to check how it is handled in Emacs/Slime, what is the communication between Emacs and the Swank server.

@remexre
Copy link
Author

remexre commented Mar 19, 2023

(uiop:define-package :example
  (:use :cl)
  (:local-nicknames (#:a :alexandria)))
(in-package :example)

(a:define-constant foo :foo)

This does need a new enough UIOP; iiuc, 3.3.4 for SBCL, 3.3.5 for other impls.

@kovisoft
Copy link
Owner

Thank you for the example. I played with it a little bit in emacs+slime, and it turned out that emacs+slime is sending swank:completions to the swank server, while vim+slimv is sending either swank:fuzzy-completions or swank:simple-completions (depending on the value of g:slimv_simple_compl). This might be a change in slime, because as I recall, older versions used swank:simple-completions as well, that's why I implemented it the same way in slimv.

I'm going to check how to add swank:completions to slimv. Maybe it will be a new option. I'll come back to you when I have a solution.

@stag-enterprises
Copy link

Is there any progress update on this?

@kovisoft
Copy link
Owner

Sorry for the big delay. I have fixed it in commit a7a4715
The default behavior is now to use swank:completions that handles local-nicknamed packages.

@stag-enterprises
Copy link

@kovisoft Thank you so much! Appreciate your work. This can probably be closed now.

@stag-enterprises
Copy link

Update: It looks like while autocomplete for local-nicknames works, there is no argument hinting. When typing the name of a function under a local-nicknames package, the little text shown on the bottom of the screen with the argument list does not show.

@kovisoft
Copy link
Owner

It seems that emacs uses swank:autodoc for getting the argument list, and this one handles local-nicknames as well. Therefore in commit bbdb7a4 I replaced operator-arglist with autodoc for .lisp files. Unfortunately autodoc is not supported for all file types (e.g. it does not work in swank-mit-scheme.scm).

@stag-enterprises
Copy link

ty! for sbcl it looks like everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants