Can Poyrazoğlu
Can Poyrazoğlu

Reputation: 34780

Why does Xcode autocomplete always put my custom code snippets above actual completions?

I am using some personal Xcode snippets for shortcuts for like dispatching on main queue, or a @synchronized code. They have never interfered with Xcode's autocomplete function with regular methods.

Some time ago I've formatted my Mac, installed Xcode, and re-created the shortcuts the same way I did before:

enter image description here

Ever since, my shortcuts are always before anything else when autocompleting methods containing spaces, as seen below:

enter image description here

The completion for methods should obviously come before my custom snippets.

It also occurs before anything else on property completions either:

enter image description here

They should get listed and highlighted as I type d or dm, or s, sy and so on, just like the default snippets. They shouldn't be at top of everything.

Why would have it changed after the format, and how do I correct this (mis)behavior?

(I am currently on Xcode 9.3 but the problem used to occur before 9.3 too)

UPDATE: The issue still persists on Xcode 9.4.

UPDATE 2: The issue still persists on Xcode 10.1.

Upvotes: 0

Views: 196

Answers (1)

Ladd.c
Ladd.c

Reputation: 1013

Well, there is a new update Xcode 9.4, try with the update because I had the same problem, my solution was delete Xcode and reinstall the latest version, but I think only you need to clear the configuration to return like a first launch.

In the release note for Xcode 9.3 says:

  • Text in the Code Snippets library filter bar now includes code completion shortcuts. (8147546)
  • User-defined code snippets now appear at the top of the library, rather than the bottom. (8901028)

You can read full changes here Xcode Releases Notes

Upvotes: 1

Related Questions