@@ -2,7 +2,6 @@ import fetch from 'isomorphic-fetch';
22import { ThunkAction as ReduxThunkAction , AnyAction } from '@reduxjs/toolkit' ;
33
44import {
5- codeSelector ,
65 getCrateType ,
76 runAsTest ,
87 wasmLikelyToWork ,
@@ -82,9 +81,6 @@ export enum ActionType {
8281 EnableFeatureGate = 'ENABLE_FEATURE_GATE' ,
8382 GotoPosition = 'GOTO_POSITION' ,
8483 SelectText = 'SELECT_TEXT' ,
85- RequestMacroExpansion = 'REQUEST_MACRO_EXPANSION' ,
86- MacroExpansionSucceeded = 'MACRO_EXPANSION_SUCCEEDED' ,
87- MacroExpansionFailed = 'MACRO_EXPANSION_FAILED' ,
8884 NotificationSeen = 'NOTIFICATION_SEEN' ,
8985 BrowserWidthChanged = 'BROWSER_WIDTH_CHANGED' ,
9086}
@@ -252,10 +248,6 @@ const performTestOnly = (): ThunkAction => (dispatch, getState) => {
252248 return dispatch ( performCommonExecute ( crateType , true ) ) ;
253249} ;
254250
255- interface GenericApiFailure {
256- error : string ;
257- }
258-
259251const performCompileToNightlyHirOnly = ( ) : ThunkAction => dispatch => {
260252 dispatch ( changeChannel ( Channel . Nightly ) ) ;
261253 dispatch ( performCompileToHirOnly ( ) ) ;
@@ -331,51 +323,6 @@ export const gotoPosition = (line: string | number, column: string | number) =>
331323export const selectText = ( start : Position , end : Position ) =>
332324 createAction ( ActionType . SelectText , { start, end } ) ;
333325
334- interface GeneralSuccess {
335- stdout : string ;
336- stderr : string ;
337- }
338-
339- const requestMacroExpansion = ( ) =>
340- createAction ( ActionType . RequestMacroExpansion ) ;
341-
342- interface MacroExpansionRequestBody {
343- code : string ;
344- edition : string ;
345- }
346-
347- interface MacroExpansionResponseBody {
348- success : boolean ;
349- stdout : string ;
350- stderr : string ;
351- }
352-
353- type MacroExpansionSuccess = GeneralSuccess ;
354-
355- const receiveMacroExpansionSuccess = ( { stdout, stderr } : MacroExpansionSuccess ) =>
356- createAction ( ActionType . MacroExpansionSucceeded , { stdout, stderr } ) ;
357-
358- const receiveMacroExpansionFailure = ( { error } : GenericApiFailure ) =>
359- createAction ( ActionType . MacroExpansionFailed , { error } ) ;
360-
361- export function performMacroExpansion ( ) : ThunkAction {
362- // TODO: Check a cache
363- return function ( dispatch , getState ) {
364- dispatch ( requestMacroExpansion ( ) ) ;
365-
366- const state = getState ( ) ;
367- const code = codeSelector ( state ) ;
368- const { configuration : {
369- edition,
370- } } = state ;
371- const body : MacroExpansionRequestBody = { code, edition } ;
372-
373- return jsonPost < MacroExpansionResponseBody > ( routes . macroExpansion , body )
374- . then ( json => dispatch ( receiveMacroExpansionSuccess ( json ) ) )
375- . catch ( json => dispatch ( receiveMacroExpansionFailure ( json ) ) ) ;
376- } ;
377- }
378-
379326const notificationSeen = ( notification : Notification ) =>
380327 createAction ( ActionType . NotificationSeen , { notification } ) ;
381328
@@ -495,9 +442,6 @@ export type Action =
495442 | ReturnType < typeof enableFeatureGate >
496443 | ReturnType < typeof gotoPosition >
497444 | ReturnType < typeof selectText >
498- | ReturnType < typeof requestMacroExpansion >
499- | ReturnType < typeof receiveMacroExpansionSuccess >
500- | ReturnType < typeof receiveMacroExpansionFailure >
501445 | ReturnType < typeof notificationSeen >
502446 | ReturnType < typeof browserWidthChanged >
503447 | ReturnType < typeof wsExecuteRequest >
0 commit comments