text: 'use babel';
  
  class Provider {
  	constructor(suggestions, selector) {
          this.suggestions = suggestions;
  		// offer suggestions only when editing plain text or HTML files
  		this.selector = selector || '.text.plain, .text.html.basic, .source.js, .source.js, .source.json';
  	}
  
  	getSuggestions(options) {
  		const { prefix } = options;
  
  		// only look for suggestions after 3 characters have been typed
  		// if (prefix.length >= 3) {
  			return this.findMatchingSuggestions(prefix);
  		// }
  	}
  
  	findMatchingSuggestions(prefix) {
  		// filter list of suggestions to those matching the prefix, case insensitive
  		let prefixLower = prefix.toLowerCase().split('.').join('');
  
  		let matchingSuggestions = this.suggestions.filter((suggestion) => {
  			let textLower = suggestion.text.toLowerCase().split('.').join('');
  			return textLower.startsWith(prefixLower);
  		});
  
  		// run each matching suggestion through inflateSuggestion() and return
  		return matchingSuggestions.map(this.inflateSuggestion);
  	}
  
  	// clones a suggestion object to a new object with some shared additions
  	// cloning also fixes an issue where selecting a suggestion won't insert it
  	inflateSuggestion(suggestion) {
          return { ...suggestion, type: 'value' };
  	}
  }
  export default Provider;
  