Live reload on file tree changes and project settings changes (#4142)

* Reload FileTree and File when changed externally

* Added tests

* Make file and project creation a bit more reliable
This commit is contained in:
49fl
2024-10-17 23:42:24 -04:00
committed by GitHub
parent f650281855
commit 785002fa4e
12 changed files with 415 additions and 81 deletions

View File

@ -14,6 +14,7 @@ import { codeManager } from 'lib/singletons'
import { fileSystemManager } from 'lang/std/fileSystemManager'
import { getProjectInfo } from './desktop'
import { createSettings } from './settings/initialSettings'
import { normalizeLineEndings } from 'lib/codeEditor'
// The root loader simply resolves the settings and any errors that
// occurred during the settings load
@ -182,7 +183,3 @@ export const homeLoader: LoaderFunction = async (): Promise<
}
return {}
}
const normalizeLineEndings = (str: string, normalized = '\n') => {
return str.replace(/\r?\n/g, normalized)
}