Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

completionItemToOption

function completionItemToOption(item): CompletionOption;

Defined in: packages/engine/src/language/adapters/codemirror.ts:60

Convert a completion into CodeMirror’s option shape.

Kept in an adapter so the language service itself stays editor-agnostic. An item with replaceLength (net pres offering net present value of) gets an apply that replaces that many characters before the cursor, since CodeMirror would otherwise replace only the word under it and leave net net present value of.

ParameterTypeDescription
itemCompletionItemCompletion produced by the language service.

CompletionOption

The equivalent CodeMirror option.