Where are formatter profiles stored in Eclipse? I know how to export them, but how can I figure out the path of the currently used one?
The profile is saved as part of the org.eclipse.jdt.ui.prefs preferences file in the workspace .metadata/plugins/org.eclipse.core.runtime/.settings directory.
This is basically a normal Java Properties file, but the contents is very messy.
Related
Whenever I open a folder that I've already worked in, VSCode is clever and reopens it in the exact same layout I already had it. However, I have absolutely no clue how it does that - I can't find a config file or anything anywhere, which is something I'd love to have; in my specific usecase I create a lot of workspaces and they all have the same sort of structure, so if I could save that layout so I didn't have to recreate it every time it'd be great.
The answer ends up being super annoying... they're stored in %APPDATA%\Code\User\workspaceStorage in some hashed looking folder names, which contain a pretty useless workspace.json file (all workspaces) and all other info stored in a *.vscdb (and its associated *.backup file), which is a SQLite Format 3 file storing all that information. It's barely used as a database from what I can see, a json file could do just as well, but I digress...
tl;dr they're a pain to get out.
VSCode mainly saves all of the preferences and user choices in the settings.json file. Moreover, you can actually set your preferences in VSCode Settings. But if you want to copy/paste your workspace settings to different workspaces, I guess the best choice would be to look at your settings.json layout settings.
Go to File > Preferences and adding them in the right pane, in "User Settings" if you want to keep them for all workspaces or in "Workspace Settings" for this workspace only.
To see settings for layouts and explorer, search for explorer.
You can read more about settings.json defaults and attributes exposed here
Due to a bug in Eclipse, every time I try to change the Code Formatting preferences, Eclipse crashes. Thus, I cannot edit code formatting preferences via Eclipse's built in window editor. These are workspace specific preferences. Where can I find the file to edit the preferences manually?
It looks like the code format profiles are stored in the workspace .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs file
This is a Java properties format file. The code formatter settings are in the org.eclipse.jdt.ui.formatterprofiles property. The value is an XML object. This is going to be hard to edit!
I have three common workplaces where I use the Eclipse IDE.
A nice trick when using multiple common workplaces is to copy certain configuration files to Dropbox, and link to them in the original configuration location. This way, all settings and changes are instantly available in your other workplaces.
You've got your workspace with a whopping 100 megabytes of files. You've got your .eclipse which is closing in on 200 megabytes.
I would like to know which specific files contain my custom javascript code templates, and which contains my keyboard shortcuts, so I can share these, and only these, with myself through Dropbox.
Ideally, I'd like a list of of certain settings and their locations so I can choose to share more. But I haven't found something like this on Google.
Why am I not just sharing my entire workspace and configuration directory? Well, first, it is crazy big. Second, Eclipse is modular. In some places I use certain modules that I don't use elsewhere. And you all know that modules/plugins are a crazy mess of files and configuration from which there is no escape.
You can try to export Eclipse preferences from one workspace and export them to other workspace. If it doesn't work for your, enter a bug against corresponding Eclipse project.
I figured it out.
You can copy your ~/workspace/eclipse/.metadata to somewhere. Change a preference, and sync your workspace to your backup in order to find out what files are changed.
You'll find that a lot of settings are in ~/workspace/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/. The javascript templates and other javascript options are in ~/workspace/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.jsdt.ui.prefs
org.eclipse.wst.jsdt.ui.prefs = Code Templates
org.eclipse.jdt.ui.prefs = Syntax Coloring
org.eclipse.ui.editors.prefs = Text Editors
In Eclipse you can format the whole source tree. You can format the whole project by right clicking it -> Source -> Format. You can do the same for sub-folders. I want to be able to do this automated for a specific set of sub-folders in my project, is there a way?
You can have the formatter run automatically on saving files, but the formatting is only applied to the edited files then (not a specific folder).
However, I do not see any good reason to not format all sources of a project the same way, which is why I hope you can take that as solution. :)
So i want to format a bunch of files that i have to a certain standard. The problem is, there is A LOT of files. Is there anyway to have Eclipse open a file, hit CTRL+SHIFT+F (to format the file), save it, close it, then open the next file and repeat that process through a directory that i specify?
I don't have any experience with scripting so i have not even attempted doing something like this. I looked into plugins for Eclipse that could maybe do this but i really didn't get anywhere.
Any help is appreciated.
Thanks
You can right-click on any source folder in the Package Explorer (including the root of the project) and select Source > Format, or Source > Cleanup (which gives you even more control than a simple format)
You can right click on a folder in the Navigator or Package Explorer view and select Source -> Format. This will format all the files in the selected directory.