File tree Expand file tree Collapse file tree 3 files changed +401
-701
lines changed
Expand file tree Collapse file tree 3 files changed +401
-701
lines changed Original file line number Diff line number Diff line change 429429 }
430430 },
431431 "devDependencies" : {
432+ "@types/bent" : " ^7.3.2" ,
432433 "@types/cheerio" : " ^0.22.30" ,
433434 "@types/glob" : " ^7.1.4" ,
434435 "@types/js-yaml" : " ^4.0.5" ,
435436 "@types/lodash-es" : " ^4.17.3" ,
436437 "@types/lru-cache" : " ^7.6.1" ,
437438 "@types/mocha" : " ^9.0.0" ,
438439 "@types/node" : " ^17.0.23" ,
439- "@types/request-promise-native" : " ^1.0.17" ,
440440 "@types/vscode" : " ^1.52.0" ,
441441 "@types/which" : " ^2.0.1" ,
442442 "@types/yauzl" : " ^2.9.1" ,
461461 " justusadam.language-haskell"
462462 ],
463463 "dependencies" : {
464+ "bent" : " ^7.3.12" ,
464465 "cheerio" : " ^1.0.0-rc.10" ,
465466 "extend" : " >=3.0.2" ,
466467 "js-yaml" : " ^4.1.0" ,
467468 "lodash-es" : " ^4.17.21" ,
468469 "lru-cache" : " ^7.7.3" ,
469- "request" : " ^2.88.2" ,
470- "request-promise-native" : " ^1.0.8" ,
471470 "ts-pattern" : " ^4.0.1" ,
472471 "vscode-languageclient" : " ^7.0.0" ,
473472 "which" : " ^2.0.1" ,
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ import * as cheerio from 'cheerio';
22import * as yaml from 'js-yaml' ;
33import escapeRegExp from 'lodash-es/escapeRegExp' ;
44import * as LRUCache from 'lru-cache' ;
5- import * as request from 'request-promise-native ' ;
5+ import * as bent from 'bent ' ;
66import * as vscode from 'vscode' ;
77import { CommandNames } from './constants' ;
88
9+ const getJson = bent ( 'json' ) ;
10+
911const askHoogle = async ( variable : string ) : Promise < any > => {
10- return await request ( {
11- url : `https://hoogle.haskell.org/?hoogle=${ variable } &scope=set%3Astackage&mode=json` ,
12- json : true ,
13- } ) . promise ( ) ;
12+ return await getJson (
13+ `https://hoogle.haskell.org/?hoogle=${ variable } &scope=set%3Astackage&mode=json`
14+ ) ;
1415} ;
1516
1617const withCache =
You can’t perform that action at this time.
0 commit comments