@mojir/lits 2.1.26 → 2.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11353,7 +11353,7 @@ function generateDocString(reference) {
11353
11353
  .replace(/`(.+?)`/g, '$1')
11354
11354
  .replace(/\$(\w+)/g, '$1')
11355
11355
  .replace(/\*\*\*(.+)\*\*\*/g, '$1')
11356
- .replace(/\*\*\$(.+)\*\*/g, '$1'), "\n\n Signature:\n ").concat(signature(reference).join('\n '), "\n\n Arguments:\n ").concat(argStrings(reference).join('\n '), "\n \n Examples:\n").concat(reference.examples.map(function (example) { return smartTrim(example, 4); }).join('\n\n')));
11356
+ .replace(/\*\*(.+)\*\*/g, '$1'), "\n\n Signature:\n ").concat(signature(reference).join('\n '), "\n\n Arguments:\n ").concat(argStrings(reference).join('\n '), "\n \n Examples:\n").concat(reference.examples.map(function (example) { return smartTrim(example, 4); }).join('\n\n')));
11357
11357
  }
11358
11358
  function signature(_a) {
11359
11359
  var title = _a.title, variants = _a.variants, args = _a.args, returns = _a.returns, _isOperator = _a._isOperator;
@@ -15098,27 +15098,47 @@ var AutoCompleter = /** @class */ (function () {
15098
15098
  };
15099
15099
  AutoCompleter.prototype.generateSuggestions = function (params) {
15100
15100
  var _this = this;
15101
+ var blacklist = new Set(['0_def', '0_defn', '0_fn']);
15102
+ var startsWithCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
15103
+ return !blacklist.has(suggestion) && suggestion.startsWith(_this.searchString);
15104
+ });
15105
+ startsWithCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
15106
+ var startsWithCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
15107
+ return !blacklist.has(suggestion) && suggestion.toLowerCase().startsWith(_this.searchString.toLowerCase());
15108
+ });
15109
+ startsWithCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
15110
+ var includesCaseSensitive = this.generateWithPredicate(params, function (suggestion) {
15111
+ return !blacklist.has(suggestion) && suggestion.includes(_this.searchString);
15112
+ });
15113
+ includesCaseSensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
15114
+ var includesCaseInsensitive = this.generateWithPredicate(params, function (suggestion) {
15115
+ return !blacklist.has(suggestion) && suggestion.includes(_this.searchString.toLowerCase());
15116
+ });
15117
+ includesCaseInsensitive.forEach(function (suggestion) { return blacklist.add(suggestion); });
15118
+ return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(startsWithCaseSensitive), false), __read(startsWithCaseInsensitive), false), __read(includesCaseSensitive), false), __read(includesCaseInsensitive), false);
15119
+ };
15120
+ AutoCompleter.prototype.generateWithPredicate = function (params, shouldInclude) {
15101
15121
  var _a, _b, _c, _d;
15102
15122
  var suggestions = new Set();
15103
- litsCommands.forEach(function (name) {
15104
- if (name.startsWith(_this.searchString)) {
15105
- suggestions.add(name);
15123
+ litsCommands.forEach(function (suggestion) {
15124
+ if (shouldInclude(suggestion)) {
15125
+ suggestions.add(suggestion);
15106
15126
  }
15107
15127
  });
15108
15128
  Object.keys((_a = params.globalContext) !== null && _a !== void 0 ? _a : {})
15109
- .filter(function (name) { return name.startsWith(_this.searchString); })
15110
- .forEach(function (name) { return suggestions.add(name); });
15129
+ .filter(shouldInclude)
15130
+ .forEach(function (suggestion) { return suggestions.add(suggestion); });
15111
15131
  (_b = params.contexts) === null || _b === void 0 ? void 0 : _b.forEach(function (context) {
15112
15132
  Object.keys(context)
15113
- .filter(function (name) { return name.startsWith(_this.searchString); })
15114
- .forEach(function (name) { return suggestions.add(name); });
15133
+ .filter(shouldInclude)
15134
+ .forEach(function (suggestion) { return suggestions.add(suggestion); });
15115
15135
  });
15116
15136
  Object.keys((_c = params.jsFunctions) !== null && _c !== void 0 ? _c : {})
15117
- .filter(function (name) { return name.startsWith(_this.searchString); })
15118
- .forEach(function (name) { return suggestions.add(name); });
15137
+ .filter(shouldInclude)
15138
+ .forEach(function (suggestion) { return suggestions.add(suggestion); });
15119
15139
  Object.keys((_d = params.values) !== null && _d !== void 0 ? _d : {})
15120
- .filter(function (name) { return name.startsWith(_this.searchString); })
15121
- .forEach(function (name) { return suggestions.add(name); });
15140
+ .filter(shouldInclude)
15141
+ .forEach(function (suggestion) { return suggestions.add(suggestion); });
15122
15142
  return __spreadArray([], __read(suggestions), false).sort(function (a, b) { return a.localeCompare(b); });
15123
15143
  };
15124
15144
  return AutoCompleter;