Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Add type signatures to the built-in help command #594

Open
guenp opened this issue Feb 22, 2022 · 1 comment
Open

Add type signatures to the built-in help command #594

guenp opened this issue Feb 22, 2022 · 1 comment
Labels
Area-Kernel Issue relates to the IQ# kernel. Kind-Enhancement New feature or request

Comments

@guenp
Copy link
Contributor

guenp commented Feb 22, 2022

Is your feature request related to a problem? Please describe.
Currently, the built-in help command invoked with ? only returns the Operation or Function name and docstring but not the type signature.

Describe the solution you'd like
I'd like to be able to see the type signature in the notebook instead of having to browse the docs to find them.

Describe alternatives you've considered

Additional context
Screenshot:
MicrosoftTeams-image

@cgranade
Copy link
Contributor

Thanks for filing this! I think we should do this, but that would take adding an API to the qsharp-compiler repo (or exposing it if it already exists) to reconstruct the declaration syntax from a CallableDeclarationHeader.

To drill down a bit, the way ? works in jupyter-core and hence IQ# is to return a code symbol as a displayable object, and then use display encoders to render that into HTML, plain text, and so forth. IQ# already has a display encoder for Q# symbols, formatting them from the metadata contained in IQSharpSymbol. That class includes metadata automatically generated from documentation comments (#334), but at the moment there's no way to go back to Q# syntax data without using internal-only syntax generation methods.

@bettinaheim, would it be reasonable to expose some of the methods used in documentation generation for reproducing declaration syntax so that we can implement this suggestion?

Short of that, I think we should be able to pull at least some Markdown content from existing attributes and APIs:

image

@cgranade cgranade added Area-Kernel Issue relates to the IQ# kernel. Kind-Enhancement New feature or request labels Feb 22, 2022
cgranade added a commit that referenced this issue Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-Kernel Issue relates to the IQ# kernel. Kind-Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants