Skip to content

Commit

Permalink
Added support for C++ enums and better handling of non-anonymous ones
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed May 1, 2015
1 parent bc27fea commit 4de0299
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SCXcodeSwitchExpander is a small Xcode plugin that expands switch statements by

- takes a bit for it to kick in after starting Xcode as it's waiting for the IDEIndexDidChange notification. I found that building the project usually makes that happen.

- only works with NS_ENUM but keeps default Xcode behavior for old style enums
- does not work with anonymous enums

### Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ - (BOOL)tryExpandingSwitchStatement

// Fetch all symbols matching the autocomplete item type
NSString *symbolName = (item.displayType.length ? item.displayType : item.displayText);
symbolName = [[symbolName componentsSeparatedByString:@"::"] lastObject]; // Remove C++ namespaces
symbolName = [[symbolName componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] lastObject]; // Remove enum keyword

IDEIndexCollection *collection = [index allSymbolsMatchingName:symbolName kind:nil];

// Find the first one of them that is a container
Expand Down

0 comments on commit 4de0299

Please sign in to comment.