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