GE Lua Documentation

Press F to search!

loadEditorExtensions

Definition


-- @/lua/ge/extensions/editor/main.lua:171

local function loadEditorExtensions(names)
  for _, name in ipairs(names) do
    extensions.load(name)
    if extensions.isExtensionLoaded(name) then
      table.insert(M.extensionNames, name)
      if extensions[name].onEditorRegisterPreferences then
        extensions[name].onEditorRegisterPreferences(editor.preferencesRegistry)
      end
    end
  end

  -- save the current prefs
  editor.savePreferences()
  -- reload them again to have the new loaded extension access them too
  editor.loadPreferences()
  editor.updatePreferencePages()

  for _, name in ipairs(names) do
    if extensions[name].onEditorRegisterApi then
      extensions[name].onEditorRegisterApi()
    end
    if extensions[name].onEditorInitialized then
      extensions[name].onEditorInitialized()
    end
    if extensions[name].onEditorActivated then
      extensions[name].onEditorActivated()
    end
  end
  if not editor.preferencesRegistry.dontCallHookForSetValue then
    -- set value to trigger new extension to update its pref related data
    editor.preferencesRegistry:callHookForSetValue()
  end
end

Callers

@/lua/ge/extensions/editor/veMain.lua

  editor.loadEditorExtensions(combinedExtNames)