简体   繁体   English

自动补全在Xcode 7.2.1中不起作用

[英]Autocompletion is not working in Xcode 7.2.1

I have an init in Tile.swift : 我在Tile.swift中有一个init:

init(cellFrame:CGRect, padding:CGFloat, text: String, index: TileIndex,  boundRect: CGRect) {
    ....
}

but I'm seeing an old version (from a previous save) of the init() from my unit test file when trying to autocomplete it. 但是在尝试自动完成时,我在单元测试文件中看到了init()的旧版本(以前保存过)。

在此处输入图片说明

I've cleaned the project, but that does not bring the autocorrect symbols up to date. 我已经清理了该项目,但是并没有使自动更正符号保持最新状态。

I cleaned up derived data and things got worse. 我清理了派生数据,情况变得更糟。 Same worse result after restarting XCode. 重新启动XCode后,同样糟糕的结果。

在此处输入图片说明

Other Symptoms. 其他症状。
The autocomplete on this file was working at one time and something changed during a refactoring of the Tile class (I don't know what). 此文件的自动完成功能一次起作用,并且在Tile类的重构过程中发生了一些变化(我不知道是什么)。

The Tile type is visible (autocomplete working) from files in the main product target files, but not in the test target file. 在主要产品目标文件中的文件中,(在测试目标文件中)看不到“图块”类型(自动完成工作)。

What is the proper magic sequence I'm missing? 我缺少的正确魔术顺序是什么?

Found the problem. 找到了问题。 While doing the refactor there were many expected compile errors. 在进行重构时,会有许多预期的编译错误。 The Tile class file compiled OK but another class in the that module was failing the compile. Tile类文件编译成功,但是该模块中的另一个类编译失败。 I just wanted my unit test to work so I was ignoring the other files errors and cleaning up the errors in my unit test file. 我只是希望单元测试能够正常工作,所以我忽略了其他文件错误并清除了单元测试文件中的错误。

While working on the content, I didn't notice an error way up at the top test of the test file. 在处理内容时,在测试文件的最高测试中我没有发现错误。

@testable import myAppModule ERROR: No such module 'myAppModule'. @testable import myAppModule错误:没有此类模块“ myAppModule”。

Apparently, ANY ERRORS IN ANY OF THE FILES hides the whole module from the unit test file. 显然,任何文件中的任何错误都会在单元测试文件中隐藏整个模块。

Solution: Remove all compile errors from the module under test in order for a unitTest file to see the module. 解决方案:从被测模块中删除所有编译错误,以便unitTest文件查看该模块。

I understand it, but I don't like it. 我了解它,但我不喜欢它。

I wonder I Apple could improve on this behavior? 我不知道我的苹果可以改善这种行为吗? Comments welcome. 欢迎发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM