jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
63 stars 12 forks source link

Autocomplete Ctrl+space #121

Closed vharny closed 3 months ago

vharny commented 4 months ago

At the moment, I have the impression that you always need at least 1 character to display autocompletion.

It would be cool to have the list of possible object properties without having to type a first letter to get the list.

Just by pressing Ctrl+Space I'd like to have the complete list of possibilities.

Like here in the Codemirror documentation:

Screenshot 2024-06-03 at 18 04 05

kmarkussen commented 3 months ago

I would also appreciate this feature

acao commented 3 months ago

@vharny you can enable this with configuration in codemirror 6:

The default completion keymap binds Ctrl-Space to start completion, arrows to select a completion, Enter to pick it, and Escape to close the tooltip. It is activated by default when you add the extension, but you can disable that if you want to provide your own bindings.

The default bindings do not bind Tab to acceptCompletion, for reasons outlined in the Tab-handling example.

to enable these defaults, you must install, import and load the default completion keymap in @codemirror/commands package