Eclipse




2020-06-R

Installation

Plugins

Use the in-eclipse marketplace browser window. The search there seems better tuned to find 'names'.

  • Ansi Escape in Console
  • CMake Editor
  • (Not Yet Compatible) Eclipse Color Theme → http://eclipse-color-theme.github.io/update/
  • (Not Yet Compatible) Github Flavored Markdown Viewer
  • JSON Editor Plugin
  • (Not Yet Compatible) Json Tools
  • Markdown Editor
  • PyDev
  • ReST Editor
  • ShellWax (suitable replacement for ShellEd?)
  • YAML Editor

Preferences

Using Oomph now:

  • Ooomph→Setup Tasks→Preferences Recorder: Record to 'Installation'
  • General→Single Click: True
  • General→Appearance→Theme: Classic
  • General→Appearance→Use Round Tabs: True
  • General→Appearance→Colors & Fonts→Basic→Text Font: Size 9
  • General→Appearance→Colors & Fonts→WikiText→Monospace Font: Size 9
  • General→Appearance→Color Theme: RobotTicket
  • General→Appearance → Keys→Build All: -
  • General→Appearance → Keys→Build Project: Ctrl + B
  • General→Startup & Shutdown→Refresh Workspace on Startup: True
  • General→Startup & Shutdown→Confirm Exit When Closing Last Window: False
  • General→Startup & Shutdown→Workspaces→Prompt on Startup: False
  • General→Workspace→Build→Build Automatically: False
  • PyDev→Editor→Code Analysis→Do Code Analysis: True
  • PyDev→Editor→Code Analysis→Pep8: Error
  • PyDev→Editor→Code Analysis→Arguments: None (use setup.cfg in a pep8 section instead)
  • Run/Debug→Console→Console Buffer Size: 1000000 (default is too small for e.g. linting)
  • C++→Build→Environment→VERBOSE=1
  • C++→Build→Settings→Discovery→CDT GCC Built-in Compiler Settings→${COMMAND} ${FLAGS} -std=c++14 -E -P -v -dD "${INPUTS}"
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→(.*g?cc)|(.*[gc]\+\+)|(clang)
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→Container→Project
  • C++→Indexer→Cache Limits→Relative to Heap Size→20%
  • C++→Indexer→Cache Limits→Absolute Limit→512MB

New Projects

C++ Ament

  • Makefile project with existing code
  • C++ Build → Build Directory → ${workspace_loc:/${ProjName}}/../../build/${ProjName} 
  • C++ General → PreProcessor Include Paths → Providers → CDT GCC Build Output Parser → Compiler Command Pattern: Global or (.*gcc)|(.*[gc]\+\+)|(clang)
  • C++ General → PreProcessor Include Paths → Providers → CDT GCC Build Output Parser → Container Project
    • The project container will ensure that your include paths show up with your sources in the project explorer
  • C++ General → PreProcessor Include Paths → Providers → CDT GCC Built in Compiler Settings:  Global or ${COMMAND} ${FLAGS} -std=c++14 -E -P -v -dD "${INPUTS}"

Pydev & Tox

Setting up tox to work with your project (project by project case):

  • Click on External Tools → External Tool Configuration (run button with a suitcase at the top of the window)
  • Add a new program, the location of tox and the folder to run from.
  • Run it, you should see diagnostics appear in the console
  • For interactivity

Problems

Color Theme reverts to Eclipse's default theme on focus/restart and theme is Dark

Eclipse Color Theme Does not Save

  • Make sure to switch from Roboticket to something else, apply, then switch back and apply again
    • This ensures it gets recorded by Oomph

If not yet compatible, manually install (usually works)

  • Find the plugin you're chasing (usually linked to on their github site)
    • Find the update link and Install New Software OR
    • Manually drop in:
      • Download. There will be a feature and a plugin jar
      • Move the feature jar to dropins/features folder in your eclipse installation
      • Move the plugin jar to dropins/plugins folder in your eclipse installation

2018-2 (R)

This is all lies. Yatta eventually became a dead end and I cannot remember why (something to do with Java 8 being required for Yatta, but Java 11 for other things). I have something working now, but I need to rediscover what that is and whether it translates to another machine before documenting.

Yatta seems great, but tied to OpenJDK 8. For that, there are other issues, e.g. not much in the marketplace works because of no cacerts working.

Initialize everything into an installation setup. Synchronize with my account, it will send oomph preferences there.

Basic goal is to have a) one installation with all of it's plugins in /usr/lib/groot-eclipse, one workspace with preferences and preferences controlled by a Yatta profile.

