@@ -7,19 +7,13 @@ import {
77} from './selectors' ;
88import State from './state' ;
99import {
10- AssemblyFlavor ,
1110 Backtrace ,
1211 Channel ,
13- DemangleAssembly ,
1412 Edition ,
15- Editor ,
1613 Mode ,
17- Orientation ,
18- PairCharacters ,
1914 PrimaryAction ,
2015 PrimaryActionAuto ,
2116 PrimaryActionCore ,
22- ProcessAssembly ,
2317} from './types' ;
2418
2519import { performCommonExecute , wsExecuteRequest } from './reducers/output/execute' ;
@@ -31,6 +25,13 @@ import { performCompileToMirOnly } from './reducers/output/mir';
3125import { performCompileToWasmOnly } from './reducers/output/wasm' ;
3226import { navigateToHelp , navigateToIndex } from './reducers/page' ;
3327import { addCrateType , editCode } from './reducers/code' ;
28+ import {
29+ changeBacktrace ,
30+ changeChannel ,
31+ changeEditionRaw ,
32+ changeMode ,
33+ changePrimaryAction ,
34+ } from './reducers/configuration' ;
3435
3536export type ThunkAction < T = void > = ReduxThunkAction < T , State , { } , Action > ;
3637export type SimpleThunkAction < T = void > = ReduxThunkAction < T , State , { } , AnyAction > ;
@@ -41,73 +42,10 @@ const createAction = <T extends string, P extends {}>(type: T, props?: P) => (
4142
4243export enum ActionType {
4344 InitializeApplication = 'INITIALIZE_APPLICATION' ,
44- ChangeEditor = 'CHANGE_EDITOR' ,
45- ChangeKeybinding = 'CHANGE_KEYBINDING' ,
46- ChangeAceTheme = 'CHANGE_ACE_THEME' ,
47- ChangeMonacoTheme = 'CHANGE_MONACO_THEME' ,
48- ChangePairCharacters = 'CHANGE_PAIR_CHARACTERS' ,
49- ChangeOrientation = 'CHANGE_ORIENTATION' ,
50- ChangeAssemblyFlavor = 'CHANGE_ASSEMBLY_FLAVOR' ,
51- ChangePrimaryAction = 'CHANGE_PRIMARY_ACTION' ,
52- ChangeChannel = 'CHANGE_CHANNEL' ,
53- ChangeDemangleAssembly = 'CHANGE_DEMANGLE_ASSEMBLY' ,
54- ChangeProcessAssembly = 'CHANGE_PROCESS_ASSEMBLY' ,
55- ChangeMode = 'CHANGE_MODE' ,
56- ChangeEdition = 'CHANGE_EDITION' ,
57- ChangeBacktrace = 'CHANGE_BACKTRACE' ,
5845}
5946
6047export const initializeApplication = ( ) => createAction ( ActionType . InitializeApplication ) ;
6148
62- export const changeEditor = ( editor : Editor ) =>
63- createAction ( ActionType . ChangeEditor , { editor } ) ;
64-
65- export const changeKeybinding = ( keybinding : string ) =>
66- createAction ( ActionType . ChangeKeybinding , { keybinding } ) ;
67-
68- export const changeAceTheme = ( theme : string ) =>
69- createAction ( ActionType . ChangeAceTheme , { theme } ) ;
70-
71- export const changeMonacoTheme = ( theme : string ) =>
72- createAction ( ActionType . ChangeMonacoTheme , { theme } ) ;
73-
74- export const changePairCharacters = ( pairCharacters : PairCharacters ) =>
75- createAction ( ActionType . ChangePairCharacters , { pairCharacters } ) ;
76-
77- export const changeOrientation = ( orientation : Orientation ) =>
78- createAction ( ActionType . ChangeOrientation , { orientation } ) ;
79-
80- export const changeAssemblyFlavor = ( assemblyFlavor : AssemblyFlavor ) =>
81- createAction ( ActionType . ChangeAssemblyFlavor , { assemblyFlavor } ) ;
82-
83- export const changeDemangleAssembly = ( demangleAssembly : DemangleAssembly ) =>
84- createAction ( ActionType . ChangeDemangleAssembly , { demangleAssembly } ) ;
85-
86- export const changeProcessAssembly = ( processAssembly : ProcessAssembly ) =>
87- createAction ( ActionType . ChangeProcessAssembly , { processAssembly } ) ;
88-
89- const changePrimaryAction = ( primaryAction : PrimaryAction ) =>
90- createAction ( ActionType . ChangePrimaryAction , { primaryAction } ) ;
91-
92- export const changeChannel = ( channel : Channel ) =>
93- createAction ( ActionType . ChangeChannel , { channel } ) ;
94-
95- export const changeMode = ( mode : Mode ) =>
96- createAction ( ActionType . ChangeMode , { mode } ) ;
97-
98- const changeEditionRaw = ( edition : Edition ) =>
99- createAction ( ActionType . ChangeEdition , { edition } ) ;
100-
101- export const changeEdition = ( edition : Edition ) : ThunkAction => dispatch => {
102- if ( edition === Edition . Rust2024 ) {
103- dispatch ( changeChannel ( Channel . Nightly ) ) ;
104- }
105-
106- dispatch ( changeEditionRaw ( edition ) ) ;
107- }
108-
109- export const changeBacktrace = ( backtrace : Backtrace ) =>
110- createAction ( ActionType . ChangeBacktrace , { backtrace } ) ;
11149
11250export const reExecuteWithBacktrace = ( ) : ThunkAction => dispatch => {
11351 dispatch ( changeBacktrace ( Backtrace . Enabled ) ) ;
@@ -274,20 +212,11 @@ export function showExample(code: string): ThunkAction {
274212
275213export type Action =
276214 | ReturnType < typeof initializeApplication >
277- | ReturnType < typeof changePairCharacters >
278- | ReturnType < typeof changeAssemblyFlavor >
279215 | ReturnType < typeof changeBacktrace >
280216 | ReturnType < typeof changeChannel >
281- | ReturnType < typeof changeDemangleAssembly >
282217 | ReturnType < typeof changeEditionRaw >
283- | ReturnType < typeof changeEditor >
284- | ReturnType < typeof changeKeybinding >
285218 | ReturnType < typeof changeMode >
286- | ReturnType < typeof changeOrientation >
287219 | ReturnType < typeof changePrimaryAction >
288- | ReturnType < typeof changeProcessAssembly >
289- | ReturnType < typeof changeAceTheme >
290- | ReturnType < typeof changeMonacoTheme >
291220 | ReturnType < typeof editCode >
292221 | ReturnType < typeof addCrateType >
293222 | ReturnType < typeof navigateToIndex >
0 commit comments