Skip to content

Commit 10d13d6

Browse files
committed
fix: remove lodash from autocomplete
1 parent 2fbbb98 commit 10d13d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/services/provided/autocomplete.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AutocompleteProvider } from "atom/autocomplete-plus";
2-
import _ from "lodash";
2+
import head from "lodash/head";
33
import Anser from "anser";
44
import { log, char_idx_to_js_idx } from "../../utils";
55
import type { Store } from "../../store";
@@ -37,7 +37,7 @@ function parseCompletions(results: CompleteReply, prefix: string) {
3737
const comps = metadata._jupyter_types_experimental;
3838

3939
if (comps.length > 0 && comps[0].text) {
40-
return _.map(comps, (match) => {
40+
return comps.map((match) => {
4141
const text = match.text;
4242
const start = match.start && match.end ? match.start : cursor_start;
4343
const end = match.start && match.end ? match.end : cursor_end;
@@ -56,7 +56,7 @@ function parseCompletions(results: CompleteReply, prefix: string) {
5656
}
5757

5858
const replacementPrefix = prefix.slice(cursor_start, cursor_end);
59-
return _.map(matches, (match) => {
59+
return matches.map((match) => {
6060
const text = match;
6161
const replacedText = prefix.slice(0, cursor_start) + text;
6262
return {
@@ -101,7 +101,7 @@ export function provideAutocompleteResults(store: Store): AutocompleteProvider {
101101
const regex = regexes[kernel.language];
102102

103103
if (regex) {
104-
prefix = _.head(line.match(regex)) || "";
104+
prefix = head(line.match(regex)) || "";
105105
} else {
106106
prefix = line;
107107
}

0 commit comments

Comments
 (0)