Base Setup

  • Download the c++ package from eclipse downloads
  • Unarchive the tarball in /usr/lib/groot-eclipse/2018-12
  • Install Oracle's Java 11 (from where?)
  • Run sudo update-alternatives --config java and select /usr/lib/jvm/jdk-11.0.2/bin/java

Plugins

Preferences

Using Oomph now:

  • Ooomph→Setup→Preferences Recorder: Save to 'Installation'
  • General→Single Click: True
  • General→Appearance→Theme: Dark
  • General→Appearance→Enable Animations: True
  • General→Appearance→Colors & Fonts→Basic→Text Font: Size 9
  • General→Appearance→Colors & Fonts→WikiText→Monospace Font: Size 9
  • General→Appearance → Keys→Build All: -
  • General→Appearance → Keys→Build Project: Ctrl + B
  • General→Startup & Shutdown→Refresh Workspace on Startup: True
  • General→Startup & Shutdown→Confirm Exit When Closing Last Window: False
  • General→Startup & Shutdown→Workspaces→Prompt on Startup: False
  • PyDev→Editor→Code Analysis→Do Code Analysis: True
  • PyDev→Editor→Code Analysis→Pep8: Error
  • PyDev→Editor→Code Analysis→Arguments: None (use setup.cfg in a pep8 section instead)
  • C++→Build→Environment→VERBOSE=1
  • C++→Build→Settings→Discovery→CDT GCC Built-in Compiler Settings→${COMMAND} ${FLAGS} -std=c++14 -E -P -v -dD "${INPUTS}"
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→(.*g?cc)|(.*[gc]\+\+)|(clang)
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→Container→Project
  • C++→Indexer→Cache Limits→Relative to Heap Size→20%
  • C++→Indexer→Cache Limits→Absolute Limit→512MB

Problems

Color Theme reverts to Eclipse's default theme on restart Use oomph to record the preference

Manual Plugin Installation Instructions

  • Find the plugin you're chasing (usually linked to on their github site)
  • There will be a feature and a plugin jar
  • Move the feature jar to dropins/features folder in your eclipse installation
  • Move the plugin jar to dropins/plugins folder in your eclipse installation
  • Restart

Catching all the Settings

  • I need to use oomph to bake in settings, pointing at /usr/lib/groot-eclipse/2018-2/installation.setup, will this migrate to another pc if I wrap groot-eclipse into a deb?
  • Still doesn't catch the 'Dark' theme setting, have to manually flip that

Broken Yatta Instructions

  • Run sudo update-alternatives --config java and select java 8 (java 11 is horribly broken on bionic)
  • Install JavaFX: sudo apt install openjfx
  • First time only:
    • Start eclipse with workspace snorriheim
    • Install the Yatta Launcher from the marketplace
    • Restart eclipse
    • Make sure to record preferences in the yatta drop-down before changing any preferences
  • Runs into problems with trust anchors

Photon

Base - C++ IDE

Plugins - Marketplace

  • Ansi Escape - allow colour in the output of the console
  • Anyedit - bash syntax colouring
  • CMake Editor
  • Color Theme - different editor colour themes
  • Markdown Text Editor
  • PyDev
  • ReST Editor
  • YEdit

Plugins - Custom

Preferences

  • General→Single Click
  • General→Appearance→Theme→Dark
  • General→Appearance→Color Theme→Robotticket/Notepad++
  • General→Appearance→Color & Fonts→Size 9
  • General→Appearance→Keys→Build All→Clear
  • General→Appearance→Keys→Build Project→Ctrl+B
  • C++→Build→Environment→VERBOSE=1
  • C++→Build→Settings→Discovery→CDT GCC Built-in Compiler Settings→${COMMAND} ${FLAGS} -std=c++14 -E -P -v -dD "${INPUTS}"
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→(.*g?cc)|(.*[gc]\+\+)|(clang)
  • C++→Build→Settings→Discovery→CDT GCC Build Output Parser→Container→Project
  • C++→Code Style→Code Templates→Import Mine
  • C++→Code Style→Formatter→ROS
  • C++→Editor→Doc & Tool Comments→Doxygen
  • C++→Editor→Templates→Import 
  • C++→Indexer→Limit→40%
  • C++→Indexer→Absolute Limit→2048MB

Record Oomph Preferences on Eclipse

  • Click the icon to record preferences at the bottom left of the Window→Preferences dialog

  • Connect it with my eclipse account so I always get those preferences

Bugs

  • Eclipse Color Theme resets to default on restart, see this discussion, fix by enabling oomph recording

Oxygen

Base - C++ IDE

Plugins - Marketplace

  • Ansi Escape - allow colour in the output of the console
  • Anyedit
  • CMake Editor
  • Color Theme - different editor colour themes
  • Github Flavoured Markdown Viewer
  • Jenkins Editor
  • Markdown Text Editor
  • Protobuf-dt
  • Pydev
  • ReST Editor
  • Shell Script
  • Yedit


