Explorateur de fichiers

The File Explorer is the plugin responsible for managing files. It includes a pop-up menu that is activated when you right-click on a file.

Remix Side Panel showing the File Explorer and the Icon Panel highlighting the File Explorer icon.

The green shield icon at the top of the File Explorer page on the Sidebar indicates that the plugin is maintained by Remix Team. When you click the caret next to the icon, the Sidebar will display details about the plugin, including a link to its documentation page.

Remix Team shield icon and caret.

File storage

By default, Remix IDE stores files in IndexedDB, a database built into the browser. Your data is only stored locally in your browser and not on an external server.

Browser storage is ephemeral and browser crashes might lead to complete loss of data

Thus, it is important to have an alternative file backup/saving strategy.

Some recommended strategies include:

Remix Desktop

Remix Desktop is a version of the Remix IDE that exists as a native app on your computer instead of a browser app. Since it’s a native app on your computer, the files are saved directly to your hard drive. You can download Remix Desktop on the releases page.

Astuce

For more information, see the Remix Desktop documentation.

Connecting Remix to remote Git repositories

Remix IDE supports version control with version control platforms like GitHub (or similar like GitLab) and in the InterPlanetary File System (IPFS), allowing you to store the code you write on remote repositories.

The version control operations are managed with Git through the Git plugin. Additionally, you can manage your branches on the Remix IDE using the branch icon that appears at the bottom of the File Explorer after you initialize Git.

Remix IDE Git branches.

Also see this article about securing your files in Remix.

Publishing to a GitHub gist

In addition to these methods, you can also publish your files to a GitHub Gist. This method just takes a snapshot of your project’s current state and publishes it to a GitHub gist. Any changes made after publishing it will not update the published Gist.

To use this feature, you need to add a GitHub access token with the « Create Gist » permission enabled to Remix because the Gist API requires users to be authenticated to be able to publish a gist.

To generate a GitHub token, visit the GitHub Settings page and select « Generate new token ». Ensure you tick the Create gists checkbox and generate a new token. Copy the token and paste it in Remix’s Settings module in the Github Access Token section. And then click « Save ».

After the initial setup, you can publish a gist by right-clicking on a file (publish the file), folder (publish the folder), or Side Bar (publish the entire workspace) and selecting the « Publish folder to gist ».

Astuce

You can publish multiple files by select all of them and right-clicking. The resulting pop-up menu will provide an option to publish them to a gist.

Création de nouveaux fichiers

There are two ways you can create files on the Remix IDE. The first way involves clicking the « Create » dropdown, selecting the « New file » option, and entering the name of the file on the input field that appears.

Remix File Explorer highlighting the create new file icon.

Another way you can create files in Remix is by right-clicking on the Side Bar (creates the file at the root of your project) or right-clicking on a folder in the Side Bar (creates the file in the folder you clicked) and selecting « New File » from the dropdown options.

Remix IDE File Explorer dropdown.

Note

Note that (regardless of the method) when you save a file without providing a file extension, it defaults to the .sol extension.

Menu contextuel du clic droit

Cliquez avec le bouton droit de la souris sur un dossier

En cliquant avec le bouton droit de la souris sur un dossier, vous ferez apparaître un menu contextuel pour les opérations que vous pouvez effectuer sur ce dossier.

Remix File Explorer extra options.

Cliquez avec le bouton droit de la souris sur un fichier Solidity

En cliquant avec le bouton droit de la souris sur un fichier portant l’extension .sol, vous ferez apparaître un menu contextuel comprenant des options de compilation et d’aplatissement, de création de diagrammes UML et de génération de documentation.

File Explorer right click on .sol file

Clic droit sur un script

File Explorer right click on script file

Right-click on any file with a .js or .ts extension to get the Run option in the popup menu to run the script.

Si le script que vous voulez exécuter est le fichier actif dans l’éditeur, vous pouvez également l’exécuter en utilisant le bouton play en haut à gauche de l’éditeur ou en entrant la commande remix.exeCurrent() dans la console.