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

Adding inspect_request handling #33

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bendudson
Copy link

Opening this for comments and suggestions, not yet ready for merging. I'm fairly new to Common Lisp, so feedback on ways to improve this welcome.

Typing Shift-Tab with the cursor inside a form should pop up a tooltip containing the output of DESCRIBE on the function. The aim is to mimic a feature of SLIME which I find very useful: displaying the function arguments, highlighting where the cursor is in the argument list. For example if the cursor is at the '|'
(+ 1 2 val| ) => output of (describe '+) not (describe 'val)

Getting the argument list for a given function seems to be implementation specific, but SWANK must have the code to do it.

Plan to borrow code from SWANK (public domain) to inspect
functions and variables. This should be able to replace
the SLIME feature which shows the current function argument list.
Typing Shift-Tab brings up a tooltip containing the output of DESCRIBE.
To mimic the behaviour of SLIME, the function at the start of the form
is described, not the symbol at the cursor.
* If no function symbol found, searches surrounding form
  to handle macros and let forms
* Copied public domain code from swank into src/completions.lisp
  into new package cl-jupyter-swank

* Added a handler for complete_request message types. Currently
  just prints the message fields.
Finds the symbol before the cursor position using simple backward search.
Will get confused by symbols with spaces in the name, but hopefully rare.

Tooltip contains matching symbols sorted by length, shortest first.
@fredokun
Copy link
Owner

fredokun commented May 2, 2018

Sorry for the delay, I have to find some spare time to try the completions before merging... This will happen soon.

@drmeister
Copy link
Collaborator

It looks like we have some competing implementations for Shift-Tab completion.
Whatever ends up in cl-jupyter - it should display lambda lists for functions.

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

Successfully merging this pull request may close these issues.

3 participants