Editor.Profile

Profile module for operating profiles

Methods

Editor.Profile.load (name, type, defaultProfile)

  • url string - The url of the profile.
  • defaultProfile object - The default profile to use if the profile is not found.
    Load profile via url, if no profile found, it will use the defaultProfile and save it to the disk.You must register your profile path via Editor.Profile.register before you can use it.

Example:

  1. // register a project profile
  2. Editor.Profile.register( 'project', '~/foo/bar');
  3. // load the profile at ~/foo/bar/foobar.json
  4. let profile = Editor.loadProfile( 'profile://project/foobar.json', {
  5. foo: 'foo',
  6. bar: 'bar',
  7. });
  8. // change and save your profile
  9. profile.foo = 'hello foo';
  10. profile.save();

Editor.Profile.register (type, path)

  • type string - The type of the profile you want to register.
  • path string - The path for the register type.
    Register profile type with the path you provide.

Editor.Profile.reset ()

Reset the registered profiles

IPC Message

Message: 'editor:load-profile'

Message: 'editor:save-profile'