コード例 #1
0
  constructor(provider, apiVersion) {
    // TODO API: remove this when 2.0 support is removed

    this.provider = provider;
    this.apiVersion = apiVersion;
    if (this.provider.selector != null) {
      this.scopeSelectors = _selectorKit.Selector.create(this.provider.selector);
    } else {
      this.scopeSelectors = _selectorKit.Selector.create(this.provider.scopeSelector);
    }

    // TODO API: remove this when 2.0 support is removed
    if (this.provider.disableForSelector != null) {
      this.disableForScopeSelectors = _selectorKit.Selector.create(this.provider.disableForSelector);
    } else if (this.provider.disableForScopeSelector != null) {
      this.disableForScopeSelectors = _selectorKit.Selector.create(this.provider.disableForScopeSelector);
    }

    // TODO API: remove this when 1.0 support is removed
    let providerBlacklist;
    if (this.provider.providerblacklist && this.provider.providerblacklist['autocomplete-plus-fuzzyprovider']) {
      providerBlacklist = this.provider.providerblacklist['autocomplete-plus-fuzzyprovider'];
    }
    if (providerBlacklist) {
      this.disableDefaultProviderSelectors = _selectorKit.Selector.create(providerBlacklist);
    }

    this.enableCustomTextEditorSelector = _semver2.default.satisfies(this.provider[_privateSymbols.API_VERSION], '>=3.0.0');
  }
コード例 #2
0
  addConfigEntry (config) {
    for (const type in config) {
      const options = config[type]
      if (this.config[type] == null) { this.config[type] = {} }
      if (options.selector != null) { this.config[type].selectors = Selector.create(options.selector) }
      this.config[type].typePriority = options.typePriority != null ? options.typePriority : 1
      this.config[type].wordRegex = this.wordRegex

      const suggestions = this.sanitizeSuggestionsFromConfig(options.suggestions, type)
      if ((suggestions != null) && suggestions.length) { this.config[type].suggestions = suggestions }
    }
  }
コード例 #3
0
 setGlobalBlacklist (globalBlacklist) {
   this.globalBlacklistSelectors = null
   if (globalBlacklist && globalBlacklist.length) {
     this.globalBlacklistSelectors = Selector.create(globalBlacklist)
   }
 }
コード例 #4
0
 setGlobalBlacklist(globalBlacklist) {
   this.globalBlacklistSelectors = null;
   if (globalBlacklist && globalBlacklist.length) {
     this.globalBlacklistSelectors = _selectorKit.Selector.create(globalBlacklist);
   }
 }