Bug 1408795 - Have Eclipse CDT treat Objective-C files as C++. r=botond
Without this setting, eclipse will refuse to open Objective-C files (it will
defer to an external editor). Adding *.mm to the file types that are treated
as C++ allows Eclipse to open them, and to provide some code assistance for
the bits of the files that it can understand.
MozReview-Commit-ID: FRGcvqf2KFs
--- a/python/mozbuild/mozbuild/backend/cpp_eclipse.py
+++ b/python/mozbuild/mozbuild/backend/cpp_eclipse.py
@@ -112,16 +112,20 @@ class CppEclipseBackend(CommonBackend):
fh.write(workspace_lang_settings)
self._write_launch_files(launch_dir)
core_resources_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.core.resources.prefs')
with open(core_resources_prefs_path, 'wb') as fh:
fh.write(STATIC_CORE_RESOURCES_PREFS);
+ core_runtime_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.core.runtime.prefs')
+ with open(core_runtime_prefs_path, 'wb') as fh:
+ fh.write(STATIC_CORE_RUNTIME_PREFS);
+
ui_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.ui.prefs')
with open(ui_prefs_path, 'wb') as fh:
fh.write(STATIC_UI_PREFS);
cdt_ui_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.cdt.ui.prefs')
cdt_ui_prefs = STATIC_CDT_UI_PREFS
# Here we generate the code formatter that will show up in the UI with
# the name "Mozilla". The formatter is stored as a single line of XML
@@ -541,16 +545,20 @@ tabWidth=2
undoHistorySize=200
"""
STATIC_CORE_RESOURCES_PREFS="""eclipse.preferences.version=1
refresh.enabled=true
"""
+STATIC_CORE_RUNTIME_PREFS="""eclipse.preferences.version=1
+content-types/org.eclipse.cdt.core.cxxSource/file-extensions=mm
+"""
+
STATIC_UI_PREFS="""eclipse.preferences.version=1
showIntro=false
"""
STATIC_CDT_CORE_PREFS="""eclipse.preferences.version=1
"""
FORMATTER_SETTINGS = """org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16