How should I execute a command?

How should I execute a command?

I found a command similar to closeCompletion in the documentation.

How should I execute it?

I have a scenario like this: I set the closeOnBlur property of the autocomplete plugin to false. When I perform a certain action, I want to call the closeCompletion command to manually control the closing of this pop window.

But I haven’t found a way to execute this command.

Something like EditorView.closeCompletion or something.

Commands are just functions. Call them with the editor view as argument to run them.

Can you give me an example? I don’t know which class or object the functions of these commands are in.
For example, how to execute the following closeCompletion command?
https://codemirror.net/docs/ref/#autocomplete.closeCompletion

thanks a lot.

The docs are organized by package. If a function is listed under @codemirror/autocomplete, that’s where you import it from.

oh, I think I understand, thank you very much