WebStorm auto upload on file save - intellij-idea

I have established an SFTP connecting between my WebStorm and host.
How can I configure WebStorm to autoupload the current file to the server when I hit save?

Make sure that this deployment entry you have configured is marked as Default for this project (as auto upload will work for default entry only)
Settings/Preferences | Build, Execution, Deployment | Deployment | Options
Upload changed files automatically to the default server -- choose another option than Never.
You can read more about deployment in this official manual/how-to -- it's for PhpStorm and written for older version but it's exactly the same for all JetBrains' IDEs (just slightly different path to the actual settings).

Open the settings with Ctrl + , or Cmd + ,.
In the search bar to the top, type in Upload changed and it should take you to the Deployment -> Options page. There, you can choose to upload automatically, upload on explicit save (with Ctrl + S or Cmd + S), or don't automatically upload.

Related

How to use specified XML file to format code on remote IntelliJ Project?

How can I force IntelliJ, when working on a remote project, to use the specified format specified in an XML file?
I noticed that no matter what settings I put, the formatter in IntelliJ will not honor my settings and will instead use the default formatter.
I have tried going on the remote host and changing the settings, change the settings in the cache, and changing the settings on my guest machine. Nothing seems to stick.
When I am connected to remote via IntelliJ, I can go to preferences and confirm that my desired format settings for Java are set. However, when I format, again, the default formatter is used.
What ended up working was creating the project on my local machine. This creates a .ijwb and related bazel project files.
I then moved this .ijwb folder to my remote machine. This fixed the issue and used the correct bazel options and formatter options.

WebStorm saves files on edit

My JetBrains WebStorm gone crazy and started to save files right after I type the character. Autosave settings are disabled (I like to save files manually). Any ideas why this could happen or how to fix it?
WebStorm doesn't normally auto-save files on each key pressing. If it only happens while debugging your app, check if Live Edit (that is active during debug session) is enabled in Preferences | Build, Execution, Deployment | Debugger | Live Edit - it auto-saves files to provide live reload. Some other plugins can also be responsible for auto-saving - for example, third-party SonarLint and ESLint plugins are known for causing such issues, as they save files to run analysis on the changes, Flow service, when enabled, flashes files to disk to submit up-to-date files to Flow type checker, etc.
I'd also suggest to check if you have any file watchers set up in Preferences | Tools | File Watchers - those watchers that have Auto-save edited files to trigger the watcher enabled can cause auto-saving of the files included in watcher scope

How to synchronise jEdit settings between multiple computers

I use jEdit as a text editor, because it's cross-platform, and has all the features I need (Java regular expressions, keystroke macros, etc). However, it's a pain to set up on a new computer, and to synchronise settings (keyboard bindings, file save options, etc).
Can anyone suggest a good way of doing this? Ideally it should synchronise in the background, perhaps writing to a Dropbox folder. I've had a look in the jEdit plugins, and there doesn't appear to be anything.
Thanks!
I use the following macro to clean up and zip my jEdit settings directory to my Google Drive directory on my Mac:
void delete(String name) {
path = jEdit.getSettingsDirectory()+"/"+name;
VFS vfs = VFSManager.getVFSForPath(path);
session = vfs.createVFSSession(path,view);
vfs._delete(session, path, view);
if (session != null) vfs._endVFSSession(session,view);
}
runInSystemShell(view, "cd " + jEdit.getSettingsDirectory());
// clean up files
delete("abbrevs"); // I use SuperAbbrevs
delete("killring.xml");
delete("recent.xml");
delete("perspective.xml");
delete("activity.log");
delete("history");
delete("printspec");
delete("registers.xml");
delete("pluginMgr-Cached.xml.gz");
delete("macros" + File.separator + ".macroManagerCache"); // File.separator = System.getProperty("file.separator")
delete("server");
delete("jedit_quicknote.txt"); // or qn.txt
delete("mirrorList.xml"); // mirrorList can be updated by Options -> Plugin Manager
// clean up directories
delete("jars-cache");
delete("settings-backup");
delete("cache");
delete("DockableWindowManager");
delete("PluginManager.download");
delete("printspec");
runInSystemShell(view, "rm -f ~/Google\\ Drive/doc/jedit.zip; zip -r ~/Google\\ Drive/doc/jedit.zip * -x '*.DS_Store'");
Then I can run the following alias to unzip the settings on other machines:
alias je_sync="rm -rf ~/.jedit/*; unzip ~/Google\ Drive/doc/jedit.zip -d ~/.jedit/"
There is no built-in or plugin way I'm aware of to synchronize jEdit settings. But everything should be stored in your settings directory. ("should" because some plugins might store stuff elsewhere, especially if it uses settings together with other ways to do stuff, like git or svn that store user credentials in ~/.subversion/ and so on. Where the settings directory lives depends on the OS you are using jEdit on if you do not use the -settings switch to start jEdit).
So to synchronize the settings, just synchronize the settings directory via some means like Google Drive, Box, Dropbox or anything else. You can even make jEdit directly use those directories with the -settings switch, e. g. if you are on an OS that does not properly support symlinks like Windows.
But be aware that there can arise serious problems or unexpected behaviour. E. g. you will also sync stuff like recent files, last window and dialog positions, last opened files, ...
And more importantly, jEdit currently does not behave too well if you run two instances in the same settings directory, this for sure also would cover cases where you sync the settings folder via some means.
One scenario that will happen if you use two jEdit instances (not windows, real instances, like opened with -noserver) on the same computer on the same settings directory and will for sure also happen with such a synced directory:
instance A starts running, reads the settings files and stores their last modification date
instance A writes configuration file Z and stores its last modification date
instance B starts running, reads the settings files and stores their last modification date
instance B writes configuration file Z and stores its last modification date
instance A wants to write configuration file Z, but sees that its last modification date is newer than what it remembered. It will give a warning to the log, but nothing more and will not save file Z anymore until restarted.
So if Z e. g. is the properties file, any settings changes done after this in instance A will just be lost and not saved. And this happens on a per-file basis, depending on which instance first writes a certain file after both instances were started, so some files may be locked by instance A, some by instance B which could further increase confusion.
So, if you are ok with syncing stuff like recent files, last open files, and other stuff with paths in it and so on and so on and you make sure that you will not use two jEdit instances on the same settings directory at the same time, it could be ok to just use something like Google Drive or alike.

