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

Inspector: improve code assist UX #2627

Open
josephjclark opened this issue Nov 4, 2024 · 1 comment
Open

Inspector: improve code assist UX #2627

josephjclark opened this issue Nov 4, 2024 · 1 comment

Comments

@josephjclark
Copy link
Contributor

User story

The UX for code assist in Monaco in the inspector is bad, actually. This issue is a little wishlist of features/improvements that we might get to one day.

Image

  • Typescript Signatures appear at the top of the prompts, but they are not particularly helpful for our users
  • We force ALL common exports into the global namespace so that they appear - but most adaptors do not export all common functions
  • We show JSdoc comments, badly formatted, and with lots of annotations that don't help the user.
  • We should show the first line of description to the right of the suggestion (sometimes it'll show a ts signature there - not useful)
  • It can be kinda hard and fiddly to get docs for the parameters
  • When a function is inserted, we should also insert the opening bracket, so that the code assist is instantly in the right place
  • You can open a small suggestion prompt with ctrl-space. To get the details panel on the right, you have to ctrl + space again. This is annoying and intuitive. I'd like to work out a better way to show some help for this

Notes

Editing the appearance of the code assist is hard. We might have to switch off all default language features and develop our own custom suggestions (I'm worried about what this might mean for stuff like object properties).

The ideal solution would be to take the default suggestions and customise them - removing stuff that isn't @public for example, or updating descriptions.

This might be useful hack to this end:

const x = editor.getContribution('editor.contrib.suggestController')

This gets the suggestion controller component right outta Monaco. You can then inspect it in the debugger and trace through all sorts of interesting things, including a couple of callbacks.

So far I haven't found the exact callbacks I think we need, but I wanted to record the find.

@github-project-automation github-project-automation bot moved this to New Issues in v2 Nov 4, 2024
@josephjclark
Copy link
Contributor Author

I have had to restore the JSDoc attributes in #2669

Maybe for now we have to live with jsdoc attributes appearing in the suggestions, no matter how untidy they are.

This speaks to the idea that we need to generate our own suggestions from scratch and not use the default service.

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

No branches or pull requests

1 participant