function initializeStore({ completions, predictions }) {
      const cs = self.completionStore;
      cs.initRoot(self.config);

      // eslint breaks on some optional chaining https://github.com/eslint/eslint/issues/12822
      /* eslint-disable no-unused-expressions */
      predictions?.forEach(p => cs.addPrediction(p).deserializeCompletion(p.result));
      completions?.forEach((c, i) => {
        const obj = cs.addCompletion(c);
        cs.selectCompletion(obj.id);
        obj.deserializeCompletion(c.draft || c.result);
        obj.reinitHistory();
      });
      /* eslint-enable no-unused-expressions */
    }
/**
     * Function to initilaze completion store
     * Given completions and predictions
     */
Function to initilaze completion store
Given completions and predictions
Function to initilaze completion store Given completions and predictions
function initializeStore({ completions, predictions }) {
      const cs = self.completionStore;
      cs.initRoot(self.config);
      predictions?.forEach(p => cs.addPrediction(p).deserializeCompletion(p.result));
      completions?.forEach((c, i) => {
        const obj = cs.addCompletion(c);
        cs.selectCompletion(obj.id);
        obj.deserializeCompletion(c.draft || c.result);
        obj.reinitHistory();
      });
    }
function initializeStore ( { completions , predictions } ) { const cs = self . completionStore ; cs . initRoot ( self . config ) ; predictions ?. forEach ( p => cs . addPrediction ( p ) . deserializeCompletion ( p . result ) ) ; completions ?. forEach ( ( c , i ) => { const obj = cs . addCompletion ( c ) ; cs . selectCompletion ( obj . id ) ; obj . deserializeCompletion ( c . draft || c . result ) ; obj . reinitHistory ( ) ; } ) ; }
Function to initilaze completion store
 Given completions and predictions
Function to initilaze completion store Given completions and predictions
// eslint breaks on some optional chaining https://github.com/eslint/eslint/issues/12822 /* eslint-disable no-unused-expressions */ /* eslint-enable no-unused-expressions */