You can connect your VS Code or another code editor using SFTP with your cpanel account using SSH access.
Step1: Download VS Code extension "SFTP" Step2: go to cpanel and enable SSH access Step3: use the Private Key to setup the SFTP inside VS Code
No you will be able to sync the local changes to the cpanel as and when required.