Sha256: 6a469696b88e2ee00ade46dda261bf6f7f613377b0a0358f2e825f36f71eb360

Contents?: true

Size: 1.01 KB

Versions: 32

Compression:

Stored size: 1.01 KB

Contents

!(angular => {
  'use strict';

  function KeywordCompleterImports(MatcherRunner, LocalResource) {

    return class KeywordCompleter {
      constructor() {
        const matchers = [
          {
            meta: 'keyword',
            contextRelevance: {
              all: 1000
            }
          }
        ];

        let _this = this;
        new LocalResource().get('keyword_config.json').then(keyword => {
          _this._matcherRunner = new MatcherRunner(matchers, keyword.data);
        });
      }

      getCompletions(editor, session, pos, prefix, callback) {
        if (prefix.length === 0) { callback(null, []); return; }

        if (_.exists(this._matcherRunner)) {
          let matches = this._matcherRunner.execute('all', {}, prefix.toUpperCase());
          callback(null, matches);
        }
      }
    };
  }

  KeywordCompleterImports.$inject = ['MatcherRunner', 'LocalResource'];
  angular.module('alephServices.keywordCompleter', []).service('KeywordCompleter', KeywordCompleterImports);
}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.0.5 app/assets/javascripts/angular/services/lib/keyword_completer.js.es6
aleph_analytics-0.0.5 public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.4 app/assets/javascripts/angular/services/lib/keyword_completer.js.es6
aleph_analytics-0.0.4 public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.3 public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.3 app/assets/javascripts/angular/services/lib/keyword_completer.js.es6
aleph_analytics-0.0.2 public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.2 app/assets/javascripts/angular/services/lib/keyword_completer.js.es6
aleph_analytics-0.0.1.alpha app/assets/javascripts/angular/services/lib/keyword_completer.js.es6
aleph_analytics-0.0.1.alpha public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.0.alpha public/assets/angular/services/lib/keyword_completer.js-560b51694457619401c72431dd7b647e.es6
aleph_analytics-0.0.0.alpha app/assets/javascripts/angular/services/lib/keyword_completer.js.es6