1
1
import { AutocompleteProvider } from "atom/autocomplete-plus" ;
2
- import _ from "lodash" ;
2
+ import head from "lodash/head " ;
3
3
import Anser from "anser" ;
4
4
import { log , char_idx_to_js_idx } from "../../utils" ;
5
5
import type { Store } from "../../store" ;
@@ -37,7 +37,7 @@ function parseCompletions(results: CompleteReply, prefix: string) {
37
37
const comps = metadata . _jupyter_types_experimental ;
38
38
39
39
if ( comps . length > 0 && comps [ 0 ] . text ) {
40
- return _ . map ( comps , ( match ) => {
40
+ return comps . map ( ( match ) => {
41
41
const text = match . text ;
42
42
const start = match . start && match . end ? match . start : cursor_start ;
43
43
const end = match . start && match . end ? match . end : cursor_end ;
@@ -56,7 +56,7 @@ function parseCompletions(results: CompleteReply, prefix: string) {
56
56
}
57
57
58
58
const replacementPrefix = prefix . slice ( cursor_start , cursor_end ) ;
59
- return _ . map ( matches , ( match ) => {
59
+ return matches . map ( ( match ) => {
60
60
const text = match ;
61
61
const replacedText = prefix . slice ( 0 , cursor_start ) + text ;
62
62
return {
@@ -101,7 +101,7 @@ export function provideAutocompleteResults(store: Store): AutocompleteProvider {
101
101
const regex = regexes [ kernel . language ] ;
102
102
103
103
if ( regex ) {
104
- prefix = _ . head ( line . match ( regex ) ) || "" ;
104
+ prefix = head ( line . match ( regex ) ) || "" ;
105
105
} else {
106
106
prefix = line ;
107
107
}
0 commit comments