Autoreload file system changes in phpstorm/webstorm/intellij

Ahoi
I have an project with grunt, and whenever I save a file it runs the csscomb script in the grunt:watch task. My old "IDE" Sublime reloaded the changes automatically, phpStorm doesn't do that. I always have to manually synch the file.
The whole problem is that I write code, save in between and continue programming, and then the popup about the file system changes appears.
LG
Do you run grunt:watch outside of webStorm, or using Grunt console? In the latter case, the file system should be synchronized when task is completed. But if the task is run externally, outside of webstorm, you have to synchronize files manually
I know this is old stuff, but I had the same problem with WebStorm - i.e grunt running externally on a network server.
I just unchecked "use safe-write ..." in Settings > Appearance & Behaviour > System Settings and now my WS writes saves directly to the file triggering watch grunt tasks.
Try Preferences -> Appearance & Behavior -> System Settings -> Synchronize files on frame activation. PHPStorm will automatically reload file system changes once you switch to its window.

PhpStorm Deployment menu greyed out

I've added a server in PhpStorm deployment settings but the Tools -> Deployment -> Upload to menu is still greyed out.
You need to specify a deployment path mapping in your server. Even if it's just the root path, you need to enter /. PhpStorm doesn't do it automatically.
Go to your server in deployment settings, click the 'Mappings' tab and enter slash (or your mapping) in the 'Deployment path on server' field. You don't need to enter a web path. Deployment menu should be ungreyed now.
In version 2019.2, if you dont set the path to / in mapping, it will grayed out.
Previous version, you could leave it blank
Also, if your local path (inside mappings configuration) is not your project root, you have to click on the deployable folder in the project tree to enable the menu.
Also, if the Deployment menu is completely missing at the bottom of the context menu, then set up a default server.
Click the server with the check mark to make a server the default option for a project.
Then you will get this additional menu when you right click on a file, folder, or the project.
I also encountered this issue in PyCharm Professional 2022.1.
Since the aforementioned solutions did not work for me, and it took me some time to resolve, I am providing the solution I found.
Clicking on Tools -> Deployment -> upload to servername was not working for me no matter what I tried.
However, I could right-click on the main project folder (on the left of the PyCharm window, where the project folder/file structure is visible). This right-click opens a menu, where there is an option for deployment -> upload to servername.
Once I clicked this, not only it worked, but the classical way (Tools -> Deployment -> upload to ) ceased to be grayed out also.
If deployment was available and suddenly no longer works, confirm that your credentials didn't get wiped from the deployment settings (Connection tab).
If any of these answers don't help, because you can't even see the server menu, you probably have the Remote Hosts Access plugin disabled.
Go to settings, go to the plugins, and enable Remote Hosts Access.
Please check if the following options are enabled in settings(Ctrl+Alt+S). It goes uncheck if Php Storm crashes. Check the below options and restart the editor.
This works for ver 2017.2.1
Also, check Windows->Store current layout as the default just to make sure in the future you can restore the layout.
It's possible the opened file in the editor belongs to a External Library (bottom of project tree).
These External library files can't be deployed.