Why does VScode delete code permanently when working remotely? - visual-studio-code

Question's in the title.
I got me curious since, when working locally, deleting files sends them to the trash bin.
When working remotely, is there no way to send a file to either the local or the remote trash bin?
Is there a technical reason this basic feature is missing, or is it just a feature not implemented yet?

Related

ftp-kr - Cannot edit in read-only editor

I cannot figure out how to use the ftp-kr extension for VS Code properly. I have read and re-read the GitHub Wiki and the README documentation and cannot find any other help for my issue. I posted this question to the project Issues on GitHub but have yet to receive a response.
ftp-kr is just a simple extension for editing files via FTP that are located on a remote server. Many other users seem to be using the extension with no issue.
I installed the extension, and then I successfully edited the connection settings (in ftp-kr.json) and successfully made a connection to the remote server I am trying to edit files on.
I opened the FTP-KR: EXPLORER pane to look at all of the files on the server, but if I double-click any of the files to open them and then try to edit them, I am unable to type and just get a warning in VS Code that says "Cannot edit in read-only editor".
I have tried right-clicking on files and clicking the "Download This" button, thinking that maybe I need to download a local copy of the files to edit before uploading the changes. However, whenever I click the "Download This" option on any file in the ftp-kr Explorer, it just gives me an error message that says "[file_name] is not in remotePath".
I tried running the >ftp-kr: Download All command, but it just spits out a notice that says "Nothing to DO".
How do I edit files located on the remote server and save those changes to the server?
P.S. I have tried the solutions found in this question but unfortunately none of them seem to work. Particularly, "code-runner: Run in terminal" is not in my settings and "Edit in Local" is not a context menu item that appears in my editor.
After a number of months, I finally have a solution to this thanks to the developer eventually responding on GitHub. There are a few things going on here.
Any file that a user wishes to modify must be downloaded as a local copy on the user's machine first and then that copy can be uploaded to the webserver via FTP.
ftp-kr cannot auto-download individual files. (Either when they are double-clicked on or through any other method.) It can only download entire directories, and those directories can be changed by using the localPath and ignore options in the configuration file, then stopping and restarting the ftp connection.
The "Download This" context menu option that appears is a piece of non-implemented code. It will not do anything.
>ftp-kr: Download All is the preferred way (by the developer's intent) to download the remote files onto the user's computer. The fact that it was returning an error before was a bug which has now been fixed.
Confusingly, the user can view the filenames and context of every file on the remote file system using a convenient tree view, you just cannot simply download any of those files individually.
In all, this plugin does not provide the functionality that I hoped it would have. (Namely, being able to easily download, modify, and upload individual files.) So I know how to properly use it, I will just be switching to a different plugin for my purposes.

How to automatically-selectively backup critical files on edit?

I have just accidentally deleted one week of coding source files, and even testdisk does not restore them. Even executable jars gone... I use ubuntu. I dont want that happen ever again. How to sufficiently and efficiently make automatic backups (clones) of selected critical files to a different location e.g. home?
I use java, and eclipse as IDE, but this could be any file i work with. E.g. i select certain file, because i can accidentally delete it, so this lightweight backup tool would automatically update it in saved backup location according to saved changes. So if it is lost in working directory, as in my case, i can just take it from backup site on local machine. Pls help. I feel devastated...
cwatch might be a solution i am looking for, but it is too complicated.
p.s. i am aware of question Script to perform a local backup of files stored in Google drive
google services not ok for me.
The simplest solution would be to use GitHub or Bitbucket and to regularly push the changes you made to the online repository. You will benefit more from the usage of a version control software then from a local backup. You can use either of them for free.

Powershell copy vs move cmd

I'm running into some issues with my existing powershell script that copies data from a remote location into a local folder - that local folder also happens to be sync'd with google drive for desktop.
I'm seeing incomplete files being uploaded etc. In order to combat this I think it would be easier/better to change where the initial remote > local is putting its files, and instead of copying directly into the sync folder - copy into a temp/staging location that's NOT the sync folder.
Once that process is complete then use the powershell move-cmd to simply 'move' which will just update file locators to be that of the sync folder.
I think this will solve my issue.
Anyone see any problems with this approach?
If you have ruled out device connectivity, multiple files being uploaded at once vs. a single file being uploaded, and mobile device app or internet browser there is nothing wrong with your approach. If you need anymore assistance please reply to this thread or mark this as the answer.

How to get FTP-Simple working in Visual Studio Code?

I recently opted to start using Visual Studio Code. I want to connect to a remote server and edit files directly on the server. FTP-Simple seems like a great solution. But I am having a hard time understanding some basics about the program.
If I make a connection to a server, does FTP-Simple download all the actual files to my hard drive?
Also, I was able to make a connection, but in one of the directories there should be a sub-directory and it's missing. What am I doing wrong?
Can someone point me to some good documentation for this extension such as video(s), etc.
If I make a connection to a server, does FTP-Simple download all the
actual files to my hard drive?
Yes, It download all to your hard drive. you can find an address like below:
C:\Users\your user name\AppData\Roaming\Code\User\ftp-simple\remote-workspace-temp\cbc1ad9ed60f12ec861052806d7833db\httpdocs
for opening a directory in VSCode you can press F1 type ftp-config then click ftp-config:Open
and click on target directory you want to open for more information use this
2 years later and I'm having the same problem. I have already uninstalled ftp simple as well as VSC with no effect.
The plugin just doesn't download all the files on the FTP. It worked the first time I installed it for 2-3 weeks and then suddenly stopped being in sync with the FTP server.
There is a folder called "code" on mac in Library/Application Support where most of VSC data is saved, but deleting this didn't have an effect either. Perhaps it works for someone else, as this is apparently necessary to fully deinstall VSC.
I'd pay for good plugin that just allows to work remotely on ftp files!!

Netbeans - Open remote folder/new project

I have been using Netbeans for several months now and like it a lot. I am trying to enable a way to create a project which accesses live files on my server to make changes. When I create a project using a remote source, it starts downloading all the server files to my computer. This would be just fine, except for the fact that (a) the server has a few gigs of files on it and (b) there are two of us that will be making changes on the server.
In the past, I have worked with IDEs that just open an FTP or SFTP connection and will download the file you want to edit, and then upload that file back to the server when you save it. Preferably, this is what I would like Netbeans to do.
I have tried adding a FTP folder in Windows, but Netbeans won't open it. I have tried using Swish and setting up an SFTP folder, and Netbeans won't find the Swish folder altogether.
On a side note, I understand what I am doing is horrible practice, but it is a small site and I am usually the only one working on it. I haven't worked on the website in the past several weeks and just thought it would be easier to get access directly than re-downloading the entire server's worth of code/images/videos/etc. Any help would be appreciated.
NetBeans does not support what you want to do. However, if you put your site under Subversion/Git (revision control), you could check out the content, modify it locally and push modification back remotely.
This would also help avoiding code clashes when your friends work on your website too.
Actually Netbeans supports this for php projects.
Just choose :
PHP Application from remote server
(but git is the best solution anw as it gives you version control as well but the above is useful if you want your server files to be updated when you just press ctr+s)