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.

1 Like

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:

5 Likes

Hey there,

First off, big shoutout to you for creating this incredible extension! :raised_hands:
I’m soon gonna start working on a CodeMirror project (will be using your extension as well). I was wondering if you’ve got any guide or documentation that can help rookies like me get a solid grasp on how your extension works?
And I was also curious to request you for a feature to be added in ur extension: is it possible to have inline suggestions at specific positions in the Editor state, kinda like what “git lens” and “import costs” do in VSCode? That would be a game-changer!

Once again, thanks a million for this stellar extension! :star2: