How can I change the VS Code's ftp-simple extension's default directory for download and save? - visual-studio-code

I am using the ftp-simple extension to sync files between my local directory and server.
I can see that ftp-simple using temporary folder of my machine for download and save files in local machine like
C:\Users\VEDA\AppData\Roaming\Code\User\globalStorage\humy2833.ftp-simple\remote-workspace-temp\bc12981df966e588ed8253a3d7911ba5
I want save it in my other drive and directory, its possible?
I have tried to set project directory in setting json file like
"project": {
"K:/MyDirectory": "/"
},
But its look like useless. Let me know if someone using windows and have vscode working like above I have mentioned.

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

vscode: Where stores the session data (restored opened files)? Is that possible to use relative path?

If I use vscode to open a directory and then opened some files and quit, vscode will reopen all the files at the next time when it launches.
But there is a problem. It seems vscode is not using relative path for storing this info and does not store this info inside the project directory. So if I move the directory or rename it, and then open the directory again, for example code projectNewName/, my previous session (opened files/opened editors) are lost. I have no idea where this session data stores and if it is possible to configure it to store relative path and save the session file inside the project directory, for example, project/.vscode or project/.vscode/session. If the opened editors session is stored inside a project directory, it will be restored regardless where the directory is and what the directory name is.
TL;DR: currently, configuration of this path is not supported.
VSCode stores the states for all the workspaces, in its global config folder under /Code/User/workspaceStorage/. See the path to the settings.json in this help paragraph for your OS and then just replace the end of the path. For Windows, for example, the settings path is %APPDATA%\Code\User\settings.json, so the state storage is
%APPDATA%/Code/User/workspaceStorage/
In this directory, there are many subdirectories with some hex names. Please, refer to my another answer for a python script to browse it. Each folder contains a workspace.json with mostly data only referring to the path of the workspace. There are also state.vscdb files in these directories. These are sqlite databases with only one table:
CREATE TABLE ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB);
It is used as a key|value storage for all the state variables like:
workbench.panel.output|{"workbench.panel.output":{"collapsed":false,"isHidden":true}}
As far as I see from VSCode source, currently only a global path from the environment is used to locate this file:
this.environmentService.workspaceStorageHome
this.environmentService.globalStorageHome
which resolves to
get workspaceStorageHome(): URI { return URI.joinPath(this.appSettingsHome, 'workspaceStorage'); }
get globalStorageHome(): URI { return URI.joinPath(this.appSettingsHome, 'globalStorage'); }
So, it seems there are currently no options to customize it from the settings.json.

VS Code don't load the user-data

My problem is that the portable version of visual studio code don't load my settings I had copied from the folder %APPDATA%/code/user.
I loaded the .zip data and extracted the folder. I added a data folder into the extracted folder of VS Code. It's in Visual Studio Code\data. In there i copied the folder "user" from %APPDATA%/code/ and renamed the user folder into "user-data". Then I started code and the usersettings are not loaded.
The command .\code.exe --user-directory .\data\user-data won't work.
Is this a bug or did I do something wrong?
In portable mode, the --user-directory command linte option is ignored.
From the documentation:
--user-data-dir <dir>
Specifies the directory that user data is kept in, useful when running as root. Has no effect in Portable Mode.
Instead, use the default location of user data for a portable install and copy your user data to that directory (from a previous comment it seems like you've already done so successfuly).
For anyone wishing to use a different user data directory when in portable mode, symlink-ing the user data folder should be a viable option if on a linux-like platform.
(Trivia: this was at first reported as bug, after which the documentation was updated, rather making it a feature.)
You can simply create a folder called data in the root folder with
VS Code.
After the startup, the files with standard settings will be
created in the data folder.
Then you can just copy the settings from the folder %AppData%\Code\User to the folder data\user-data\User.
To migrate already installed extensions, copy the contents of the %HomePath%\.vscode\extensions folder to the data\extensions folder.

How To Sync Visual Studio Code Local Files With Mapped File Server?

Here is a simple description of my problem. If you need more information please inquire.
I am not seeing any way that you would be able to sync files from my local computer to another file server. Is there a way that this would be possible using Visual Studio Code and a mapped network drive file server?
https://marketplace.visualstudio.com/search?term=sync&target=VSCode&category=All%20categories&sortBy=Relevance
You can sync files to another machine via a plugin called 'ftp-sync' this will allow you to send files to a destination via the FTP or SFTP protocol. This plugin also allows automatic upload on save (which is awesome).
See Url: https://marketplace.visualstudio.com/items?itemName=lukasz-wronski.ftp-sync

Change .vscode folder location

I'm programming a client side applications using SharePoint Designer 2013.
I want to change to VSCODE since it supports a lot of extensions for some Javascript library like angular, jQuery. And because of the Chrome/Node.js debugger extension.
But when I try to start any Debugger, I got the error:
Unable to create 'launch.json' file inside the '.vscode' folder (Error: UNKNOWN: unknown error, mkdir '\\servername\DavWWWRoot\sitename\Style Library\.vscode').
I get this error because it's impossible to create a folder in SharePoint where the name starts with dot.
So there's a possibility to change the name of this folder or the file location to any directory in my local computer?
No, it's not possible to move/rename that folder. VS code is a tool that bases project management on folder content. So it is essential that the project settings reside in the folder being managed.
You can move the "extensions" folder, but unfortunately not the argv.json (so the ".vscode" will, at least be recreated on vscode launch)
https://github.com/microsoft/vscode/issues/17691#issuecomment-559234574
I hope that'll finally change sometime .
https://github.com/microsoft/vscode/issues/3884
https://github.com/OmniSharp/omnisharp-roslyn/issues/953