Commit 8da6aa5 1 parent c633fe2 commit 8da6aa5 Copy full SHA for 8da6aa5
File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
import { CompositeDisposable , Emitter , Disposable } from 'atom'
2
+ import type { SelectListView } from "atom-select-list"
2
3
3
- // https://github.com/atom/atom-select-list/pull/28
4
- let SelectListView : any
4
+ let SelectListViewImport : SelectListView
5
5
type ToggleAction = 'enable' | 'disable'
6
6
7
7
export default class ToggleProviders {
@@ -40,19 +40,19 @@ export default class ToggleProviders {
40
40
}
41
41
atom . config . set ( 'linter.disabledProviders' , this . disabledProviders )
42
42
}
43
- show ( ) {
44
- if ( ! SelectListView ) {
45
- SelectListView = require ( 'atom-select-list' )
43
+ async show ( ) {
44
+ if ( SelectListViewImport === undefined ) {
45
+ SelectListViewImport = await import ( 'atom-select-list' )
46
46
}
47
- const selectListView = new SelectListView ( {
47
+ const selectListView = new SelectListViewImport ( {
48
48
items : this . getItems ( ) ,
49
49
emptyMessage : 'No matches found' ,
50
- elementForItem : ( item : any ) => {
50
+ elementForItem : ( item : string ) => {
51
51
const li = document . createElement ( 'li' )
52
52
li . textContent = item
53
53
return li
54
54
} ,
55
- didConfirmSelection : ( item : any ) => {
55
+ didConfirmSelection : ( item : string ) => {
56
56
try {
57
57
this . process ( item )
58
58
this . dispose ( )
You can’t perform that action at this time.
0 commit comments