@@ -3,7 +3,6 @@ import { ThunkAction as ReduxThunkAction, AnyAction } from '@reduxjs/toolkit';
33
44import {
55 codeSelector ,
6- clippyRequestSelector ,
76 getCrateType ,
87 runAsTest ,
98 wasmLikelyToWork ,
@@ -84,9 +83,6 @@ export enum ActionType {
8483 EnableFeatureGate = 'ENABLE_FEATURE_GATE' ,
8584 GotoPosition = 'GOTO_POSITION' ,
8685 SelectText = 'SELECT_TEXT' ,
87- RequestClippy = 'REQUEST_CLIPPY' ,
88- ClippySucceeded = 'CLIPPY_SUCCEEDED' ,
89- ClippyFailed = 'CLIPPY_FAILED' ,
9086 RequestMiri = 'REQUEST_MIRI' ,
9187 MiriSucceeded = 'MIRI_SUCCEEDED' ,
9288 MiriFailed = 'MIRI_FAILED' ,
@@ -346,42 +342,6 @@ interface GeneralSuccess {
346342 stderr : string ;
347343}
348344
349- const requestClippy = ( ) =>
350- createAction ( ActionType . RequestClippy ) ;
351-
352- interface ClippyRequestBody {
353- code : string ;
354- edition : string ;
355- crateType : string ;
356- }
357-
358- interface ClippyResponseBody {
359- success : boolean ;
360- stdout : string ;
361- stderr : string ;
362- }
363-
364- type ClippySuccess = GeneralSuccess ;
365-
366- const receiveClippySuccess = ( { stdout, stderr } : ClippySuccess ) =>
367- createAction ( ActionType . ClippySucceeded , { stdout, stderr } ) ;
368-
369- const receiveClippyFailure = ( { error } : GenericApiFailure ) =>
370- createAction ( ActionType . ClippyFailed , { error } ) ;
371-
372- export function performClippy ( ) : ThunkAction {
373- // TODO: Check a cache
374- return function ( dispatch , getState ) {
375- dispatch ( requestClippy ( ) ) ;
376-
377- const body : ClippyRequestBody = clippyRequestSelector ( getState ( ) ) ;
378-
379- return jsonPost < ClippyResponseBody > ( routes . clippy , body )
380- . then ( json => dispatch ( receiveClippySuccess ( json ) ) )
381- . catch ( json => dispatch ( receiveClippyFailure ( json ) ) ) ;
382- } ;
383- }
384-
385345const requestMiri = ( ) =>
386346 createAction ( ActionType . RequestMiri ) ;
387347
@@ -597,9 +557,6 @@ export type Action =
597557 | ReturnType < typeof enableFeatureGate >
598558 | ReturnType < typeof gotoPosition >
599559 | ReturnType < typeof selectText >
600- | ReturnType < typeof requestClippy >
601- | ReturnType < typeof receiveClippySuccess >
602- | ReturnType < typeof receiveClippyFailure >
603560 | ReturnType < typeof requestMiri >
604561 | ReturnType < typeof receiveMiriSuccess >
605562 | ReturnType < typeof receiveMiriFailure >
0 commit comments