Inline code hints like vscode

Curious if there is a way to do inline code completions similar to how VS Code handles hints or completion suggestions?
image

Rather than showing a dropdown at the cursor location, text is printed in the editor, but styled to indicate it is a hint rather than code. Is this possible in CodeMirror?

1 Like

It’s possible, but not implemented in the core libs. Chrome devtools has an implementation that may provide inspiration for how to build this.

That’s really useful/helpful - thank you! Side note: is there any interest in adding this to CM core if I opened a PR with an implementation, or do you see this type of functionality remaining an external plugin/mod?

This seems like a special-purpose bit of functionality (VS Code also doesn’t seem to do it when completing in regular files), so no, there’s no plans to add it to the code library at the moment.

I took a stab at creating an extension for this:

Example:

1 Like