Is there a way to disable or modify Xcode's code completion?

拜拜、爱过 提交于 2019-11-30 17:48:14
Kendall Helmstetter Gelner

You can override any of the existing code completions, copy any of the .xtcmacro files from:

/Applications/Xcode.app/Contents/PlugIns/TextMacros.xctxtmacro

(you'll have to right-click on Xcode.app and say "Show Package Contents" to proceed further down the directory chain unless you are using Terminal)

into a local directory:

~/Library/Application Support/Developer/Shared/Xcode/Specifications

(You'll probably have to make the Specifications directory). Then simply go through all of the definitions in there, to eliminate an annoying completion you can take out the CompletionPrefix for any entry, or edit the code to be inserted to work how you like.

On a side note, you can put any file named .xctxtmacro and put it in that specifications directory and it will be read in, allowing you to define some very useful custom macros.

The "Text Editing" and "Indentation" preference sections might have the settings you seek.

You can set "Automatically suggest" to "never".

You can enable/disable code completion in Xcode using below steps:

  1. Click on Xcode menu on top-left corner
  2. Select Preferences... (Preference Pop-up appears)

  1. Select Text Editing menu
  2. See Code Completion.
  3. Uncheck Suggest completion while typing option.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!