This repository includes a configuration to set up a Pascal development environment using DevContainers in Visual Studio Code (VSCode). This allows you to develop in a consistent environment without the hassle of manually setting up dependencies on your local machine.
- Visual Studio Code: Make sure you have the latest version of VSCode installed. You can download it from here.
- Docker: Ensure Docker is installed and running on your machine. You can find installation guide here.
- Dev Containers Extension: Install the "Dev Containers" extension in VSCode. You can find it here.
-
Clone the Repository:
git clone https://github.com/Whitomtit/VSCode-Pascal.git cd VSCode-Pascal
-
Open the Repository in VSCode: Open VSCode and select
File > Open Folder...
, then choose the cloned repository folder. -
Reopen in Container:
- Once the repository is open in VSCode, you should see a prompt at the bottom right corner asking if you want to reopen the folder in a container. Click on
Reopen in Container
. - If you don't see the prompt, you can manually reopen in container by pressing
F1
, then typing and selectingDev Containers: Reopen in Container
.
- Once the repository is open in VSCode, you should see a prompt at the bottom right corner asking if you want to reopen the folder in a container. Click on
This repository is configured to use the Free Pascal Compiler (FPC). Follow these steps to compile and run your Pascal files:
-
Open a Terminal: Open a terminal in the container by pressing
Ctrl+`
(backtick) or selectingTerminal > New Terminal
. -
Compile the Pascal File:
fpc yourfile.pas
Replace
yourfile.pas
with the name of your Pascal source file. This command will generate an executable file in the same directory. -
Run the Executable:
./yourfile
Replace
yourfile
with the name of the generated executable (typically, the same as your Pascal file name without the.pas
extension).
- Start the Container: Automatically handled when you open the folder in the container.
- Access the Terminal: You can open a terminal inside the container by pressing
Ctrl+`
(backtick) or selectingTerminal > New Terminal
.
- Container Fails to Start: Ensure Docker is running and you have the latest version of VSCode and the Dev Containers extension.