avp::ptr weblog

Everything that is in our mind.

Archive for the ‘autocompletion’ tag

How to fix Eclipse colors for autocompletion and tooltips

with 11 comments

Sadly Eclipse ships with a broken color theme when it comes to autocompletion and tooltips. I cannot tell if the problem is limited to Ubuntu Precise, however, it is worth getting fixed immediately. The following screenshots illustrate the broken color settings in both situations. The tooltip window shows up with a black background color and blue links.

Eclipse IDE - Tooltip with default colors settings

Eclipse – Tooltip with default colors settings

When autocompletion popup appears the first suggestions is not readable at all.

Eclipse IDE - Autocompletion with default colors settings

Eclipse – Autocompletion with default colors settings

So, here is what you need to do to fix the colors. Read the rest of this entry »

Written by tobi

July 28th, 2012 at 5:11 pm

Custom NSLog for Xcode 4

without comments

This post describes how you can to setup a custom NSLog snippet in Xcode 4. By default, this custom NSLog prints the class and method name of the position it is inserted.

NSLog auto completion

NSLog auto completion

Please follow these steps to add the code snippet to the scripts in Xcode 4.

  1. Copy and paste the following code into your editor. Anywhere.
    NSLog(@"%@ %@", self.className, NSStringFromSelector(_cmd)); /* DEBUG LOG */
  2. Open up the code snippets library which sits in the utility pane on the right side. Look for the curly braces {}.
  3. Highlight the above mentioned code – click and hold the mouse over the text  (for a short while) – drag them into the code snippet library.
  4. Afterwards you can edit the snippet and add a title, summary and a completion shortcut. I used the following settings:
                  Title: Custom NSLog (Class & method name)
                Summary: NSLog prints the class and method name
               Platform: All
               Language: Objective-C
    Completion Shortcut: NSLog
      Completion Scopes: All
Custom NSLog snippet

Custom NSLog snippet

You are welcome to comment and post your custom code snippets!
This article is inspired by the post “Easy Doxygen code snippets for Xcode 4” by Chris Powell.

Written by tobi

October 26th, 2011 at 9:06 pm