mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
WIP
This commit is contained in:
12
src/cmd.js
12
src/cmd.js
@@ -759,6 +759,7 @@ const load_dir = (state, dir) => {
|
||||
collect_files(dir).map(f => [f.path, f.contents])
|
||||
)
|
||||
|
||||
// Clear parse cache and rerun code
|
||||
return rerun_code({
|
||||
...state,
|
||||
// remove cache
|
||||
@@ -773,6 +774,15 @@ const create_file = (state, dir, current_module) => {
|
||||
return {...load_dir(state, dir), current_module}
|
||||
}
|
||||
|
||||
const open_run_window = state => {
|
||||
// After we reopen run window, we should reload external modules in the
|
||||
// context of new window. Clear external_imports_cache
|
||||
return rerun_code({
|
||||
...state,
|
||||
external_imports_cache: null,
|
||||
})
|
||||
}
|
||||
|
||||
export const get_initial_state = state => {
|
||||
const with_files = state.project_dir == null
|
||||
? state
|
||||
@@ -798,7 +808,7 @@ export const get_initial_state = state => {
|
||||
|
||||
export const COMMANDS = {
|
||||
input,
|
||||
rerun_code,
|
||||
open_run_window,
|
||||
load_dir,
|
||||
create_file,
|
||||
step_into,
|
||||
|
||||
Reference in New Issue
Block a user