diff --git a/plugin/src/hooks/useRemixClient.ts b/plugin/src/hooks/useRemixClient.ts index 29323f95..3c5d7d85 100644 --- a/plugin/src/hooks/useRemixClient.ts +++ b/plugin/src/hooks/useRemixClient.ts @@ -38,6 +38,11 @@ const createExampleWorkspace = async (client: typeof remixClient): Promise `hello_world/${filePath}/${file.fileName}`, fileContent ) + } else if (file != null) { + await client.fileManager.writeFile( + `hello_world/${filePath}/${file.fileName}`, + fileContent + ) } } } catch (e) { @@ -187,6 +192,9 @@ const useRemixClient = (): { } ) + remixClient.on('fileManager', 'currentFileChanged', (_: any) => { + getAndSetTomlPaths(remixClient, currWorkspacePath, setTomlPaths).catch(e => { console.error(e) }) + }) remixClient.on('fileManager', 'fileAdded', (_: any) => { getAndSetTomlPaths(remixClient, currWorkspacePath, setTomlPaths).catch(e => { console.error(e) }) })