emenegro
emenegro

Reputation: 6971

Xcode plugin for improving code completion

Recently I've done a small service (available in Github) to return a switch case structure from a given enum.

The next step is to achieve this behaviour as an Xcode code completion option when I begin typing the enumeration name.

Code completion

What I want is to add a new option in this popup giving the possibility of generating a switch case with those three options.

I'm searching for documentation to make an Xcode plugin but I can't find much. My first question, and the most important is: is it possible to get the definition of a symbol while I'm typing it, to extract the data of the enum and generate the snippet?

Upvotes: 13

Views: 1051

Answers (4)

emenegro
emenegro

Reputation: 6971

I just find a plugin that makes exactly what I wanted, SCXcodeSwitchExpander. It works like a charm :D

Upvotes: 0

Gougou
Gougou

Reputation: 387

You can have a look at KSImageNamed, an XCode plug-in used to add autocompletion on image name.

You can inspire yourself on its code.

KSImageNamed-Xcode

Upvotes: 7

Fonix
Fonix

Reputation: 11597

an alternative to what you are suggesting is to save it as a code snippet. it wont be dynamic like you probably want it, but if you are using the same enum over and over, it can work. enter image description here

Upvotes: 2

Related Questions