Plugins - Custom

Configuration

  • Theme - Dark, with SWT_GTK turned off.
  • Color Theme - Roboticket or Notepad++ like

Startup Script

#!/bin/bash
export SWT_GTK3=0  # Fixes light bars and widgets when using the Dark theme
exec /opt/eclipse/oxygen/eclipse/eclipse $@

Discovery

Need to change the build output parser and built-in compiler settings in Preferences->C++->Build->Settings->Discovery

Discovery Modifications : C++>Build>Settings
# Build Output Parser (detect /usr/bin/c++, so prefix with .*)
(.*gcc)|(.*[gc]\+\+)|(clang)
# Build Output Parser (container to keep discovered entries)
Project
# Built-In Compiler Settings (detect c++11)
${COMMAND} ${FLAGS} -std=c++14 -E -P -v -dD "${INPUTS}"

The project container will ensure that your include paths show up with your sources in the project explorer. Also make sure your projects are using the workspace settings (by default it is usually not).


After all this, I still have many problems with indexing getting mangled and various c++YY symbols not getting detected. See here for some help.

Neon

Plugins - CDT Platform


Plugins - Marketplace

  • Pydev - without the Mylin integration
  • AnyEdit - extra buttons and functions on the editors (e.g. tabs to space)
  • Color Theme - different editor colour themes
  • Ansi Escape - allow colour in the output of the console
  • Eclipse XML Editors and Tools
  • Github Flavoured Markdown Viewer
  • Markdown Text Editor
  • Yedit


Plugins - Custom

Dark Themes

Css playing havoc with the gtk settings (half the damn thing is hard coded to appear white). To fix:

Disabling the gtk css
$ cd /opt/yujin/eclipse/mars/plugins/org.eclipse.ui.themes_1.1.0.v20150511-0913/css
$ mv e4_default_gtk.css e4_default_gtk.not
$ touch e4_default_gtk.css

Mars

Plugins - CDT Platform

  • Git - all
  • Web Developer Tools (for xml editing)

Plugins - Marketplace

  • Pydev
  • CMake4Eclipse
  • AnyEdit
  • Color Theme
  • Ansi Escape
  • Github Flavoured Markdown Viewer
  • Markdown Text Editor
  • ReST Editor
  • Yedit

Plugins - Custom

Dark Themes

Css playing havoc with the gtk settings (what was the symptom?). To fix:

Disabling the gtk css
$ cd /opt/yujin/eclipse/mars/plugins/org.eclipse.ui.themes_1.1.0.v20150511-0913/css
$ mv e4_default_gtk.css e4_default_gtk.not
$ touch e4_default_gtk.css

Discovery

Need to change the build output parser and built-in compiler settings:

Discovery Modifications
# Build Output Parser (detect /usr/bin/c++, so prefix with .*)
$ (.*gcc)|(.*[gc]\+\+)|(clang)
# Built-In Compiler Settings (detect c++11)
$ ${COMMAND} ${FLAGS} -std=c++11 -E -P -v -dD "${INPUTS}"

You can hardcode these in plugins/org.eclipse.cdt.managedbuilder.core_8.3.0.201506070905.jar

Hacking Discovery
# copy the jar to a temporary location somewhere
$ jar xf org.eclipse.cdt.managedbuilder.core_8.3.0.201506070905.jar
 
# edit plugin.xml
# - search for 'clang' and change the compiler build output pattern as above
# - search for 'FLAGS' and change the built in compiler settings as above
 
# put the updated plugin.xml back into the jar
$ jar uf org.eclipse.cdt.managedbuilder.core_8.3.0.201506070905.jar plugin.xml
 
# copy it back to your eclipse's plugin dir

Laggy Themes


On kubuntu, usually your gtk theme will be oxygen-gtk. This is notorious for having issues with eclipse, greatly slowing down the editor and those guys are having a fight with gnome devs anyway, so that future is bleak.

Some instructions for playing around with themes:

  • Get a decent theme from nooblab, instructions here (try Mediterranean Darkest):
Mediterranean Theme
sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install mediterranean-theme 
  • Get a previewer for kde system settings, sudo apt-get install kde-config-gtk-style-preview
  • In KDE, set the theme you want to use from System Settings->Application Appearance->GTK
  • If you don't want to use such a theme for all your gtk apps, you can configure eclipse for just that theme too - try the instructions here.
  • If you want to use a gtk2 theme instead of a gtk3 theme:
GTK2 | GTK3 - eclipse.ini
--launcher.GTK_version
2
--launcher.appendVmarg