ftp-kr - Cannot edit in read-only editor - visual-studio-code

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.

Related

How can I change VS Code Remote Server's default download folder?

I often download file from vscode remote server, but how could I change default download folder? It always opens a specific folder I don't want to download into.
I don't know about configuring the detault download directory, but there was an issue created and resolved to get VS Code to Remember target directory when downloading files #140358, which was implemented in commit ca936dc.
bpasero (one of the VS Code maintainers) commented to close that issue as resolved:
For the "Download" command we now remember the path where to download and restore that. This information is stored globally (i.e. applies to all windows) but will not roam via settings sync, because paths are typically machine local.
Previously we did a questionable computation of a default path that typically always ended up in the user home directory, which imho does not make a lot of sense for the download operation.
Verification:
connect desktop to any remote
right click from the explorer "Download"
pick a destination
repeat and verify the destination restores even across restarts

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!!

Eclipse local file history

In eclipse, you can right click in a file and then select Team / Show local history. This shows your local saves and is pretty useful.
Now, I made some changes to a file. I am 100% certain I made them. But they have disappeared. Overwritten by someone else I guess. But when I check my local history I can't see my file changes.
My question is:
Does Eclipse always update the local file history for every save? How reliable is it?
Note: I appreciate people are thinking how can someone else overwrite your files. I am working in a force.com project. When you make changes to a file they are push to a central server. There is source control per se. It is like everyone working with a shared folder.
It depends. Each Eclipse plugin dealing with workspace artifacts can optionally set a flag for local history in its API calls to the workspace resource management when deleting or changing files. If the flag is set, changed files surely get copied into local history. But every plugin can set this flag different.
So even if you might have an editor plugin which always uses local history when saving the edited file, another plugin might delete/modify the file without using local history and therefore interfere.
Summary: Local history is not a reliable way to go back to previously saved versions of a file.
If anyone else runs into this issue, check to make sure you didn't accidentally edit a file in a build or target directory. For instance if you are working on a jsp page and make edits, swear you changed it but they are no longer there in the editor or the local history when you open the file, check to make sure you weren't editing the built version by accident.
This sometimes happens if you are quick to use ctrl-shift-R shortcut to open resources. To avoid this, you can set your build or target folder to derived by right clicking on the folder and checking the derived checkbox. This will prevent the resource from showing in the Open Resource view which could save you headaches later.
To get the code back, I opened the target version and used undo to get to the edited version.

Files on my WebDAV mapped drive output rendered files in IDEs instead of actual content

On my mac I mounted a shared drive using WebDAV by going to "Finder > Go > Connect to server".
Now, when I try to view the files using TextWranger or TextEdit I can see the PHP code that I want to edit.
However, if I try to use an IDE like NetBeans/Eclipse/TextMate and create a new project with my shared drive as the "Existing sources" folder I cannot see the PHP code.
Instead I see the HTML output of the files as if I were seeing them through a web browser. Also, if I try to view a file that isn't normally accessibility (a command line script) I see the output as if it were called from the command line.
But a weird thing is if I use TextMate to edit a single file from the shared drive I can see the php code I am trying to edit. It just doesn't work as a project.
Any suggestions or solutions on how I can use an IDE to edit files over WebDAV? And why do my IDEs display the content rendered, instead of the actual file on the file system.
I'm not a specialist at all but I seem to remember that WebDAV clients do send GET requests.
If I'm correct your server may not be able to discriminate between HTTP GET and WebDAV GET thus rendering your .php files. Why this would work that way when working with a project and another way while working with individual files is not clear, though.
Do you get rendered files when you add files to your project manually as well?

Deleting files on remote server

I have a PHP project in NetBeans with remote files (over sftp). When I create, modify anything these changes happening both locally and on my web server. However when I'm trying to delete a file or a folder it gets erased only locally. What could be the problem?
Permissions seems to be ok, all files belong to the user I'm using to access the server.
I'm using Netbeans 6.9.1, default configuration, all updates installed.
Netbeans does not have a synchronization function. It is limited to downloading and uploading files. What you can do is to use some external tool, for example WinSCP is capable of synchronizing local and remote directories.
I read what you wrote... but I think it could be a permissions problem.
I also use NetBeans and when I delete a file from the project window it first erase it locally and then syncs with my server.
I login through sftp (using vsftp) as root, which is a bad thing, but you could try this too to be sure if it's a permission issue.
You mistakenly turned off the settings. Please follow these steps:
Right click on the project name
Select properties
From the list of the left select 'Run configuration'
On the left almost down, look for the setting 'Upload files:'
Make sure you set that to 'On Save'
All the best man