Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

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.