lib/autocomplete-manager.js
// match - An {Object} representing the confirmed suggestion
An {Object} representing the confirmed suggestion
An { Object } representing the confirmed suggestion
confirm (suggestion) {
    if ((this.editor == null) || (suggestion == null) || !!this.disposed) { return }
    const apiVersion = this.providerManager.apiVersionForProvider(suggestion.provider)
    const apiIs20 = semver.satisfies(apiVersion, '>=2.0.0')
    const triggerPosition = this.editor.getLastCursor().getBufferPosition()
    if (suggestion.onWillConfirm) {
      suggestion.onWillConfirm()
    }
    const selections = this.editor.getSelections()
    if (selections && selections.length) {
      for (const s of selections) {
        if (s && s.clear) {
          s.clear()
        }
      }
    }
    this.hideSuggestionList()
    this.replaceTextWithMatch(suggestion)
    if (apiIs20) {
      if (suggestion.provider && suggestion.provider.onDidInsertSuggestion) {
        suggestion.provider.onDidInsertSuggestion({editor: this.editor, suggestion, triggerPosition})
      }
    } else {
      if (suggestion.onDidConfirm) {
        suggestion.onDidConfirm()
      }
    }
  }
confirm ( suggestion ) { if ( ( this . editor == null ) || ( suggestion == null ) || ! ! this . disposed ) { return } const apiVersion = this . providerManager . apiVersionForProvider ( suggestion . provider ) const apiIs20 = semver . satisfies ( apiVersion , '>=2.0.0' ) const triggerPosition = this . editor . getLastCursor ( ) . getBufferPosition ( ) if ( suggestion . onWillConfirm ) { suggestion . onWillConfirm ( ) } const selections = this . editor . getSelections ( ) if ( selections && selections . length ) { for ( const s of selections ) { if ( s && s . clear ) { s . clear ( ) } } } this . hideSuggestionList ( ) this . replaceTextWithMatch ( suggestion ) if ( apiIs20 ) { if ( suggestion . provider && suggestion . provider . onDidInsertSuggestion ) { suggestion . provider . onDidInsertSuggestion ( { editor : this . editor , suggestion , triggerPosition } ) } } else { if ( suggestion . onDidConfirm ) { suggestion . onDidConfirm ( ) } } }
match - An {Object} representing the confirmed suggestion
match - An { Object } representing the confirmed suggestion
// TODO API: Remove as this is no longer used // TODO API: Remove when we remove the 1.0 API