@@ -4,7 +4,8 @@ import {CompletionState} from "./state"
44import { completionConfig , CompletionConfig } from "./config"
55import { Option , Completion , CompletionInfo , closeCompletionEffect } from "./completion"
66
7- type OptionContentSource = ( completion : Completion , state : EditorState , match : readonly number [ ] ) => Node | null
7+ type OptionContentSource =
8+ ( completion : Completion , state : EditorState , view : EditorView , match : readonly number [ ] ) => Node | null
89
910function optionContent ( config : Required < CompletionConfig > ) : OptionContentSource [ ] {
1011 let content = config . addToOptions . slice ( ) as { render : OptionContentSource , position : number } [ ]
@@ -20,7 +21,7 @@ function optionContent(config: Required<CompletionConfig>): OptionContentSource[
2021 position : 20
2122 } )
2223 content . push ( {
23- render ( completion : Completion , _s : EditorState , match : readonly number [ ] ) {
24+ render ( completion : Completion , _s : EditorState , _v : EditorView , match : readonly number [ ] ) {
2425 let labelElt = document . createElement ( "span" )
2526 labelElt . className = "cm-completionLabel"
2627 let label = completion . displayLabel || completion . label , off = 0
@@ -267,7 +268,7 @@ class CompletionTooltip {
267268 let cls = this . optionClass ( completion )
268269 if ( cls ) li . className = cls
269270 for ( let source of this . optionContent ) {
270- let node = source ( completion , this . view . state , match )
271+ let node = source ( completion , this . view . state , this . view , match )
271272 if ( node ) li . appendChild ( node )
272273 }
273274 }
0 commit comments